如何防止dot花费很长时间?

时间:2014-07-17 10:26:06

标签: graphviz dot

当我在特定图表上运行Graphviz时,我得到了

aromanov@ws:~/IdeaProjects/scalan$ dot -v -O -Tpng myfile.dot 
dot - graphviz version 2.26.3 (20100126.1600)
Activated plugin library: libgvplugin_pango.so.6
Using textlayout: textlayout:cairo
Activated plugin library: libgvplugin_dot_layout.so.6
Using layout: dot:dot_layout
Using render: cairo:cairo
Using device: png:cairo:cairo
The plugin configuration file:
    /usr/lib/graphviz/config6
        was successfully loaded.
    render  :  cairo dot fig gd map ps svg tk vml vrml xdot
    layout  :  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout  :  textlayout
    device  :  canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg pdf plain plain-ext png ps ps2 svg svgz tk vml vmlz vrml wbmp x11 xdot xlib
    loadimage   :  (lib) eps gd gd2 gif jpe jpeg jpg png ps svg
fontname: "Times-Roman" resolved to: (ps:pango  Times Roman,) (PangoCairoFcFont) "DejaVu Sans 14" 
network simplex:  605 nodes 1434 edges maxiter=2147483647 balance=1
network simplex: 100 
network simplex: 605 nodes 1434 edges 131 iter 0.01 sec
mincross: pass 0 iter 0 trying 0 cur_cross 28683 best_cross 28683
mincross: pass 0 iter 1 trying 0 cur_cross 21867 best_cross 21867
mincross: pass 0 iter 2 trying 0 cur_cross 11534 best_cross 11534
mincross: pass 0 iter 3 trying 0 cur_cross 8949 best_cross 8949
mincross: pass 1 iter 0 trying 0 cur_cross 8701 best_cross 6900
mincross: pass 1 iter 1 trying 1 cur_cross 14055 best_cross 6900
mincross: pass 1 iter 2 trying 2 cur_cross 11429 best_cross 6900
mincross: pass 1 iter 3 trying 3 cur_cross 7558 best_cross 6900
mincross: pass 2 iter 0 trying 0 cur_cross 6190 best_cross 6190
mincross: pass 2 iter 1 trying 1 cur_cross 11316 best_cross 6190
mincross: pass 2 iter 2 trying 2 cur_cross 11511 best_cross 6190
mincross: pass 2 iter 3 trying 3 cur_cross 7098 best_cross 6190
mincross: pass 2 iter 4 trying 4 cur_cross 6628 best_cross 6190
mincross: pass 2 iter 5 trying 5 cur_cross 13131 best_cross 6190
mincross: pass 2 iter 6 trying 6 cur_cross 11633 best_cross 6190
mincross: pass 2 iter 7 trying 7 cur_cross 7562 best_cross 6190
mincross: pass 2 iter 8 trying 8 cur_cross 6800 best_cross 6190
merge2: graph G, rank 5 has only 52 < 53 nodes
merge2: graph G, rank 9 has only 82 < 83 nodes
merge2: graph G, rank 30 has only 123 < 124 nodes
merge2: graph G, rank 38 has only 141 < 142 nodes
merge2: graph G, rank 42 has only 148 < 149 nodes
merge2: graph G, rank 59 has only 172 < 173 nodes
merge2: graph G, rank 60 has only 177 < 178 nodes
merge2: graph G, rank 61 has only 179 < 180 nodes
merge2: graph G, rank 62 has only 185 < 187 nodes
merge2: graph G, rank 63 has only 187 < 189 nodes
merge2: graph G, rank 64 has only 188 < 190 nodes
merge2: graph G, rank 65 has only 186 < 188 nodes
merge2: graph G, rank 66 has only 189 < 190 nodes
merge2: graph G, rank 74 has only 207 < 208 nodes
merge2: graph G, rank 80 has only 222 < 223 nodes
merge2: graph G, rank 81 has only 226 < 227 nodes
merge2: graph G, rank 82 has only 226 < 227 nodes
merge2: graph G, rank 83 has only 228 < 229 nodes
merge2: graph G, rank 84 has only 230 < 231 nodes
merge2: graph G, rank 85 has only 232 < 233 nodes
merge2: graph G, rank 86 has only 232 < 233 nodes
merge2: graph G, rank 87 has only 232 < 233 nodes
merge2: graph G, rank 88 has only 236 < 237 nodes
merge2: graph G, rank 89 has only 239 < 240 nodes
merge2: graph G, rank 90 has only 244 < 245 nodes
merge2: graph G, rank 91 has only 246 < 247 nodes
merge2: graph G, rank 118 has only 177 < 178 nodes
mincross G: 6189 crossings, 8.40 secs.
network simplex:  57721 nodes 86837 edges maxiter=2147483647 balance=2
network simplex: 100 200 300 400 500 600 700 800 900 1000 
network simplex: 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 
network simplex: 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 
network simplex: 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000 
network simplex: 4100 4200 4300 4400 4500 4600 4700 4800 4900 5000 
network simplex: 5100 5200 5300 5400 5500 5600 5700 5800 5900 6000 

等等。出于某种原因,当图表只有605个节点时(因为错误的开头所示),它正在尝试使用57721个节点。有没有办法告诉它停止,可能是更糟糕的布局?我也尝试过其他布局; neato和twopi制造了一个完全混乱的东西重叠,fdp有点好但仍然很糟糕,而且circo似乎也挂了。 Graphviz版本是2.26.3(遗憾的是最新版本可用于Debian稳定版)。

1 个答案:

答案 0 :(得分:3)

我们解决了这个问题。 Debian应该获得最新版本。版本2.26已超过4年。尝试从http://www.graphviz.org/Download_linux_ubuntu.php

安装它

请注意,报告的节点数包括虚拟(&#34;虚拟&#34;)节点,这些节点用于在排名图的各个级别上路由边。如果图表有很多&#34; long&#34;你可以得到二次爆炸。边缘。这不是一个错误。

对于605个节点,我建议使用neato -Goverlap = false或-Elen = 2或3或sfdp(它忽略边长但似乎更好地避免重叠)。

使用| E | 〜= 3 | V |你的图表不一定太密集或难以布局。

Stephen North