0

this is my first question. I want to draw the Heawood graph using tikz. I don't know how to do a nice version like the one from the wiki picture, but I thought I could start instead by uniformly distributing 14 dots on a circle (with the actual circle line faded). And then draw the edges one by one. Any tips on how to start? Or how to do the nice one from the wiki pic?

5

It is rather easy to draw something like this.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
 \node[regular polygon,regular polygon sides=14,minimum size=4cm,draw,yscale=-1] (14gon){};
 \foreach \X in {1,...,14}
 {\node[circle,fill,inner sep=1.5pt] at (14gon.corner \X){};
  \ifodd\X
  \else
   \pgfmathtruncatemacro{\NextX}{1+mod(\X+4,14)}
   \draw (14gon.corner \X) -- (14gon.corner \NextX);
  \fi}
\end{tikzpicture}
\end{document}

enter image description here

Presumably there is a theory behind this, and you may want to look into the graph drawing libraries to generate these things more systematically.

| improve this answer | |
4

If you're working much with graphs like this you should use the tkz-berge package, which has many important graphs built into it. The code

\documentclass{article}
\usepackage{tikz}
\usepackage{tkz-berge}
\begin{document}
\begin{tikzpicture}%
\GraphInit[vstyle=Shade]
\grHeawood[RA=7]
\end{tikzpicture}
\end{document}

running in Gummi gives this output: enter image description here

You can find the tkz-berge documentation here. There is another reference for more specific graphs using the package discussed here. The Heawood graph is on page 55. There are several built in styles for displaying the graph. In this case vstyle=Shade, the Shade style, was used.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.