Graph drawings in TikZ.

May 14, 2010

Tutte’s Graph

Filed under: Graphs — fbc @ 22:41
Tags: , , , , ,

On the occasion of the 93 anniversary of the birth of William Tutte, we present a drawing of Tutte’s graph.

Tutte's Graph

Tutte

The pdf file.

As in our previous example, we used the shadows library from TikZ.

\usetikzlibrary{shadows}

Now, the code that generates the drawing.

\begin{tikzpicture}[
 vertex_style/.style ={circle,shading=ball,ball color=red,draw=red!40!white,drop shadow={opacity=0.4}},
 edge_style/.style={ultra thick, black},rotate=-30]

 \useasboundingbox (-14.2,-10.5) rectangle (14.3,16.2);

 \draw[edge_style] (0,0) -- (4.3431,0);
 \draw[edge_style] (0,0) -- (-2.1715,3.7612);
 \draw[edge_style] (0,0) -- (-2.1715,-3.7612);

 \draw[edge_style] (10,-5.6568) -- (-0.1010,-11.4886);

 \draw[edge_style] (-9.8989,5.8318) -- (-9.8989,-5.8318);

 \draw[edge_style] (10,5.6568) -- (-0.1010,11.4886);

 \node[vertex_style] at (0,0) {};
 % absolute positions
 \def\nodepos{0/0/0,1/0/2,2/4/2,3/4/4,4/0/4,
 5/-2/4,6/-4/4,7/-4/-4,8/4/-4,9/4/-2,
 10/4/0,11/2/0,12/2/-2,13/-2/-2,14/-2/0}

 \begin{scope}[rotate=0,xshift=10cm,rotate=135]
 \foreach \n/\x/\y in \nodepos{ \coordinate (\n) at (\x,\y);}
 \end{scope}

 \draw[edge_style] (0)
 \foreach \x in {1,...,14}{ --(\x)} -- cycle;

 \foreach \x/\y in {0/11,1/4,2/10,5/14,7/13,9/12}{
 \draw[edge_style] (\x) -- (\y);
 }

 \foreach \x in {0,1,...,14}{
 \node[vertex_style] at (\x){};
 }

 \begin{scope}[rotate=120,xshift=10cm,rotate=135]
 \foreach \n/\x/\y in \nodepos{ \coordinate (\n) at (\x,\y);}
 \end{scope}

 \draw[edge_style] (0)
 \foreach \x in {1,...,14}{ --(\x)} -- cycle;

 \foreach \x/\y in {0/11,1/4,2/10,5/14,7/13,9/12}{
 \draw[edge_style] (\x) -- (\y);
 }

 \foreach \x in {0,1,...,14}{
 \node[vertex_style] at (\x){};
 }

 \begin{scope}[rotate=240,xshift=10cm,rotate=135]
 \foreach \n/\x/\y in \nodepos{ \coordinate (\n) at (\x,\y);}
 \end{scope}

 \draw[edge_style] (0)
 \foreach \x in {1,...,14}{ --(\x)} -- cycle;

 \foreach \x/\y in {0/11,1/4,2/10,5/14,7/13,9/12}{
 \draw[edge_style] (\x) -- (\y);
 }

 \foreach \x in {0,1,...,14}{
 \node[vertex_style] at (\x){};
 }

\end{tikzpicture}

Until next time!

Create a free website or blog at WordPress.com.