TikZ and PGF Manual
Part IV Graph Drawing
Sections
- Introduction to Algorithmic Graph Drawing
- Using Graph Drawing in TikZ
- Using Graph Drawing in PGF
- Graph Drawing Layouts: Trees
- Graph Drawing Algorithms: Layered Layouts
- Graph Drawing Algorithms: Force-Based Methods
- Graph Drawing Algorithms: Circular Layouts
- Graph Drawing Layouts: Phylogenetic Trees
- Graph Drawing Algorithms: Edge Routing
- The Algorithm Layer
- Writing Graph Drawing Algorithms in C
- The Display Layer
- The Binding Layer
by Till Tantau et al.
Graph drawing algorithms do the tough work of computing a layout of a graph for you. TikZ comes with powerful such algorithms, but you can also implement new algorithms in the Lua programming language.
\usetikzlibrary {arrows.meta,graphs,graphdrawing} \usegdlibrary {layered}
\tikz [nodes={text height=.7em, text depth=.2em,
draw=black!20, thick, fill=white, font=\footnotesize},
>={Stealth[round,sep]}, rounded corners, semithick]
\graph [layered layout, level distance=1cm, sibling sep=.5em, sibling distance=1cm] {
"5th
Edition"
-> { "6th
Edition", "PWB
1.0" };
"6th
Edition"
-> { "LSX"
[>child anchor=45], "1
BSD", "Mini
Unix", "Wollongong", "Interdata" };
"Interdata"
-> { "Unix/TS
3.0", "PWB
2.0", "7th
Edition" };
"7th
Edition"
-> { "8th
Edition", "32V", "V7M", "Ultrix-11", "Xenix", "UniPlus+"
};
"V7M"
->
"Ultrix-11";
"8th
Edition"
->
"9th
Edition";
"1
BSD"
->
"2 BSD"
->
"2.8
BSD"
-> { "Ultrix-11", "2.9
BSD" };
"32V"
->
"3 BSD"
->
"4 BSD"
->
"4.1
BSD"
-> { "4.2
BSD", "2.8
BSD", "8th
Edition" };
"4.2
BSD"
-> { "4.3
BSD", "Ultrix-32"
};
"PWB
1.0"
-> { "PWB
1.2"
->
"PWB 2.0", "USG
1.0"
-> { "CB
Unix
1", "USG
2.0" }};
"CB
Unix 1"
->
"CB Unix
2"
->
"CB Unix
3"
-> { "Unix/TS++", "PDP-11
Sys V" };
{ "USG
2.0"
->
"USG 3.0", "PWB
2.0", "Unix/TS
1.0"
} ->
"Unix/TS 3.0";
{ "Unix/TS++", "CB
Unix
3", "Unix/TS
3.0"
} ->
"TS 4.0"
->
"System
V.0"
->
"System
V.2"
->
"System
V.3";
};