echarne@ics.uci.edu (Eli B. Charne) (07/03/90)
After searching through the newsgroups, this one seems most appropriate. If
there is a better place to post the follwing question, please let me know.
I am looking for an algorithm (in some pascalish code--- I will be recoding
it in C) to display graphs and trees in cartesion (x-y) coordinates.
Basically I would like something that does this:
Given:
edge from 1 to 2
edge from 1 to 3
edge from 3 to 4
edge from 3 to 5
edge from 3 to 6
Produces:
1
/ \
2 3
/|\
4 5 6
Of course the edge information is stored in some data structure (which I've
done), and I basically just want coordinates for the nodes (so I can draw
circles or whatever).
Thanks for any information or pointers--
Please respond by E-mail.
-Eli
--
echarne@ics.uci.edu // \\ ``To understand recursion you
echarne@uci.bitnet \\ // \\ // need to understand recursion.''
echarne@nrtc.northrop.com \X/ \X/ --Andrew Koenig, 2nd Usenix C++ conf.