Graphviz:如何将 neato 用于带有子图集群的非常大的图?

Graphviz: how to use neato with very large graphs with subgraph clusters?

我有一个很大但不是很大(?)的图,有 13 个子图簇,包含大约 100 个节点和 3,147 条边。

Dot 在 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"

这似乎提供了线索。真的是两个集群不能用一个节点名吗?

如果是这样,解决方案似乎是在节点名称之前加上集群名称...

所以我没有通用的解决方案来解决您的问题。 但是你看过"mars"吗? 它是一个命令行工具,专为使用具有非常大图形的 graphviz 程序而设计。 您可以在这里找到它:https://github.com/marckhoury/mars