Subgraph has same node, how to make unique
Asked Answered
S

2

8

I create dot file by my perl script. Here is subgraphs which contains same node. eg:

subgraph{aa->bb->cc;}
subgraph{dd->bb->ee;}

I know those subgraph use same namespace, so my result output is a mess.

In each subgraph, I can make them unique, like bb and bb_1 below,

subgraph{aa->bb->cc; bb_1->dd;}

but it hard to make all node in all subgraphs unique.

Is there some methods to make each subgraph "strict" or use different namespace?

Sacco answered 20/8, 2013 at 7:25 Comment(0)
A
10

The label presented for a node is only related to the name of the node if it is not overridden by an explicit references.

For example, you can use "45" [label = "bb"]; "53" [label = "bb"]; to represent two nodes that have the same label.

Then

subgraph{aa->"45"->cc;}
subgraph{dd->"53"->ee;}

will use the internal id of each node to identify it so that you can then reuse the same label in many locations.

Ashraf answered 23/9, 2013 at 13:28 Comment(0)
M
1

gvpack will automatically rename nodes that are in clusters if you use it to put multiple sub-graphs into one graph. See Graph of Graphs in Graphviz for an example.

Municipality answered 21/8, 2013 at 2:5 Comment(1)
thanks. It seems hard to solve it. So I had added line number to each node, although it is hard work for almost 2 days.Sacco

© 2022 - 2024 — McMap. All rights reserved.