A Practical 4-coloring Method of Planar Graphs Mingshen Wu1 and Weihu Hong2 1Department of Math, Stat, and Computer Science, University of Wisconsin-Stout, Menomonie, WI 54751 2Department of Mathematics, Clayton State University, Morrow, GA, 30260

ABSTRACT An interesting coloring formula was conjectured by The existence of a 4-coloring for every finite loopless planar Heawood in 1890 [7]: For a given g > 0, the minimum graph (LPG) has been proven even though there are still number of colors necessary to color all graphs drawn on the some remaining discussions on the proof(s). How to design of that genus is given by a proper 4-coloring for a LPG? The purpose of this note is 7++ 1 48g to introduce a practical 4-coloring method that may provide γ ()g = . 2 a proper 4-coloring for a map or a LPG that users may be  interested in. The coloring process may be programmable with an interactive user-interface to get a fast proper For example, with genus g =1, it is a doughnut-shaped coloring. object. γ (1)= 7 means the chromatic number is seven. Picture 2 shows that the seven regions (with seven different Key words: 4-coloring, two-color subgraph, triangulation colors) can be topologically put on a such that the seven regions are mutually adjacent each other on the torus. 1 Brief historical review So, it clearly requires at least seven colors to be able to give In 1852, Francis Guthrie, a college student, noticed that only a proper coloring of maps on the torus. four different colors were needed while he was trying to color the map of counties of England such that no two adjacent counties receive a same color. Since then, mathematicians had been working hard to prove this seemingly easy but full of traps problem. Clearly, four colors are definitely needed even for a simple map as shown by picture 1(a) below. Picture 2: Seven coloring torus [9]

Ringel and Youngs [8] proved that Heawood conjecture is true except the which needs six colors only (picture 3).

1(a) 1(b) Picture 1: face coloring is equivalent to vertex coloring

Coloring a map is known as face coloring problem. We Picture 3: the Klein bottle [9] denote a finite loopless (every edge joins two distinct vertices) planar (can be drawn on a plane without edge A plane map can be seen as a map on a globe (picture 4), and crossing) graph by LPG. The dual graph D(G) of a LPG G is hence 4-colring of planar graphs is equivalent to 4-coloring defined as the graph that represents each face of G by a of the maps on a globe. A torus with g=0 is isomorphic to a vertex, and two vertices are adjacent in D(G) if and only if globe. So, even if the proof of 4-coloring theorem was the the two faces share boarder in G, for instance, the dotted most difficult one, we may see the 4-coloring of maps is the graph in 1(b) is the dual of 1(a). Clearly, D(G) is a LPG as lowest case of Heawood conjecture. well. A LPG is 4-colorable if its dual graph is vertex 4- colorable. So, face coloring is studied via vertex coloring.

Two American professors Kenneth Appel and Wolfgang Haken proved the 4-coloring theorem in 1976 using a computer [1],[2],[3]. However, many mathematicians have been working on a theoretical proof [4], some individuals tried to give a counter proof [5]. Some mathematicians have Picture 4: A globe to a plane been studying the properties and invariants of the 4-coloring of LPGs as well [6]. The 4-coloring problem is still drawing attention around the

world. People also would like to see an effective method that can provide a 4-coloring for a map or a LPG that people subgraphs: G1,2 and G3,4 , G1,3 and G2,4 , and G1,4 and G2,3 . are interested in. For example, picture 6(a) shows a proper 4-coloring of the

Heawood graph. Picture 6(b) shows a pair of two-color 2 Some definitions related to a LPG subgraphs. A triangulation of a LPG G may be obtained by adding edges, without edge crossing, to G until each face of G becomes a triangle (picture 5). Such a triangulation is also said to be a maximum planar graph. Obviously, a LPG is definitely 4-colorable if its triangulation is 4-colorable.

6(a) 6(b) Picture 6: the

In a two-color subgraph, the total degree of each component must be even, and hence the total degree of a two-color subgraph is even. These two-color subgraphs also have the following properties: Each component of a two color subgraph is of cycle and/or

