Wednesday, August 02, 2006

Petersen graph


The smallest cubic graph of girth 5, drawn using TikZ.

\documentclass{article}
\usepackage{tikz}
\pagestyle{empty}

\begin{document}
\begin{center}
\begin{tikzpicture}[style=thick]
\draw (18:2cm) -- (90:2cm) -- (162:2cm) -- (234:2cm) --
(306:2cm) -- cycle;
\draw (18:1cm) -- (162:1cm) -- (306:1cm) -- (90:1cm) --
(234:1cm) -- cycle;
\foreach \x in {18,90,162,234,306}{
\draw (\x:1cm) -- (\x:2cm);
\draw (\x:2cm) circle (2pt);
\draw (\x:1cm) circle (2pt);
}
\end{tikzpicture}
\end{center}
\end{document}

No comments: