Tag Archives: 示例

graphviz examples

Table of Contents

patricia tree

digraph g {
graph [
#rankdir = LR
];

node [
fontsize = "20"
fontname = "Times-Italic"
];

edge [
];

##parent [
##label = "parent"
##fontcolor=red
##shape = plaintext
##];

##kid_node [
##label = "kid_node"
##fontcolor=red
##shape = plaintext
##];

nodei [
label = "'/i/' \,idx = 0"
shape = ellipse
];

nodeiism [
label = "'/i/ism/' \,idx = 3"
shape = ellipse
];

nodea1 [
label = "'a1' \,idx = 0"
shape = ellipse
];

kidsi [
label = "'/'"
shape = box
];

kidsa [
label = "'a'"
shape = box
];

kids0 [
label = "'\0'"
shape = box
];

kidsa1 [
label = "'/'"
shape = box
];

nodei -> kidsi[label = "kids"];
kidsi -> nodeiism[label = "node"];
kidsi -> kidsa[label = "brother"];
{rank = same;kidsi;kidsa;}
kidsa ->nodea1[label = "node"];

nodeiism ->kids0[label = "kids"];
nodea1 ->kidsa1[label = "kids"];

kids0 ->nodei[label = "node"];
kidsa1 ->nodei[label = "node"];
}

输出: http://pic.yupoo.com/zhongyijun/Corvv8Xi/k223V.png

digraph g {
graph [
#rankdir = LR
];

node [
fontsize = "20"
fontname = "Times-Italic"
];

edge [
];

##parent [
##label = "parent"
##fontcolor=red
##shape = plaintext
##];

##kid_node [
##label = "kid_node"
##fontcolor=red
##shape = plaintext
##];
nodei [
label = "'/i/' \,idx = 0"
shape = ellipse
];

nodeiism [
label = "'/i/ism/' \,idx = 3"
style=filled
color=red
shape = ellipse
];

nodea1 [
label = "'a1' \,idx = 0"
shape = ellipse
];

kidsi [
label = "'/'"
shape = box
];

kidsa [
label = "'a'"
shape = box
];

kids0 [
label = "'\0'"
shape = box
];

kidsa1 [
label = "'/'"
shape = box
];

nodei -> kidsi[label = "kids"];
kidsi -> nodeiism[label = "node"];
kidsi -> kidsa[label = "brother"];
{rank = same;kidsi;kidsa;}
kidsa ->nodea1[label = "node"];

nodeiism ->kids0[label = "kids"];
nodea1 ->kidsa1[label = "kids"];
kidsa1 ->nodei[label = "node"];

kids0 ->nodei[label = "node"];

{rank=min;nodei;}
{rank=max;kids0;}
}

输出: http://pic.yupoo.com/zhongyijun/CorvvmAZ/aTXth.png

digraph g {
graph [
#rankdir = LR
];

node [
fontsize = "20"
fontname = "Times-Italic"
];

edge [
];

parent [
label = "parent"
fontcolor=blue
shape = plaintext
];

kid_node [
label = "kid_node"
fontcolor=blue
shape = plaintext
];

nodei [
label = "'/i/' \,idx = 0"
shape = ellipse
];

nodeiism [
label = "'/i/ism/' \,idx = 3"
color=red
style=filled
shape = ellipse
];

nodea1 [
label = "'a1' \,idx = 0"
shape = ellipse
];

kidsi [
label = "'/'"
shape = box
];

kidsa [
label = "'a'"
shape = box
];

kids0 [
label = "'\0'"
shape = box
];

kidsa1 [
label = "'/'"
shape = box
];

nodei -> kidsi[label = "kids"];
kidsi -> nodeiism[label = "node"];
kidsi -> kidsa[label = "brother"];
{rank = same;kidsi;kidsa;}
kidsa ->nodea1[label = "node"];

nodeiism ->kids0[label = "kids"];
nodea1 ->kidsa1[label = "kids"];
kidsa1 ->nodei[label = "node"];

kids0 ->nodei[label = "node"];
{rank=min;nodei;}
{rank=max;kids0;kid_node;}

parent -> nodeiism;
kid_node ->nodeiism;
}

输出: http://pic.yupoo.com/zhongyijun/Corvvvsu/NG4g1.png

