Search code examples
graphviz

Dot graph generation "triangulation failed"


I am trying to create a data structure topology with graphviz,and i use graphviz of windows platform,version 2.38.0.when i issued command line to generate layout,I am getting the following error::

d:\Profiles\Administrator>dot -v -Tpng d:\graph1.gv > graph.png
dot - graphviz version 2.38.0 (20140413.2041)

libpath/.\shortest.c:324: triangulation failed
libpath/.\shortest.c:207: cannot find triangle path
in checkpath, end port not in last box
2 boxes:
0 (-51, -68), (51, 32)
1 (-51, -148), (-51, 353)
start port: (0, 31), tangent angle: -1.5708, not constrained
end port: (0, -147), tangent angle: -3.1416, not constrained
libpath/.\shortest.c:324: triangulation failed
libpath/.\shortest.c:192: source point not in any triangle
Error: in routesplines, Pshortestpath failed

Here is my codes:

digraph vfs {
node [shape = "record" fontsize = 10 style = filled];
color = lightgray;
subgraph cluster_mnt_namespace {
graph [fontsize = 10];
label = "mnt_namespace";
namespace1 [shape = "record",label = "{
       <f0>struct vfsmount * root\
       |{<f1>struct list_head list|{<f2>*next|<f3>*prev}}}
        "];
}
subgraph cluster_vfsmount {
graph [fontsize = 10];
label = "struct vfsmount";
subgraph cluster_mount1 {

"vfsmount1" [shape = "record",label ="{
       {<f0>struct list_head\nmnt_hash|{<f1>*next|<f2>*prev}} \
       |<f3>struct vfsmount *mnt_parent \
       |<f4>struct dentry * mnt_mountpoint\
       |<f5>struct dentry * mnt_root \
       |<f6>struct super_block * mnt_sb \
       |{<f7>struct list_head\nmnt_mounts|{<f8>*next|<f9>*prev}} \
       |{<f10>struct list_head\nmnt_child|{<f11>*next|<f12>*prev}} \
       |{<f13>struct list_head\nmnt_list|{<f14>*next|<f15>*prev}} \
       |<f16>struct namespace * mnt_namespace}
        "];
}
subgraph cluster_mount2 {

"vfsmount2" [shape = "record",label ="{
       {<f0>struct list_head\nmnt_hash|{<f1>*next|<f2>*prev}} \
       |<f3>struct vfsmount *mnt_parent \
       |<f4>struct dentry * mnt_mountpoint\
       |<f5>struct dentry * mnt_root \
       |<f6>struct super_block * mnt_sb \
       |{<f7>struct list_head\nmnt_mounts|{<f8>*next|<f9>*prev}} \
       |{<f10>struct list_head\nmnt_child|{<f11>*next|<f12>*prev}} \
       |{<f13>struct list_head\nmnt_list|{<f14>*next|<f15>*prev}} \
       |<f16>struct namespace * mnt_namespace}
        "];
}
}
vfsmount1:f8 -> vfsmount2:f10 [color = "blue"];
vfsmount2:f12 -> vfsmount1:f7 [color = "green"];
vfsmount2:f11 -> vfsmount1:f7 [color = "green"];
vfsmount1:f9 -> vfsmount2:f10 [color = "blue"];
vfsmount2:f3 -> vfsmount1:f0;

namespace1:f0 -> vfsmount1:f0;


namespace1:f2 -> vfsmount1:f13;
vfsmount1:f14 -> vfsmount2:f13;
vfsmount2:f14 -> namespace1:f1;
namespace1:f3 -> vfsmount2:f13;
vfsmount2:f15 -> vfsmount1:f13; //if delete this row,it can generate layout sucessly
}

Could someone tell me what's wrong with it?Any ideas why am I seeing this error?


Solution

  • I'm not entirely sure what is causing the error, but I suspect that the routing algorithm is getting confused by the many layers of clusters in your graph.

    I'm able to render your graph by setting the graph attribute newrank=true. When set to true, the newrank attribute activates a global ranking algorithm that ignores clusters.

    You can do this on the command line via:

    dot -v -Tpng -Gnewrank=true d:\graph1.gv > graph.png
    

    or by adding it to your dot input file:

    digraph vfs {
        newrank = true;
        node [shape = "record" fontsize = 10 style = filled];
        color = lightgray;
    ...
    

    Here's the result I get:

    Graph rendered after setting newrank=true