Re: [graphviz-interest] A problem with rank = same
"Emden R. Gansner" <[email protected]> Thu, 04 Sep 2014 16:57:47 -0400
| Newsgroups | gmane.comp.video.graphviz |
|---|---|
| Message-ID | <[email protected]> |
> Is that a bug in Graphviz or have I misunderstood something?
It is a bug, but not the one you think. The original ranking algorithm used in dot was especially
cautious. In particular,
a node could not be involved in two constraints, a constraint being containment in a cluster or
involvement in a rank=...
So what you are seeing is dot quietly ignoring the rank=same constraint because node_2 and node_3
are in a cluster.
The bug is that dot should produce a warning about this.
This approach seemed too cautious, as it prohibited many perfectly reasonable situations as, for
example, in your graph.
Since 2.30, dot supports a new ranking algorithm that is much more flexible. At present, it is still
not the default, so you
need to set newrank=true to get it. If you do this, you'll see node_2 and node_3 in the cluster and
on the same rank.
For the record, if you comment out "subgraph" but leave in "cluster", cluster denotes a node and you
end up with an
edge from node_1 to cluster.
Emden
_______________________________________________
[email protected]
http://lists.research.att.com/mailman/listinfo/graphviz-interest