tags:

The macro \EdgeDoubleMod is convenient when drawing some complicated graphs. Consider the following picture of the line graph of the Petersen graph.

produced by:

\begin{tikzpicture}
\SetVertexNormal[MinSize=12pt]
\tikzset{VertexStyle/.append style=
{inner sep=0pt,font=\footnotesize\sffamily}}
\begin{scope}[rotate=-90]
\grCirculant[RA=0.6,prefix=a]{5}{2}
\end{scope}
\begin{scope}[rotate=-18]
\grEmptyCycle[RA=1.5,prefix=b]{5}{2}
\end{scope}
\begin{scope}[rotate=18]
\grCycle[RA=2.5,prefix=c]{5}
\end{scope}
\EdgeIdentity{a}{b}{5}
\EdgeIdentity{b}{c}{5}
{\tikzset{EdgeStyle/.append style = {blue,line width=3pt}}
\EdgeDoubleMod{b}{5}{0}{1}{a}{5}{2}{1}{5}}
{\tikzset{EdgeStyle/.append style = {green,line width=2pt}}
\EdgeDoubleMod{c}{5}{0}{1}{b}{5}{1}{1}{5}}
\end{tikzpicture}



We construct the graph using tree cycles: a circulant, an “empty” cycle and a usual cycle. The code \EdgeIdentity{a}{b}{5} just joins, for each $i$ from 0 to 4 (that is, five times) the vertex labeled $a_i$ to the vertex labeled $b_i$.

Finally \EdgeDoubleMod{b}{5}{0}{1}{a}{5}{2}{1}{5} joins, for each $i$ between 0 and 4 (that is the 5 in the last argument), the vertex labeled $b_{0+1\cdot i}$ to the vertex labeled $a_{2+1\cdot i}$. In both cases, the sub-index is calculated mod 5 (because of the second and the sixth argument).

2 Comments leave one →