Picture 5: a map, its dual graph and triangulation tree structure, i.e., each component is a cycle, or a tree, or a “cycle-tree” (tree is hanging on the cycle). For example, Mathematicians have studied the properties of such picture 6(b) shows a cycle and a tree for the two black color maximum planar graphs. The famous Euler formula says symbols; a tree and a cycle-tree for the two white color symbols. Each has only even cycle(s), if any, for a that, let p , e , and f be the number of vertices, edges, and Gij, faces of a planar graph G, respectively, then pe−+ f =2. proper 4-coloring. So, trying to break any two-color odd cycle of an improper 4-coloring is a critical scheme for If G is also a triangulation, then one can derive the following getting a proper one. properties from Euler formula:

(a) = − , ep36 A fact that can help on finding a proper 4-coloring is that if a (b) fp=2 − 4, and vertex is of degree three or lower, we may remove it from (c) 6pe−= 2 12 . [(c) shows that in a triangulation planar the graph since the color of this vertex is either uniquely graph, there is at least a vertex with degree ≤ 5.] determined by its neighbors or it can be an adjustable vertex when we put them back. This action can be performed Definitions: Suppose a planar graph G receives a 4-coloring recursively before design a coloring. using colors c , c , c ,and c . Assume that vertex v is 1 2 3 4 We define a reference path P of a graph G to be a path of G properly colored referring to its neighborhood. We say that such that no subset of vertices of P forms an odd cycle in G. vertex v is adjustable if the color of v can be assigned a A reference path can be properly colored by two colors that different color, without changing any color of its neighbors, are alternately applied along the path. such that v itself is still properly colored referring to its neighbors. For example, the vertex v in picture 6 is 3 The practical method of finding a 4-colring adjustable. An edge is said to be a “bad-edge” of a coloring if its two endpoints received the same color. We will fix the of a LPG improper coloring on a bad-edge via color switching This note introduces a programmable process that may schemes. provide a proper 4-coloring for a general map or a LPG. We do not assert this process must be a success (that would claim we have a proof of the 4-coloring theorem), however, we have successfully found a proper 4-coloring for all examples we have had via this method.

Assume that we are given a planer graph G. Picture 6: an adjustable vertex Step 1: Find and remove all vertices with degree three or

lower recursively. [Stop if the remaining number of vertices Assume that G receives a proper 4-coloring. A two-color is less than 5. A proper 4-coloring is obvious.] subgraph is a ccij- subgraph Gij, spanned by all vertices of Step 2: select a reference path P and color it by two colors, G that are colored by ci or c j . There are six two-color say c and c , alternately. [User should be able to select the subgraphs. We consider them as three pairs of two-color 1 2 reference path via user-interface.] (4.3.3) Detect whether there is an adjustable vertex. If so, Step 3: (Initial coloring) assign a different color to the adjustable vertex and return to

Let Sk be the ordered set of all vertices v of G such that the beginning of step 4. Otherwise, continue. distance DvP(, )= k in G. The order of vertices in S is k Step 5: Assign a new reference path P and go to step 3 to created by a depth first search. For example, if x is the last restart the coloring process. The reference path P can have vertex added to Sk , then a neighbor y of x with DyP(, )= k, one or more vertices. User may select P by experience or observation. if any, should be added to Sk next. So, Sk is ordered like a circle around the reference path P. 4 Examples As you have seen above, we represent the four colors using Color by colors c and c if k is odd, or by c and c if k Sk 3 4 1 2 the symbols ▲, , ∆, and O. is even. This step gives an initial coloring for all vertices of G. [There may have bad-edge(s) that will occur if either any Example 1: The Heawood graph (picture 6(a)) (see [10]). Sk itself forms an odd cycle or a subset of Sk forms an odd Heawood presented this graph as a counterexample to the cycle in G.] proof of 4-coloring theorem by Alfred Kempe.

