Application in graph theory
In graph theory, models and drawings often consist mostly of vertices, edges, and labels. So, it may be possible to use a simpler language to generate a diagram of a graph.
How to do it...
The tkz-graph
package offers a convenient interface. We will create a diagram with it as follows:
- Begin with any document class:
\documentclass{standalone}
- Load the
tkz-graph
package:\usepackage{tkz-graph}
- Specify a basic style:
\GraphInit[vstyle = Shade]
- Customize element styles as desired using standard TikZ syntax:
\tikzset{ LabelStyle/.style = { rectangle, rounded corners, draw, minimum width = 2em, fill = yellow!50, text = red, font = \bfseries }, VertexStyle/.append style = { inner sep=5pt, font = \Large\bfseries}, EdgeStyle/.append style = {->, bend left} }
- Begin the document:
\begin{document}
- Start a
tikzpicture
environment:\begin{tikzpicture}
- Set the distance between...