Question

I would like the edges between two nodes to be symmetric about a horizontal line. For example, this code:

digraph G {
    rankdir=LR
    s [style=invisible]
    A [peripheries=2]
    D [peripheries=2]
    B [peripheries=2]
    s -> A
    A -> C [label="1"]
    C -> D [label="0"]
    D -> C [label="1"]
    A -> B [label="0"]
}

Produces this graph:

non-symmetric edges

I would prefer the edges between C and D to look more like this:

symmetric edges

Is there a way to get Graphviz to do this?

Was it helpful?

Solution

You can place a third edge and make the middle one invisible:

C -> D [label="0"];
D -> C [style=invis];
D -> C [label="1"];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top