It was just a day like yesterday, February 2, but from 1896 that the mathematician K. Kuratowski was born. Kuratowski proved in 1930 a theorem that characterizes planar graphs (graphs that can be drawn in a sheet of paper with no pair of edges crossing each other). The theorem states that a graph is planar if and only if it does not “contain” a copy of the complete bipartite graph or of the complete graph . We now show the two drawings corresponding to the graphs mentioned in the theorem.
Pdf version of the drawing.
If we look at the picture carefully we may notice that it appears that edges are one on top of the other. To achieve this we used the following definitions (macros) in the preamble of our document.
\tikzstyle myBG=[line width=3pt,opacity=1] \newcommand{\drawLinewithBG}[2] { \draw[white,myBG] (#1) -- (#2); \draw[black,very thick] (#1) -- (#2); } \newcommand{\drawPolarLinewithBG}[2] { \draw[white,myBG] (#1) -- (#2); \draw[black,very thick] (#1) -- (#2); }
The commands we just defined tell TikZ to first draw a white line whose width is 3pt and then draw a black line on top of the white one.
The TikZ code that generates the drawing is the follwing.
\begin{tikzpicture} \useasboundingbox (-6.5,-3) rectangle (5.5,3); \begin{scope}[xshift=-6cm,yshift=-1cm] \foreach \x in {4,2,0} { \foreach \y in {0,2,4} { \drawLinewithBG{\x,0}{\y,2}; } } \foreach \x in {0,2,4} { \foreach \y in {0,2} { \node at (\x,\y) [circle,fill=black] {}; } } \node at (2,-1.5) {\Large$K_{3,3}$}; \end{scope} \begin{scope}[xshift=3cm] \foreach \a in { 18, 90, 162, 234, 306 } { \foreach \b in { 18, 90, 162, 234, 306 } { \drawPolarLinewithBG{\a:2}{\b:2}; } } \foreach \a in {18,90, 162, 234, 306 } { \node at (\a:2cm) [circle,fill=black] {}; } \node at (0,-2.5) {\Large$K_5$}; \end{scope} \end{tikzpicture}
Until next time!