Graphviz: make edges not affecting the hierarchy of nodes

后端 未结 2 1625
清歌不尽
清歌不尽 2021-01-18 00:19

I add edges (green) to graph, that makes hierarchy of nodes. How to add minor edges (red) that not affecting on the hierarchy?

2条回答
  •  情话喂你
    2021-01-18 01:00

    You need {rank = same; }, e.g.

    digraph G {
        a -> b
        a -> c
        c -> d
        c -> e
        a -> f
        c -> f
    }
    

    ... gives:

    enter image description here

    ... while

    digraph G {
        a -> b
        a -> c
        c -> d
        c -> e
        a -> f
        c -> f
        { rank=same; c f }
    }
    

    ... gives:

    enter image description here

提交回复
热议问题