0% found this document useful (0 votes)
47 views

Illustrations of Graphviz: A Simple Directed Graph

Graphviz is a tool that converts text files describing graphs into image files. The document shows examples of simple directed and undirected graphs represented as text files and rendered as images. More complex graphs are also represented with nodes, edges, labels and other attributes specified in the text files. Graphviz takes these text descriptions and generates optimized graphical representations.

Uploaded by

cpx3bqscribd
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Illustrations of Graphviz: A Simple Directed Graph

Graphviz is a tool that converts text files describing graphs into image files. The document shows examples of simple directed and undirected graphs represented as text files and rendered as images. More complex graphs are also represented with nodes, edges, labels and other attributes specified in the text files. Graphviz takes these text descriptions and generates optimized graphical representations.

Uploaded by

cpx3bqscribd
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Illustrations of graphviz

A L TEX le: graphviz Daniel A. Graham, June 10, 2005

Graphviz is available from www.graphviz.org. It converts simple text les describing the nodes and edges of a graph into an optimized graphical image in one of a number of formats (eps, pdf, . . .). Illustrations of the text le and the resulting image follow.

A simple directed graph


digraph G { A -> B A -> C B -> D B -> E C -> F C -> G }

A more complex directed graph


digraph G { edge [labeldistance=2.5] N [label="1"] C [label="2"] CE [label="1"] node [shape=box] D [label="2,0"] CF [label="3,1"] CEG [label="1,2"] CEH [label="0,0"] N -> C [headlabel="C"] N -> D [headlabel="D"] C -> CE [headlabel="E"] C -> CF [headlabel="F"] CE -> CEG [headlabel="G"] CE -> CEH [headlabel="H"] }
Page 1 of 3

1 C 2 E 1 G 1,2 H 0,0 F 3,1 D 2,0

An even more complex undirected graph


graph G { edge [labeldistance=2.5]; chance [color = red]; node [height=.4]; node [shape=circle, width=.4]; HH [label = "1"]; chance -- HH [dir = forward, headlabel="HH"]; HL [label = "1"]; chance -- HL [dir = forward, headlabel="HL"]; LH [label = "1"]; chance -- LH [dir = forward, headlabel="LH"]; LL [label = "1"]; chance -- LL [dir = forward, headlabel="LL"]; // 1s H move HH -- HL [style = dashed]; LH -- LL [style = dashed]; slh [label="0,0", shape=box]; LH -- slh [dir = forward, headlabel="see"]; rlh [label="2"]; LH -- rlh [dir = forward, headlabel="raise"]; rhh [label="2"]; HH -- rhh [dir = forward, headlabel="raise"]; shh [label="0,0", shape=box]; HH -- shh [dir = forward, headlabel="see"]; // 1s L move sll [label="0,0", shape=box]; LL -- sll [dir = forward, headlabel="see"]; rll [label="2"]; LL -- rll [dir = forward, headlabel="raise"]; rhl [label="2"]; HL -- rhl [dir = forward, headlabel="raise"]; shl [label="0,0", shape=box]; HL -- shl [dir = forward, headlabel="see"]; rll -- rhl [style=dashed];

Page 2 of 3

rlh -- rhh [style=dashed]; // 2s H move node [shape=box]; mrlh [label="-2,2"]; rlh -- mrlh [dir = forward, headlabel="meet"]; prlh [label="1,-1"]; rlh -- prlh [dir = forward, headlabel="pass"]; prhh [label="1,-1"]; rhh -- prhh [dir = forward, headlabel="pass"]; mrhh [label="0,0"]; rhh -- mrhh [dir = forward, headlabel="meet"]; // 2s L move prhl [label="1,-1"]; rhl -- prhl [dir = forward, headlabel="pass"]; mrhl [label="2,-2"]; rhl -- mrhl [dir = forward, headlabel="meet"]; mrll [label="0,0"]; rll -- mrll [dir = forward, headlabel="meet"]; prll [label="1,-1"]; rll -- prll [dir = forward, headlabel="pass"]; }

0,0 1,-1 meet pass 2

0,0 see see raise 1 1 LL LH raise 2 pass meet -2,2 1,-1 0,0

1,-1

chance pass meet 2 raise HL 1 1 see 0,0 see 0,0 HH raise 2 meet pass 1,-1 0,0

2,-2

Page 3 of 3

You might also like