【问题标题】:GraphViz: How to connect a node within in a subgraph to the sibling node of the subgraph?GraphViz:如何将子图中的节点连接到子图的兄弟节点?
【发布时间】:2014-03-24 06:40:13
【问题描述】:

我在 Graphviz 中使用子图(集群)。 在此链接 (GraphViz - How to connect subgraphs?) 的帮助下,我能够将子图和节点相互连接起来。 但是,有一个问题:

假设我们有一个有向图 G,它包含一个子图“cluster1”和一个节点“node1”。 假设“cluster1”包含单个节点“node10”。 现在,我想将“node10”与“node1”连接起来。我正在尝试以下代码:

digraph G {
    compound=true;
    node1;
    subgraph cluster1 {
        node10->node1;    
    }
}

这给出了“cluster1”中存在“node1”的输出。 我想要的是在“cluster1”之外和有向图G内有“node1”。

请帮忙。

【问题讨论】:

    标签: graphviz


    【解决方案1】:

    似乎链接创建需要两端的所有权。然后分别声明节点和链接 将起作用:

    digraph G {
        compound=true;
        node1;
        subgraph cluster1 {
            node10
        }
        node10->node1
    }
    

    产量

    【讨论】:

      猜你喜欢
      • 2017-10-08
      • 1970-01-01
      • 2021-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-13
      • 2018-08-23
      • 1970-01-01
      相关资源
      最近更新 更多