Dot graph language - how to make bidirectional edges?

Here is a very simplified example of my point graph:

strict digraph graphName { A->B B->A } 

It creates alt text

Instead, I want one edge to be shown between A and B, but with a double arrow. I know how to get a double arrow as a global option:

 strict digraph graphName { edge [dir="both"] A->B B->A } 

But it looks very ugly, and not all of my edges should be double-headed.

alt text

If I do additional processing of the chart and find a double link myself and replace two edges with one edge, everything will be all right. But I would rather not take this extra step

 strict digraph graphName { A->B [dir="both"] } 

alt text

Are there any better solutions?

+65
graph graphviz dot
Aug 11 '10 at 20:16
source share
2 answers

How about concentrate = true?

 strict digraph graphName { concentrate=true A->B B->A } 

with concentrate = true

From the documentation :

If true, use edge concentrators. This combines several edges into one edge and forces partially parallel edges to divide part of their paths. The latter function is not yet available outside the point.

+53
Aug 11 2018-10-10T00:
source share

You should just use:

A โ†’ B [dir = "both"]

+80
Jul 19 '13 at 9:07 on
source share



All Articles