0

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

nullPointer
  • 4,419
  • 1
  • 15
  • 27

1 Answers1

1

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.

Botje
  • 26,269
  • 3
  • 31
  • 41