Graph TheoryTopic #27 of 40

Graph Coloring

Vertex coloring, chromatic number, edge coloring, and the four-color theorem.

Vertex Coloring

Definition

A proper vertex coloring assigns colors to vertices so that no two adjacent vertices have the same color.

A graph is kk-colorable if it can be properly colored with kk colors.

Chromatic Number

The chromatic number χ(G)\chi(G) is the minimum number of colors needed: χ(G)=min⁡{k:G is k-colorable}\chi(G) = \min\{k : G \text{ is } k\text{-colorable}\}

Basic Examples

Complete Graph KnK_n

χ(Kn)=n\chi(K_n) = n Every vertex is adjacent to every other.

Cycle CnC_n

χ(Cn)={2if n is even3if n is odd\chi(C_n) = \begin{cases} 2 & \text{if } n \text{ is even} \\ 3 & \text{if } n \text{ is odd} \end{cases}

Bipartite Graph

χ(G)=2 if G is bipartite and has edges\chi(G) = 2 \text{ if } G \text{ is bipartite and has edges} χ(G)=1 if G has no edges\chi(G) = 1 \text{ if } G \text{ has no edges}

Tree

χ(T)=2 (if at least one edge)\chi(T) = 2 \text{ (if at least one edge)}

Bounds on Chromatic Number

Upper Bounds

Greedy bound: χ(G)≤Δ(G)+1\chi(G) \leq \Delta(G) + 1 where Δ(G)\Delta(G) is maximum degree.

Brooks' Theorem: For connected graph GG that is neither complete nor an odd cycle: χ(G)≤Δ(G)\chi(G) \leq \Delta(G)

Lower Bounds

Clique bound: χ(G)≥ω(G)\chi(G) \geq \omega(G) where ω(G)\omega(G) is the size of the largest clique.

Independence bound: χ(G)≥∣V∣α(G)\chi(G) \geq \frac{|V|}{\alpha(G)} where α(G)\alpha(G) is the independence number (largest independent set).

Chromatic Polynomial

The chromatic polynomial P(G,k)P(G, k) gives the number of proper kk-colorings.

Examples

Empty graph Kn‾\overline{K_n}: P(Kn‾,k)=knP(\overline{K_n}, k) = k^n

Complete graph KnK_n: P(Kn,k)=k(k−1)(k−2)⋯(k−n+1)=kn‾P(K_n, k) = k(k-1)(k-2)\cdots(k-n+1) = k^{\underline{n}}

Cycle CnC_n: P(Cn,k)=(k−1)n+(−1)n(k−1)P(C_n, k) = (k-1)^n + (-1)^n(k-1)

Tree with nn vertices: P(T,k)=k(k−1)n−1P(T, k) = k(k-1)^{n-1}

Deletion-Contraction

For edge e=(u,v)e = (u,v): P(G,k)=P(G−e,k)−P(G/e,k)P(G, k) = P(G - e, k) - P(G / e, k)

where G−eG - e deletes edge ee and G/eG / e contracts edge ee.

Four Color Theorem

Every planar graph is 4-colorable. χ(G)≤4 for planar G\chi(G) \leq 4 \text{ for planar } G

Proved in 1976 (Appel and Haken) using computer verification.

Five Color Theorem: Easier to prove: every planar graph is 5-colorable.

Edge Coloring

Definition

A proper edge coloring assigns colors to edges so that no two edges sharing a vertex have the same color.

Chromatic Index

χ′(G)\chi'(G) = minimum number of colors for proper edge coloring.

Vizing's Theorem

For any simple graph GG: Δ(G)≤χ′(G)≤Δ(G)+1\Delta(G) \leq \chi'(G) \leq \Delta(G) + 1

Graphs achieving lower bound: Class 1 Graphs requiring upper bound: Class 2

Examples

  • Bipartite graphs: χ′(G)=Δ(G)\chi'(G) = \Delta(G) (Class 1)
  • Petersen graph: χ′(G)=4=Δ(G)+1\chi'(G) = 4 = \Delta(G) + 1 (Class 2)

Greedy Coloring Algorithm

1. Order vertices: v_1, v_2, ..., v_n
2. For each v_i in order:
   Assign v_i the smallest color not used by its neighbors

Always uses ≤Δ(G)+1\leq \Delta(G) + 1 colors, but ordering matters.

Applications

Scheduling

Tasks as vertices, edge if tasks conflict. Colors = time slots. χ(G)\chi(G) = minimum time slots needed.

Register Allocation

Variables as vertices, edge if both needed simultaneously. Colors = CPU registers.

Map Coloring

Regions as vertices, edge if regions share a border. Four colors suffice for any map.

Frequency Assignment

Transmitters as vertices, edge if too close. Colors = frequencies.

Graph Coloring Complexity

Decision problem: Is GG kk-colorable?

  • k=2k = 2: Polynomial (bipartite testing)
  • k≥3k \geq 3: NP-complete

Computing chromatic number: NP-hard

Special Classes

Chordal Graphs

Graphs where every cycle of length ≥4\geq 4 has a chord. Can be optimally colored in polynomial time.

Perfect Graphs

Graphs where χ(H)=ω(H)\chi(H) = \omega(H) for all induced subgraphs HH. Includes bipartite, chordal, and complement of bipartite.