0

Consider this simple DOT file.

graph Foo
{
    subgraph foo
    {
        a; b; c;
    }

    subgraph bar
    {
        w; x; y;
    }

    {a,b,c} -- {w,x,y};
}

The statement {a,b,c} -- {w,x,y} means "connect all nodes in foo to all nodes in bar"...

...except that it doesn't. If I add a node to either foo or bar I have to change the statement which conncets them. I'd rather write foo -- bar but this doesn't work as I'd hope.

Is there any such command in DOT?

spraff
  • 32,570
  • 22
  • 121
  • 229

1 Answers1

0

First the answer: No, there is no syntax for such a thing as connecting all nodes of a subgraph to all nodes of an other subgraph by only naming the subgraphs.

You will have to list explicitely all nodes to connect with each other.


And here is some nitpicking:

The statement {a,b,c} -- {w,x,y} means "connect all nodes in foo to all nodes in bar"...

First, I don't think separating the nodes with a comma is correct (check the error output when generating the graph). Usually nodes are separated by a semicolon.

Second, the statement {a; b; c; } -- {w; x; y; } does not mean connect all nodes in foo to all nodes in bar, it means connect the nodes a, b and c with the nodes w, x and y. Adding an other node to either foo or bar should not generate any edges, this is expected behaviour.

marapet
  • 54,856
  • 12
  • 170
  • 184