Topic: graph algorithm

I am developing a ruby program that should be able to draw a genogram (a hierarchical tree with family relations) on a web page.

I am therefore looking for an algorithm for drawing a genogram or a similar tree-structure or some references explaning the principles behind such an algorithm

Any help about how to implement a genogram would be much apriciated

Re: graph algorithm

In what format? jpeg/png, svg?

Re: graph algorithm

My questions concerns the data structure to be drawn, i.e an algoritm that computes the left and top position of each node an leaf considering the size of the node figure and available space.
The drawing format will be using divs on a web page

Re: graph algorithm

I've read about a few graph visualizing algorithms, but they all deal with more complex graphs. Since you only need to draw a tree, which is also quite balanced, if I take it right, it should be as simple as splitting the space available to you into equal height rows - one for each level of nesting, and arranging items in each row at equal distance from each other.

If it doesn't work for you - googling for "nested tree visualization algorithms" gives alots of results.
Also, there are tools like graphviz which solve graph visualization problems. Consider using something alike.

Re: graph algorithm

Thanks for the comments
I have soleved the problem
I used a  algorithm,  recursion-based, used in a graphics visualization tool called SAGE, developed at Carnegie Mellon’s robotics institute.
I got the pseudo code at http://www.mactech.com/articles/mactech … index.html and a java implementationfrom theauthor of that article and implemented a ruby algorithm adopted that to my needs