我有一个很大但不是很大(?)的图,有 13 个子图簇,包含大约 100 个节点和 3,147 条边。
Windows 上的点崩溃,Linux 上的段错误。
This question建议解决方案是使用 neato
,而不是 dot
。
但是,this page说
Please note there are some quirks here ... only the DOT and FDP layout methods seem to support subgraphs
无论放大多远,我的输出都是一个巨大的黑色意大利面球。因此,我删除了除一条消息之外的所有消息,这表明子图形似乎是相互嵌套绘制的。
它们绝对不嵌套在源文件中;这是一个示例,其中商业敏感名称已更改:
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
}
这在语法上似乎是正确的(边缘在后面)。
所以,链接页面似乎是正确的:
only the DOT and FDP layout methods seem to support subgraphs
但是,看起来我也需要neato来绘制大图。
我有什么选择?
[Updtae] 我运行 fdp
并收到以下错误消息
Error: node "xxx" is contained in two non-comparable clusters "AAA" and "BBB"
这似乎给出了线索。难道一个节点名真的不能在两个集群中使用吗?
如果是这样,解决方案似乎是在节点名称之前加上集群名称......
最佳答案
所以我没有通用的解决方案来解决您的问题。 但你看过“火星”吗? 它是一个命令行工具,专为使用具有非常大的图形的 graphviz 程序而设计。 您可以在这里找到它:https://github.com/marckhoury/mars
关于Graphviz:如何在带有子图簇的非常大的图上使用neato?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56545184/