I have a large, but not really huge(?) graph, with 13 subgraph clusters containing about 100 nodes and 3,147 edges.
Dot crashes on Windows and seg faults on Linux.
This question suggests that the solution is to use neato
, rather than dot
.
But, this page says
Please note there are some quirks here ... only the DOT and FDP layout methods seem to support subgraphs
My output is a huge, black ball of spaghetti, no matter how far I zoom in. So I removed all of the messages but one, and that showed that the subgrphs appear to be drawn nested in each other.
They are absolutely not nested in the source file; here's a sample, with commercially sensitive names changed:
digraph G {
labelloc="t"; // place the label at the top (b seems to be default)
label="XXX message passing";
rankdir = "LR"
newrank = "true"
subgraph cluster_AAA {
label="AAA"
rank="same"
AAA_1
}
subgraph cluster_BBB {
label="BBB"
rank="same"
BBB_1
BBB_2
}
subgraph cluster_CCC {
label="CCC"
rank="same"
CCC_1
CCC_2
CCC_3
}
That certainly seems to be syntactically correct (the edges follow after).
So, it seems like that linked page was correct:
only the DOT and FDP layout methods seem to support subgraphs
BUT, it also seems like I need neato for a large graph.
What are my options?
[Updtae] I ran fdp
and got the following error message
Error: node "xxx" is contained in two non-comparable clusters "AAA" and "BBB"
That seems to give a clue. Is it really the case that a node name may not be used in two clusters?
If so, the solution would seem to be to precede the node names with the cluster name ...
so I do not have a general solution to solve your problem. But have you had a look at "mars"? It's a command line tool designed specifically for the use of graphviz programs with very large graphs. You can find it here: https://github.com/marckhoury/mars