Reputation: 4283
This is a follow-up question to How can I achieve strict reverse ranking of graphviz dot?, but a little easier. This graph is contrived, but demonstrates the problem:
digraph nfa {
A -> B
B -> C
C -> D
D -> E
A -> F
F -> E
}
Nodes B and F are the same rank, but they are not displayed at the same rank. How can achieve this?
Upvotes: 3
Views: 1486
Reputation: 6773
An "easier" solution, using the new-ish TBbalance attribute (http://www.graphviz.org/docs/attrs/TBbalance/). TBbalance does just what you want.
digraph nfa {
TBbalance=min
A -> B
B -> C
C -> D
D -> E
A -> F
F -> E
}
Upvotes: 1
Reputation: 4283
I used subgraphs with rank = same
, and manually computed the ranks and grouped them in said subgraphs.
digraph {
{ rank = same; A }
{ rank = same; B; F }
{ rank = same; C }
{ rank = same; D }
{ rank = same; E }
A -> B
B -> C
C -> D
D -> E
A -> F
F -> E
}
Upvotes: 2