Now we return to the original graph coloring problem: coloring maps. As indicated in section 1.1, the map coloring problem can be turned into a graph coloring problem. Figure 5.10.1 shows the example from section 1.1.

Figure 5.10.1. A map and its corresponding graph.

Graphs formed from maps in this way have an important property: they are planar.

Definition 5.10.1 A graph $G$ is planar if it can be represented by a drawing in the plane so that no edges cross.

Note that this definition only requires that some representation of the graph has no crossing edges. Figure 5.10.2 shows two representations of $K_4$; since in the second no edges cross, $K_4$ is planar.

Figure 5.10.2. $K_4$ drawn in two ways; the second shows that it is planar.

The number of colors needed to properly color any map is now the number of colors needed to color any planar graph. This problem was first posed in the nineteenth century, and it was quickly conjectured that in all cases four colors suffice. This was finally proved in 1976 (see figure 5.10.3) with the aid of a computer. In 1879, Alfred Kempe gave a proof that was widely known, but was incorrect, though it was not until 1890 that this was noticed by Percy Heawood, who modified the proof to show that five colors suffice to color any planar graph. We will prove this Five Color Theorem, but first we need some other results. We assume all graphs are simple.

Figure 5.10.3. The postmark on University of Illinois mail after the Four Color Theorem was proved.

Theorem 5.10.2 (Euler's Formula) Suppose $G$ is a connected planar graph, drawn so that no edges cross, with $n$ vertices and $m$ edges, and that the graph divides the plane into $r$ regions. Then $$r=m-n+2.$$

Proof.
The proof is by induction on the number of edges. The base case is $m=n-1$, the minimum number of edges in a connected graph on $n$ vertices. In this case $G$ is a tree, and contains no cycles, so the number of regions is 1, and indeed $1=(n-1)-n+2$.

Now suppose $G$ has more than $n-1$ edges, so it has a cycle. Remove one edge from a cycle forming $G'$, which is connected and has $r-1$ regions, $n$ vertices, and $m-1$ edges. By the induction hypothesis $r-1=(m-1)-n+2$, which becomes $r=m-n+2$ when we add 1 to each side.

$\square$

Lemma 5.10.3 Suppose $G$ is a simple connected planar graph, drawn so that no edges cross, with $n\ge3$ vertices and $m$ edges, and that the graph divides the plane into $r$ regions. Then $m\le 3n-6$.

Proof.
Let $f_i$ be the number of edges that adjoin region number $i$; if the same region is on both sides of an edge, that edge is counted twice. We call the edges adjoining a region the boundary edges of the region. Since $G$ is simple and $n\ge3$, every region is bounded by at least 3 edges. Then $\sum_{i=1}^r f_i=2m$, since each edge is counted twice, once for the region on each side of the edge. From $r=m-n+2$ we get $3r=3m-3n+6$, and because $f_i\ge 3$, $3r\le \sum_{i=1}^r f_i=2m$, so $3m-3n+6\le 2m$, or $m\le 3n-6$ as desired.

$\square$

Theorem 5.10.4 $K_5$ is not planar.

Proof.
$K_5$ has 5 vertices and 10 edges, and $10\not\le 3\cdot 5-6$, so by the lemma, $K_5$ is not planar.

$\square$

Lemma 5.10.5 If $G$ is planar then $G$ has a vertex of degree at most 5.

Proof.
The proof is by induction on the number of vertices $n$; when $n\le 5$ this is trivial.

Now suppose $G$ is planar on more than 5 vertices; by lemma 5.10.5 some vertex $v$ has degree at most 5. By the induction hypothesis, $G-v$ can be colored with 5 colors. Color the vertices of $G$, other than $v$, as they are colored in a 5-coloring of $G-v$. If $\d(v)\le 4$, then $v$ can be colored with one of the 5 colors to give a proper coloring of $G$ with 5 colors. So we now suppose $\d(v)=5$. If the five neighbors of $v$ are colored with four or fewer of the colors, then again $v$ can be colored to give a proper coloring of $G$ with 5 colors.

Now we suppose that all five neighbors of $v$ have a different color, as indicated in figure 5.10.4.

Figure 5.10.4. Five neighbors of $v$ colored with 5 colors: $v_1$ is red, $v_2$ is purple, $v_3$ is green, $v_4$ is blue, $v_5$ is orange.

Suppose that in $G$ there is a path from $v_1$ to $v_3$, and that the vertices along this path are alternately colored red and green; call such a path a red-green alternating path. Then together with $v$, this path makes a cycle with $v_2$ on the inside and $v_4$ on the outside, or vice versa. This means there cannot be a purple-blue alternating path from $v_2$ to $v_4$. Supposing that $v_2$ is inside the cycle, we change the colors of all vertices inside the cycle colored purple to blue, and all blue vertices are recolored purple. This is still a proper coloring of all vertices of $G$ except $v$, and now no neighbor of $v$ is purple, so by coloring $v$ purple we obtain a proper coloring of $G$.

If there is no red-green alternating path from $v_1$ to $v_3$, then we recolor vertices as follows: Change the color of $v_1$ to green. Change all green neighbors of $v_1$ to red. Continue to change the colors of vertices from red to green or green to red until there are no conflicts, that is, until a new proper coloring is obtained. Because there is no red-green alternating path from $v_1$ to $v_3$, the color of $v_3$ will not change. Now no neighbor of $v$ is colored red, so by coloring $v$ red we obtain a proper coloring of $G$.

Recommended articles

The LibreTexts libraries are Powered by MindTouch®and are supported by the Department of Education Open Textbook Pilot Project, the UC Davis Office of the Provost, the UC Davis Library, the California State University Affordable Learning Solutions Program, and Merlot. We also acknowledge previous National Science Foundation support under grant numbers 1246120, 1525057, and 1413739. Unless otherwise noted, LibreTexts content is licensed by CC BY-NC-SA 3.0. Have questions or comments? For more information contact us at info@libretexts.org or check out our status page at https://status.libretexts.org.