3

Take the following digraph:

digraph "all"{

  subgraph "cluster cluster 1" {
    node [label="1"] "1"
    node [label="2"] "2"
  }

  subgraph "cluster cluster 2" {
    node [label="3"] "3"
    node [label="4"] "4"
  }

  1 -> 2
  2 -> 1

  3 -> 4
  4 -> 3

}

enter image description here

In order to turn bidirectional connections into a single arrow,
I must use concentrate=true;.

digraph "all"{

  subgraph "cluster cluster 1" {
    node [label="1"] "1"
    node [label="2"] "2"
  }

  subgraph "cluster cluster 2" {
    node [label="3"] "3"
    node [label="4"] "4"
  }

  1 -> 2
  2 -> 1

  3 -> 4
  4 -> 3

  concentrate=true;

}

enter image description here

This works inside individual clusters, but it does not work across clusters.
I've tried sprinkling concentrate=true in other places as well, but it did not work.

digraph "all"{

  subgraph "cluster cluster 1" {
    node [label="1"] "1"
    node [label="2"] "2"
    concentrate=true;
  }

  subgraph "cluster cluster 2" {
    node [label="3"] "3"
    node [label="4"] "4"
    concentrate=true;
  }

  1 -> 2
  2 -> 1

  3 -> 4
  4 -> 3

  2 -> 3
  3 -> 2

  concentrate=true;

}

enter image description here
How can I concentrate connections between digraph clusters?

Trevor Hickey
  • 36,288
  • 32
  • 162
  • 271

2 Answers2

0

Use the connection modifier [dir=both]

2 -> 3 [dir=both]

You can then remove the link from 3 -> 2

giusti
  • 3,156
  • 3
  • 29
  • 44
bootsy
  • 1
0

For bidirectional graphs if you don't need to show the arrows, you can add "edge[arrowhead=none]" in addition to "concentrate=true".

razor
  • 101
  • 2