有人可以帮我弄清楚为什么下面的图表永远不会生成点?我认为这个问题与头部和尾部有关。如果我把它们拿出来,它就会起作用,但理想情况下,我希望那些因文体原因而停留。graphviz问题永远不会完成
digraph G {
nodesep = 0.5;
0 [width=0.75, height=0.75, fontsize=20];
1 [width=0.75, height=0.75, fontsize=20, shape=square];
2 [width=0.75, height=0.75, fontsize=20];
3 [width=0.75, height=0.75, fontsize=20];
4 [width=0.75, height=0.75, fontsize=20];
5 [width=0.75, height=0.75, fontsize=20, shape=square];
6 [width=0.75, height=0.75, fontsize=20];
7 [width=0.75, height=0.75, fontsize=20, shape=square];
8 [width=0.75, height=0.75, fontsize=20, shape=square];
9 [width=0.75, height=0.75, fontsize=20, shape=square];
10 [width=0.75, height=0.75, fontsize=20, shape=square];
11 [width=0.75, height=0.75, fontsize=20, shape=square];
12 [width=0.75, height=0.75, fontsize=20];
subgraph directed{
rankdir= LR;rank= max;
0->1->2->3->4->5->6->7->8->9->10->11->12;
}
subgraph undirected{
rankdir= LR;rank= min;edge[tailport=n,headport=n];
0->1[dir=none, color=red];
0->2[dir=none, color=red];
1->9[dir=none, color=red];
2->3[dir=none, color=red];
2->8[dir=none, color=red];
3->4[dir=none, color=red];
4->8[dir=none, color=red];
7->9[dir=none, color=red];
8->9[dir=none, color=red];
9->10[dir=none, color=red];
9->11[dir=none, color=red];
10->11[dir=none, color=red];
}
}
本质上,我有需要通过有向图和无向图连接的节点。我希望节点(编号0-12)出现在一条直线上,其有向边如下: 0→1→2→3→4→5→6→7 - > 8-> 9-> 10-> 11-> 12; 我想要无向边连接到节点之间的北头端口和尾端口。 – Karrde 2013-04-11 22:22:07
@Karrde我对我的答案进行了更新。您应该将评论中的信息添加到您的问题中,这对了解您的问题很有用。 – marapet 2013-04-12 06:20:04