Question

digraph G {
  a -> b [ label = "foo" ];
  a -> b [ label = "bar" ];
}

This will create two edges between the 'a' and 'b' nodes. Is there a way to have only one edge (group them)?

Was it helpful?

Solution

I think it really depends on what your desired output would be. One possibility is:

digraph G {
   graph [ splines = false ]
   a -> b [ label = "foo" ];
   a -> b [ label = "bar" ];
 }

Where not using splines draws edges with straight line segments and so duplicate edges will not be distinguished visually.

In your ideal output, what would the single edge look like since there are to be two different labels for it?

OTHER TIPS

The "strict" keyword may help you.

strict digraph G {
  a -> b [ label = "foo" ];
  a -> b [ label = "bar" ];
}

This will combine the edges. But I believe it will only apply the first label.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top