digraph g {
graph [
#rankdir = LR
];

node [
fontsize = "20"
fontname = "Times-Italic"
];

edge [
];

parent [
label = "parent"
fontcolor=blue
shape = plaintext
];

kid_node [
label = "kid_node"
fontcolor=blue
shape = plaintext
];

nodei [
label = "'/i/' \,idx = 0"
shape = ellipse
];

nodeiism [
label = "'/i/ism/' \,idx = 3"
color=red
style=filled
shape = ellipse
];

nodea1 [
label = "'a1' \,idx = 0"
shape = ellipse
];

kidsi [
label = "'/'"
shape = box
];

kidsa [
label = "'a'"
shape = box
];

kids0 [
label = "'\0'"
shape = box
];

kidsa1 [
label = "'/'"
shape = box
];

nodei -> kidsi[label = "kids"];
kidsi -> nodeiism[label = "node"];
kidsi -> kidsa[label = "brother"];
{rank = same;kidsi;kidsa;}
kidsa ->nodea1[label = "node"];

nodeiism ->kids0[label = "kids"];
nodea1 ->kidsa1[label = "kids"];
kidsa1 ->nodei[label = "node"];

kids0 ->nodei[label = "node"];
{rank=min;nodei;}
{rank=max;kids0;kid_node;}

parent -> nodeiism;
##{rank = same;parent;nodei;}
kid_node ->nodei;
##{rank = same;kid_node;nodeiism;}
}

输出: http://pic.yupoo.com/zhongyijun/Corvvngz/na1iz.png

digraph g {
graph [
#rankdir = LR
];

node [
fontsize = "20"
fontname = "Times-Italic"
];

edge [
];

nodei [
label = "'/i/' \,idx = 0"
shape = ellipse
];

nodeite [
label = "'/i/te' \,idx = 3"
shape = ellipse
];

nodeitest [
label = "'/i/test' \,idx = 5"
shape = ellipse
];

nodea1 [
label = "'a1' \,idx = 0"
shape = ellipse
];

nodeb1 [
label = "'b1' \,idx = 0"
shape = ellipse
];

kidsi [
label = "'/'"
shape = box
];

kidsb [
label = "'b'"
shape = box
];

kidsa [
label = "'a'"
shape = box
];

kidst [
label = "t"
shape = box
];

kids0 [
label = "'\0'"
shape = box
];

kidsb1 [
label = "'/'"
shape = box
];

kidsa1 [
label = "'/'"
shape = box
];

nodei -> kidsi[label = "kids"];
kidsi -> nodeite[label = "node"];
kidsi -> kidsb[label = "brother"];
{rank = same;kidsi;kidsb;}

kidsb ->nodeb1[label = "node"];
kidsb ->kidsa[label = "brother"];
{rank = same;kidsa;kidsb;}

kidsa ->nodea1[label = "node"];

nodeite ->kidst[label = "kids"];
kidst ->nodeitest[label = "node"];

nodeitest ->kids0[label = "kids"];
kids0 ->nodeite[label = "node"];

nodeb1 ->kidsb1[label = "kids"];
kidsb1 ->nodei[label = "node"];

nodea1 ->kidsa1[label = "kids"];
kidsa1 ->nodei[label = "node"];
}

输出: http://pic.yupoo.com/zhongyijun/CorvvJ6I/tXwqH.png

digraph g {
graph [
#rankdir = LR
];

node [
fontsize = "20"
fontname = "Times-Italic"
];

edge [
];

parent [
label = "parent"
fontcolor=red
shape = plaintext
];

kid_node [
label = "kid_node"
fontcolor=red
shape = plaintext
];

len [
label = "len = 12"
fontcolor = blue
shape = plaintext
];

nodei [
label = "'/i/' \,idx = 0"
shape = ellipse
];

nodeite [
label = "'/i/te' \,idx = 3"
shape = ellipse
];

nodeitest [
label = "'/i/test' \,idx = 5"
shape = ellipse
];

nodea1 [
label = "'a1' \,idx = 0"
shape = ellipse
];

nodeb1 [
label = "'b1' \,idx = 0"
shape = ellipse
];

kidsi [
label = "'/'"
shape = box
];

kidsb [
label = "'b'"
shape = box
];

kidsa [
label = "'a'"
shape = box
];

kidst [
label = "t"
shape = box
];

kids0 [
label = "'\0'"
shape = box
];

kidsb1[
label = "'/'"
shape = box
];

kidsa1 [
label = "'/'"
shape = box
];

nodei -> kidsi[label = "kids"];
kidsi -> nodeite[label = "node"];
kidsi -> kidsb[label = "brother"];
{rank = same;kidsi;kidsb;}

kidsb ->nodeb1[label = "node",len = 2.5];
kidsb ->kidsa[label = "brother"];
{rank = same;kidsa;kidsb;}

kidsa ->nodea1[label = "node",len = 2.5];

nodeite ->kidst[label = "kids"];
kidst ->nodeitest[label = "node"];

nodeitest ->kids0[label = "kids"];
kids0 ->nodeite[label = "node"];

nodeb1 ->kidsb1[label = "kids"];
kidsb1 ->nodei[label = "node"];

nodea1 ->kidsa1[label = "kids"];
kidsa1 ->nodei[label = "node"];

parent ->nodei;
{rank = same;parent;nodei;}
kid_node ->nodeite;
{rank = same;kid_node;nodeite;}

len ->nodei[style=invis];
{rank=same;len;nodei;}
}

