0
votes

I'm trying to generate a simple graph via java based on a source xml file that contains the nodes entities of the graph. So each node may have 0 (single root node ) or more parents. Is there any good coordinates drawing algorithm / pseudocode which would draw children below their parents in a nice and readable layout ?

many thanks

1

1 Answers

1
votes

The default layout algorithm (dot) used by GraphViz is well-suited for trees. This SO comment links to the technical description and algorithm. If you cannot use GraphViz itself, at least you can get a head start on the algorithm.