哪些步骤,将莱因戈尔德-蒂尔福德算法,如何可能我编程吗? [英] What are the step to the Reingold-Tilford algorithm and how might I program it?

查看:773
本文介绍了哪些步骤,将莱因戈尔德-蒂尔福德算法,如何可能我编程吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从presentation:图和树的第3页上,存在的期间Reigngold-蒂尔福德过程所发生的可视presentation;这也给了一个模糊的总结,这个算法的前手:......开始自下而上通树; [饰面用]自顶向下的通行证最后阵地的任务......我可以同时实现双向通过递归的方式,我知道,Y值(S)的各自对每个节点的代的水平,但我还是输了,如何在X坐标都解决了。

From the presentation: Graphs and Trees on page 3, there is a visual presentation of what takes place during the Reigngold-Tilford process; it also gives a vague summary to this algorithm before hand: "...starts with bottom-up pass of the tree; [finishes with] Top-down pass for assignment of final positions..." I can achieve both directional passes through recursive means, and I know that the Y-value(s) are respective to each node's generation level, but I'm still lost as to how the X-coordinates are solved.

我没碰到过这样的项目:的图形画树控制WPF 但有这么多的code我有很大的困难的定位应该是什么简单的2-3的方法来定义X值。 (也有WPF没有经验也一样)

I did come across this project: A Graph Tree Drawing Control for WPF but there is so much code I had great difficulty locating what should be a simple 2-3 methods to define the X-values. (Also have no experience with WPF as well)

我一直在寻找和试验如何做这方面的好几天,所以你的帮助是非常AP preciated!

I have been searching and experimenting how to do this for several days now, so your help is much appreciated!

推荐答案

一对夫妇的文章都可以,包括code,Python中的的 billmill.org 和C对的一1991年2月1日的第2页= nofollow的>博士。道博的杂志文章。你提出要简单的2-3方法(或许意味着食谱的方法),但在所有的通用性很好的借鉴树是一个NP完全问题(见Supowit,KJ和EM莱因戈尔德的绘图树的复杂性很好,学报Informatica的18,4,1983年1月,377-392,在DDJ文章中参考文献4)。该莱因戈尔德-蒂尔福德方法绘制二叉树或多或少很好的线性时间,并Buchheim的变化绘制正叉树或多或少很好的线性时间。然而,billmill文章指出,(说明第6项原则后不久)每一次,到目前为止,我们已经看了一个简单的算法在这篇文章中,我们已经找到了不足......这样的简单的方法的可能性工作确定小。

A couple of articles are available that include code, in python at billmill.org and in C on page 2 of a 1 February 1991 Dr. Dobb's Journal article. You have asked for "simple 2-3 methods" (perhaps meaning cookbook methods) but drawing trees nicely in all their generality is an NP-complete problem (see Supowit, K.J. and E.M. Reingold, "The complexity of drawing trees nicely," Acta Informatica 18, 4, January 1983, 377-392, ref. 4 in the DDJ article). The Reingold–Tilford method draws binary trees more or less nicely in linear time, and Buchheim's variation draws n-ary trees more or less nicely in linear time. However, the billmill article points out (shortly after stating Principle 6), "Every time so far that we've looked at a simple algorithm in this article, we've found it inadequate..." so the likelihood of simpler methods working ok is small.

这篇关于哪些步骤,将莱因戈尔德-蒂尔福德算法,如何可能我编程吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