dot draws graphs in four main phases:
- Breaks any cycles which occur in the input graph by reversing the internal direction of certain cyclic edges.
- Assigns nodes to discrete ranks or levels. In a top-to-bottom drawing, ranks determine Y coordinates. Edges that span more than one rank are broken into chains of “virtual” nodes and unit-length edges.
- [...]
- Sets X coordinates of nodes to keep edges short, and the final step routes edge splines.