Align Ranks in Graphviz

℡╲_俬逩灬. 提交于 2020-01-04 14:16:25

问题


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?


回答1:


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
}


来源:https://stackoverflow.com/questions/47416827/align-ranks-in-graphviz

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!