Step 4: (Correction step) 4-coloring process by the practical method: Detect any bad-edge(s). If no bad-edge, it is a perfect Step 1: Nothing can be done. coloring and stop. Step 2: Select the circled two vertices as the reference path Otherwise, fix the bad-edges one at a time (of course, if and color it using the two black color symbols. (7(a)) lucky, more than one bad-edge might be fixed Step 3: Color the ordered set Sk alternately using two white simultaneously). Select a bad-edge (u, v) and assume u and v color symbols if k is odd; two black color symbols if k is received color c1 . even. There is a bad-edge (u, v) with color ∆ in S5 (7(a)). Step 4:

(4.1) For each two-color subgraph G1, j , j=2, 3, or 4, detect (4.1) No such component. whether there is a component that consists of only even (4.2) There is an odd cycle within each of (∆, O), (∆,▲) and cycle(s) and/or tree(s), and that contains exactly one of u and (∆,) subgraphs as shown on picture 7(b). This implies we v. If so, the bad-edge may be fixed by swapping these two have no way to fix (u, v) now. colors on this component, and return to the beginning of step 4. Otherwise, continue.

, (4.2) For each two-color subgraph G1, j j=2, 3, or 4, detect whether there is a component that consists of two-color even cycle(s) and/or tree(s) containing edge (u, v). If so, recolor this component with the two colors, and return to the beginning of step 4. (u, v) should be fixed. Otherwise, there is an odd cycle containing (u, v) in each Picture 7(a) Picture 7(b) two-color subgraph. (u, v) cannot be fixed now.

(4.3) This step does not fix any bad-edge, but change the color status. Users should have a chance to determine a starting vertex to perform any one of the following sub-steps. (4.3.1) Detect whether there is a component C in a two-color subgraph with one color of Sk and one color of Sk +1 such that C consists of even cycle(s) and/or tree(s) only. If such a component exists, exchanging the two colors along C, then Picture 7(c) Picture 7(d) return to the beginning of step 4. If necessary, this detection can be performed several times using different starting vertex, and/or different pair of colors between Sk and Sk +1 . Continue if nothing can be done. (4.3.2) Detect whether there is a two-color cycle that contains edge (u, v) such that we can change the color c1 that u and v both have now to another color. [This does not create or fix a bad-edge.] If yes, do so and return to the beginning of step 4. Otherwise, continue. Picture 7(e) Picture 7(f) Picture 7

(4.3) starting with vertex x – picture 7(c) Step 1: Done already.  (4.3.1) There is a -O tree cross Sk s from vertex x (7(c)). Step 2: Select the two vertices at the center of the graph as  Swap color  and O along this tree, and return to the the reference path. Color this path by ▲ and . (picture 11) beginning of step 4. (7(d)) Step 3: Search for Sk , for k=1 to 9. Color each Sk using two (4.1) There is a ∆- component that is a tree containing white color symbols if k is odd; or two black color symbols vertex u only (indicated by the broken-curve in picture 7(e)). if k is even. S9 is of only three vertices. Unfortunately, Swap colors ∆ and  along this component and return to the there are odd cycles within S and S . (picture 11) beginning of step 4. 8 9 No more bad-edge. A perfect coloring obtained. (7(f))

Note: This coloring process is not unique. Referring to picture 7(d), v by itself is a trivial ∆- path, so we can simply switch color ∆ to  for v to get a perfect 4-coloring as well.

Example 2: Gardner’s April Fools’ Day puzzle In 1975, Martin Gardner “claimed” the map of 110 regions (picture 8) requires five colors to get a proper coloring. Of course, Gardner just made a fun on the Fool’s Day. A proper 4-coloring of Gardner’s map had been found couple years after he published the map (picture 9).

Picture 11

After coloring by distance to the reference path P, there are several bad-edges. See the broken lines in picture 12. Step 4: Select a bad-edge (u, v) with color  (picture 12).

Picture 8 Picture 9

We illustrate the coloring process by find a proper 4-coloring of the Gardner’s graph.