输出: http://pic.yupoo.com/zhongyijun/Corvv480/tydlI.png

digraph g {
graph [
#rankdir = LR
];

node [
fontsize = "20"
fontname = "Times-Italic"
];

edge [
];

parent [
label = "parent"
fontcolor=red
shape = plaintext
];

kid_node [
label = "kid_node"
fontcolor=red
shape = plaintext
];

len [
label = "len = 12"
fontcolor = blue
shape = plaintext
];

nodei [
label = "'/i/' \,idx = 0"
shape = ellipse
];

nodeite [
label = "'/i/te' \,idx = 3"
shape = ellipse
];

nodeitest [
label = "'/i/test' \,idx = 5"
shape = ellipse
];

nodea1 [
label = "'a1' \,idx = 0"
shape = ellipse
];

nodeb1 [
label = "'b1' \,idx = 0"
shape = ellipse
];

kidsi [
label = "'/'"
shape = box
];

kidsb [
label = "'b'"
shape = box
];

kidsa [
label = "'a'"
shape = box
];

kidst [
label = "t"
shape = box
];

kids0 [
label = "'\0'"
shape = box
];

kidsb1 [
label = "'/'"
shape = box
];

kidsa1 [
label = "'/'"
shape = box
];

nodei -> kidsi[label = "kids"];
kidsi -> nodeite[label = "node"];
kidsi -> kidsb[label = "brother"];
{rank = same;kidsi;kidsb;}
{rank = min;nodei;}

kidsb ->nodeb1[label = "node",len = 2.5];
kidsb ->kidsa[label = "brother"];
{rank = same;kidsa;kidsb;}

kidsa ->nodea1[label = "node",len = 2.5];

nodeite ->kidst[label = "kids"];
kidst ->nodeitest[label = "node"];

nodeitest ->kids0[label = "kids"];
kids0 ->nodeite[label = "node"];

nodeb1 ->kidsb1[label = "kids"];
kidsb1 ->nodei[label = "node"];
nodea1 ->kidsa1[label = "kids"];
kidsa1 ->nodei[label = "node"];

parent ->nodeite;
{rank = same;parent;nodeite;}
kid_node ->nodeitest;
{rank = same;kid_node;nodeitest;}

len ->nodei[style=invis];
{rank=same;len;nodei;}
}

输出: http://pic.yupoo.com/zhongyijun/Corvw2Wi/hsLFP.png

digraph g {
graph [
#rankdir = LR
];

node [
fontsize = "20"
fontname = "Times-Italic"
];

edge [
];

parent [
label = "parent"
fontcolor = red
shape = plaintext
];

kid_node [
label = "kid_node"
fontcolor=red
shape = plaintext
];

len [
label = "len = 12"
fontcolor=blue
shape = plaintext
];

nodei [
label = "'/i/' \,idx = 0"
shape = ellipse
];

nodeite [
label = "'/i/te' \,idx = 3"
shape = ellipse
];

nodeitest [
label = "'/i/test' \,idx = 5"
shape = ellipse
];

nodea1 [
label = "'a1' \,idx = 0"
shape = ellipse
];

nodeb1 [
label = "'b1' \,idx = 0"
shape = ellipse
];

kidsi [
label = "'/'"
shape = box
];

kidsb [
label = "'b'"
shape = box
];

kidsa [
label = "'a'"
shape = box
];

kidst [
label = "t"
shape = box
];

kids0 [
label = "'\0'"
shape = box
];

kidsb1[
label = "'/'"
shape = box
];

kidsa1 [
label = "'/'"
shape = box
];

nodei -> kidsi[label = "kids"];
kidsi -> nodeite[label = "node"];
kidsi -> kidsb[label = "brother"];
{rank = same;kidsi;kidsb;}
{rank = min;nodei;}

kidsb ->nodeb1[label = "node",len = 2.5];
kidsb ->kidsa[label = "brother"];
{rank = same;kidsa;kidsb;}

kidsa ->nodea1[label = "node",len = 2.5];

nodeite ->kidst[label = "kids"];
kidst ->nodeitest[label = "node"];

nodeitest ->kids0[label = "kids"];
kids0 ->nodeite[label = "node"];

nodeb1 ->kidsb1[label = "kids"];
kidsb1 ->nodei[label = "node"];
nodea1 ->kidsa1[label = "kids"];
kidsa1 ->nodei[label = "node"];

parent ->nodeitest;
kid_node ->nodeitest;
{rank = max;parent;kid_node;kids0}

len ->nodei[style=invis];
{rank=same;len;nodei;}
}

输出: http://pic.yupoo.com/zhongyijun/CorvvVnC/mxKga.png

参考文献