Mathematics · Graph Theory · Combinatorics
📅 Квітень 2026 ⏱ ≈ 11 хв читання 🎯 Intermediate

Four-Color Theorem — Graph Coloring and the Computer-Assisted Proof

Any geographic map — no matter how complex — can be colored using at most four colors so that no two adjacent regions share the same color. This seemingly simple observation, proposed by Francis Guthrie in 1852, remained unproved for 124 years. The eventual proof by Appel and Haken in 1976 was the first major mathematical theorem verified with substantial computer assistance, sparking philosophical debates about the nature of mathematical proof that continue today.

1. The Theorem and Its History

Four-Color Theorem: Given any separation of a plane into contiguous regions, the regions can be colored using at most four colors so that no two adjacent regions have the same color. (Two regions are adjacent if they share a common boundary segment of positive length; corners don't count.)

2. Graph Theory Formulation

A map coloring problem is equivalent to a graph coloring problem. Convert the map to a planar graph: one vertex per region, one edge between vertices whose regions share a boundary. The four-color theorem then states: every planar graph is 4-colorable.

Terminology: χ(G) = chromatic number = minimum colors needed to color graph G such that no two adjacent vertices share a color 4CT: For every planar graph G, χ(G) ≤ 4 Key fact: K_4 (complete graph on 4 vertices) is planar and needs 4 colors. K_5 is NOT planar (Kuratowski's theorem); otherwise 5 might suffice. Euler's formula for connected planar graphs: V - E + F = 2 Consequence: every planar graph has a vertex with degree ≤ 5. (If all vertices had degree ≥ 6: E ≥ 3V → contradicts E ≤ 3V-6)

3. The Five-Color Theorem

The simpler five-color theorem has an elegant proof by strong induction requiring no computer:

  1. Every planar graph has a vertex v with degree ≤ 5 (by Euler's formula argument).
  2. Remove v; by induction the remaining graph is 5-colorable.
  3. Reinsert v. If its ≤5 neighbours use ≤4 colors, assign the fifth color to v. Done.
  4. If all 5 neighbors use all 5 colors (in cyclic order c₁, c₂, c₃, c₄, c₅ around v), we need Kempe's trick:
  5. Consider the subgraph induced by colors c₁ and c₃. If v₁ and v₃ are in different connected components, swap colors in v₁'s component — now both v₁ and v₃ use colors from {c₁,c₃}, freeing one for v.
  6. If same component: there's a c₁-c₃ path from v₁ to v₃. Then v₂ and v₄ must be in different components of the c₂-c₄ subgraph (they can't cross the path). Swap v₂'s component to free c₂ for v.

The failure of this to extend directly to four colors is why the four-color proof requires checking thousands of configurations — Kempe's "fix" doesn't always work for step 4 when trying to prove four suffice.

4. The Appel-Haken Proof

The proof strategy uses two key concepts:

Appel and Haken found an unavoidable set of 1,936 configurations and proved each is reducible. Together these guarantee: any planar graph contains a reducible configuration, so it can be 4-colored by induction on size.

Why computers were needed: Each redundancy check required verifying that no valid "Kempe chain" obstruction exists for each configuration — a finite but enormous computation. The initial verification took 1,200 hours of CPU time on an IBM 360. Modern proofs (Robertson et al.) reduced the unavoidable set to 633 configurations and completed the check in minutes.

5. Greedy Graph Coloring

For practical graph coloring (not necessarily optimal), the greedy algorithm assigns the lowest available color to each vertex in sequence:

function greedyColor(graph) {
  const color = new Array(graph.n).fill(-1);
  for (let v = 0; v < graph.n; v++) {
    const usedColors = new Set(
      graph.adj[v].filter(u => color[u] !== -1).map(u => color[u])
    );
    let c = 0;
    while (usedColors.has(c)) c++;
    color[v] = c;
  }
  return color;
}

Greedy coloring uses at most Δ(G) + 1 colors (where Δ(G) is the maximum degree), but may use more than the chromatic number χ(G). The vertex ordering matters greatly — optimal orderings include largest-first (by degree), smallest-last, and DSatur (dynamic saturation heuristic).

Finding the exact chromatic number χ(G) is NP-complete in general. For planar graphs, 4-colorability is always guaranteed, but finding a 4-coloring efficiently (in polynomial time) is still an open problem — we only know P algorithms exist for {2,3}-coloring of planar graphs.

6. Chromatic Polynomial

The chromatic polynomial P(G, k) counts the number of proper k-colorings of graph G:

For a path graph Pₙ: P(Pₙ, k) = k(k-1)^(n-1) For a cycle Cₙ: P(Cₙ, k) = (k-1)^n + (-1)^n(k-1) For a complete graph Kₙ: P(Kₙ, k) = k(k-1)(k-2)···(k-n+1) For a tree on n vertices: P(T, k) = k(k-1)^(n-1) Deletion-Contraction recurrence: P(G, k) = P(G\e, k) - P(G/e, k) where G\e removes edge e and G/e contracts edge e (merges endpoints).

The chromatic number χ(G) is the smallest k > 0 for which P(G, k) > 0. Computing P(G, k) is #P-hard in general — exponentially more difficult than just deciding colorability.

7. Applications Beyond Maps

🔍 Explore Maze & Graph Simulations →