Since region 110 (see picture 8) is enclosed by three regions only, so its color will be uniquely determined by the surrounding three regions and hence we can remove it from the map. The dual triangulation of Gardner’s map (with region 110 removed) is given by picture 10. We took this picture from Xu’s book [6] and corrected a minor error.

Picture 12

(4.1) Starting with vertex u there is a -∆ path that contains vertex u only. Swap  and ∆ and return to the beginning of step 4. [Luckily, three bad-edges on the left side are all fixed. Picture 13]

Picture 10 Gardner graph

(4.3.2) There is an even ∆-O cycle found (picture 14). Exchange color ∆ and O along this cycle and return to the beginning of step 4. [Now, the color of both u and v∆ is (picture 15).]

(4.1) Starting with vertex u, there is a ∆- component that consists of even cycles and trees and that does not contain vertex v (picture 15). Swapping colors ∆ and  for this component results in a perfect coloring of Gardner’s graph as shown in picture 16.

Picture 13

Step 4: The only bad-edge (u, v) is on the right side which received color O for both u and v (picture 13). (4.1) No such component in anyone of two-color subgraphs. (4.2) There is an odd-cycle found in each (O,▲), (O, ), or (O, ∆) subgraphs. This implies that we have no way to fix the bad-edge by switching a pair of colors now. Picture 13 shows the three two-color odd cycles.

Under this situation our process goes to (4.3). Hope (4.3) can update the color situation and possible have a chance to get rid of the bad-edge. Picture 16 A perfect 4-coloring

Example 3: Let’s study the Triakis Icosahedral graph [11] (picture 17(a)). To directly design a proper 4-coloring for this graph

is not trivial since there are many K4 s. However, removing all vertices with degree three (step 1 of our coloring procedure) gave graph 17(b). We omit the details since it is not difficult at all to assign a proper 4-coloring for 17(b) as shown in 17(c). A proper 4-coloring obtained by adding those removed vertices back with a proper color (see 17(d)).

Picture 14

17(a) 17(b)

17(c) 17(d) Picture 17 Picture 15

5 Conclusions [10] Wolfram MathWorkd, The 4-coloring process we introduced here can be done http://mathworld.wolfram.com/HeawoodFour- manually. It is an interesting exercise that can be a practical ColorGraph.html project for students. This process is also programmable. In fact, the fundamental detection process includes DFS or BFS [11] Wolfram MathWorkd, http://athworld.wolfram.com search, creating the ordered sets, assigning colors, and /TriakisIcosahedralGraph.html swapping colors actions. User-interface is an important factor for getting a fast result.

We finish this note by indicating that an actual map might requires more than four colors if there are some countries whose territory has more than one region and the territory of each country must be of the same color. For example, in the following map, if the two regions both labeled 1 must be of the same color, it would enforce to use the fifth color.

6 REFERENCES

[1] K. Appel and W. Haken, Every planar map is four colorable. Part I. Discharging, Illinois J. Math. 21 (1977), 429{490. MR 58:27598d

[2] K. Appel, W. Haken, and J. Koch, Every planar map is four colorable. Part II. Reducibility, Illinois J. Math 21 (1977), 491{567. MR 58:27598d

[3] K. Appel and W. Haken, Every planar map is four colorable, A.M.S. Contemporary Math. 98 (1989). MR 91m:05079

[4] Electronic Research Announcements of the American Mathematical Society, . Volume 2, Number 1, August 1996

[5] http://www.superliminal.com/4color/4color.htm

[6] Shouchun Xu, 图说四色问题 (Picturizing 4-coloring problem), Peking University Press, ISBN 978-7-301-12800- 8, 2009.

[7] Heawood, Map colour theorem, Quart. J. Pure Appl. Math. 24 (1890) 332-338.

[8] Ringel and Youngs, Solution of the Heawood map- coloring problem, Proc. Nat. Acad. Sci. USA 60 (1968) 438- 445.

[9] Wikipedia, http://en.wikipedia.org/wiki/, File: Projection_color_torus.png