Graph Coloring and Chromatic Polynomials

⚡ Key Takeaways

Graph coloring assigns labels ("colors") to the vertices of a graph so that adjacent vertices receive different colors; the minimum number of colors needed is the chromatic number χ(G)\chi(G). The chromatic polynomial P(G,k)P(G,k) counts the number of proper colorings using kk colors and is a polynomial in kk. Applies to scheduling, register allocation, frequency assignment, and map coloring. Foundational work by Birkhoff (1912), Whitney (1932), and the Four Color Theorem (Appel–Haken, 1976).

💡 The Core Insight

Two questions live side by side. Existence: how few colors suffice? That's χ(G)\chi(G). Enumeration: how many ways can we color with kk colors? That's P(G,k)P(G,k). The astonishing bridge between them is deletion–contraction: removing an edge versus merging its endpoints relates the colorings of three graphs by one identity. This single recurrence proves P(G,k)P(G,k) is a polynomial, lets you compute it, and reveals that all coloring information about GG is captured by a finite list of integer coefficients.

Formal Statement

DefinitionProper Coloring and Chromatic Number

Let G=(V,E)G=(V,E) be a finite simple graph with ∣V∣=n|V|=n vertices and ∣E∣=m|E|=m edges. A proper kk-coloring is a map c:V→{1,2,…,k}c:V\to\{1,2,\dots,k\} with c(u)≠c(v)c(u)\neq c(v) for every edge uv∈Euv\in E. The chromatic number is

1
χ(G)=min⁡{ k∈Z>0:G admits a proper k-coloring }.\quad \chi(G)=\min\{\,k\in\mathbb{Z}_{>0} : G \text{ admits a proper } k\text{-coloring}\,\}.

Derivation hint: well-defined because k=nk=n (all distinct colors) always works, so the set is nonempty and bounded below by 1. A graph is kk-colorable if χ(G)≤k\chi(G)\le k and kk-chromatic if χ(G)=k\chi(G)=k.

DefinitionChromatic Polynomial

The chromatic polynomial P(G,k)P(G,k) is the number of proper colorings of GG using a palette of kk available colors (colors need not all be used). It satisfies

2
χ(G)=min⁡{ k∈Z>0:P(G,k)>0 }.\quad \chi(G)=\min\{\,k\in\mathbb{Z}_{>0} : P(G,k)>0\,\}.

Derivation hint: P(G,k)>0P(G,k)>0 iff at least one proper kk-coloring exists, which is the definition of kk-colorability. For the empty graph Kn‾\overline{K_n} (no edges) and the complete graph KnK_n:

3
P(Kn‾,k)=k n,P(Kn,k)=k(k−1)(k−2)⋯(k−n+1)=kn‾.\quad P(\overline{K_n},k)=k^{\,n},\qquad P(K_n,k)=k(k-1)(k-2)\cdots(k-n+1)=k^{\underline{n}}.

Derivation hint: with no edges each vertex is free (kk choices each); for KnK_n all vertices mutually adjacent so colors must be distinct — a falling factorial.

TheoremFundamental Properties of P(G,k)P(G,k)

For a graph GG with nn vertices, mm edges, and cc connected components: 1. P(G,k)P(G,k) is a polynomial in kk of degree exactly nn, with leading coefficient 11. 2. The coefficient of kn−1k^{n-1} is −m-m. 3. Coefficients alternate in sign: P(G,k)=∑i=0n(−1)n−iaikiP(G,k)=\sum_{i=0}^{n}(-1)^{n-i}a_i k^i with ai≥0a_i\ge 0. 4. The constant term is 00 (i.e. P(G,0)=0P(G,0)=0); more precisely kc∣P(G,k)k^c \mid P(G,k). 5. The smallest power of kk dividing P(G,k)P(G,k) equals the number of connected components cc.

TheoremDeletion–Contraction

For any edge e=uve=uv of GG, let G−eG-e denote GG with ee deleted and G/eG/e denote GG with u,vu,v identified (contraction, merging parallel edges). Then

4
P(G,k)=P(G−e, k)−P(G/e, k).\quad P(G,k)=P(G-e,\,k)-P(G/e,\,k).

Derivation hint: proper colorings of G−eG-e split into those with c(u)≠c(v)c(u)\neq c(v) (= colorings of GG) and those with c(u)=c(v)c(u)=c(v) (= colorings of G/eG/e).

Why It Holds / Derivation

ProofDeletion–Contraction and Polynomiality

Step 1 — Partition the colorings of G−eG-e. Take any proper coloring of G−eG-e where e=uve=uv. In G−eG-e the vertices u,vu,v are not constrained relative to each other, so two disjoint cases occur:

  • (A) c(u)≠c(v)c(u)\neq c(v): this coloring is also proper for GG (the only extra edge ee is satisfied).
  • (B) c(u)=c(v)c(u)=c(v): this coloring corresponds bijectively to a proper coloring of G/eG/e, since identifying uu and vv into one vertex (which now carries that common color) gives a valid coloring, and conversely.

Step 2 — Count. Case (A) has P(G,k)P(G,k) colorings; case (B) has P(G/e,k)P(G/e,k); together they exhaust G−eG-e:

5
P(G−e,k)=P(G,k)+P(G/e,k).\quad P(G-e,k)=P(G,k)+P(G/e,k).

Derivation hint: the two cases are mutually exclusive and exhaustive among proper colorings of G−eG-e. Rearranging gives equation [4].

Step 3 — Polynomiality by induction on mm. Base case m=0m=0: G=Kn‾G=\overline{K_n} with P=knP=k^n, a polynomial. Inductive step: any graph with m≥1m\ge 1 edges has both G−eG-e (with m−1m-1 edges) and G/eG/e (with <n<n vertices and ≤m−1\le m-1 edges) of strictly smaller edge count. By induction both are polynomials in kk, hence so is their difference. ■\blacksquare

Step 4 — Degree and leading terms. G−eG-e has nn vertices, G/eG/e has n−1n-1. By induction P(G−e,k)=kn−(m−1)kn−1+⋯P(G-e,k)=k^n - (m-1)k^{n-1}+\cdots and P(G/e,k)=kn−1+⋯P(G/e,k)=k^{n-1}+\cdots. Subtracting:

6
P(G,k)=kn−(m−1)kn−1−kn−1+⋯=kn−m kn−1+⋯\quad P(G,k)=k^n-(m-1)k^{n-1}-k^{n-1}+\cdots=k^n-m\,k^{n-1}+\cdots

Derivation hint: track only the top two coefficients through equation [4]; the kn−1k^{n-1} terms accumulate −(m−1)−1=−m-(m-1)-1=-m.

∎
ProofConnected Components Multiply, Constant Term Vanishes

Multiplicativity. If GG is the disjoint union G1⊔G2G_1\sqcup G_2, a proper coloring is an independent choice on each part, so

7
P(G1⊔G2, k)=P(G1,k)⋅P(G2,k).\quad P(G_1\sqcup G_2,\,k)=P(G_1,k)\cdot P(G_2,k).

Derivation hint: the color of a vertex in G1G_1 places no constraint on any vertex in G2G_2 — independent counting.

Constant term. Each connected component contributes a factor with P(component,0)=0P(\text{component},0)=0 (zero colors color nothing on a nonempty vertex set), and one shows each connected factor is divisible by kk exactly once when joined; more carefully, a connected graph HH has k∣P(H,k)k\mid P(H,k) but k2∤P(H,k)k^2\nmid P(H,k), so kc∥P(G,k)k^c \| P(G,k). ■\blacksquare

∎
mathematician · George David Birkhoff | 1884–1944

Birkhoff introduced the chromatic polynomial in 1912 as a strategic detour: rather than prove directly that every planar map needs only four colors, he proposed to count the four-colorings P(G,4)P(G,4) and show this count is always positive. While the program did not by itself crack the Four Color Theorem, it founded the entire theory of chromatic polynomials. Birkhoff, an American mathematician at Harvard better known for his ergodic theorem in dynamical systems, treated the polynomial's coefficients and roots as objects of independent interest. His student-era collaborator Daniel Lewis and later Hassler Whitney developed the structural and subgraph-counting interpretations. The dream of attacking the four-color problem via the analytic behavior of P(G,4)P(G,4) persists in modern work on the location of chromatic roots.

Building Intuition

🧠 Intuition

Think of coloring as constraint satisfaction. Each vertex is a slot; each edge is a "must differ" rule. The chromatic number asks: how few categories do I need so that no two things that conflict share a category? Two extremes anchor your intuition:

  • No edges → every vertex independent → knk^n colorings, χ=1\chi=1.
  • All edges (clique KnK_n) → maximal conflict → χ=n\chi=n and only the falling factorial kn‾k^{\underline n} colorings.

A bipartite graph (one with no odd cycle) needs only 2 colors — color the two sides of the partition. So χ=2\chi=2 exactly when GG has at least one edge but no odd cycle. The presence of an odd cycle is the simplest obstruction forcing a third color. For the polynomial, picture deletion–contraction as a binary tree: each edge you process branches into "keep it (delete)" and "merge it (contract)." The leaves are edgeless graphs whose polynomials are pure powers knik^{n_i}. Summing the leaves with signs reconstructs P(G,k)P(G,k) — a fully mechanical, if exponential, algorithm.

Figure
Deletion–contraction on the triangle K3K_3, yielding P(K3,k)=k(k−1)(k−2)P(K_3,k)=k(k-1)(k-2)
P(G) = P(G−e) − P(G/e) G = K₃ = G−e (path) k(k−1)² − G/e (edge) k(k−1) k(k−1)² − k(k−1) = k(k−1)(k−2) χ(K₃) = 3 (smallest k with P>0) e = deleted edge between the two bottom vertices

Worked Examples

ExampleChromatic Polynomial of a Path and a Cycle

Given: the path PnP_n (nn vertices in a line, n−1n-1 edges) and the cycle CnC_n (nn vertices in a ring, nn edges).

Path PnP_n. Color vertices left to right. The first vertex has kk choices; each subsequent vertex must merely differ from its single colored predecessor, giving k−1k-1 choices:

8
P(Pn,k)=k(k−1) n−1.\quad P(P_n,k)=k(k-1)^{\,n-1}.

Derivation hint: greedy left-to-right counting; no later vertex constrains earlier ones, so choices multiply. So χ(Pn)=2\chi(P_n)=2 for n≥2n\ge 2 (it is bipartite).

Cycle CnC_n. Apply deletion–contraction to one edge ee of the cycle. Then Cn−e=PnC_n - e = P_n (the cycle opens into a path) and Cn/e=Cn−1C_n/e = C_{n-1}. Thus

9
P(Cn,k)=P(Pn,k)−P(Cn−1,k)=k(k−1)n−1−P(Cn−1,k).\quad P(C_n,k)=P(P_n,k)-P(C_{n-1},k)=k(k-1)^{n-1}-P(C_{n-1},k).

Derivation hint: deleting one edge of a ring gives a path; contracting it gives a shorter ring. Solving this recurrence (with P(C3,k)=k(k−1)(k−2)P(C_3,k)=k(k-1)(k-2)) gives the closed form

10
P(Cn,k)=(k−1)n+(−1)n(k−1).\quad P(C_n,k)=(k-1)^{n}+(-1)^{n}(k-1).

Derivation hint: the homogeneous solution is (k−1)n(k-1)^n; check the base case n=3n=3 to fix the (−1)n(k−1)(-1)^n(k-1) correction term.

Numerical check, n=4n=4, k=3k=3: P(C4,3)=(2)4+(−1)4(2)=16+2=18P(C_4,3)=(2)^4+(-1)^4(2)=16+2=18. Direct count of 3-colorings of a 4-cycle indeed gives 1818.

  P(Cn,k)=(k−1)n+(−1)n(k−1),χ(Cn)={2n even3n odd  \boxed{\;P(C_n,k)=(k-1)^n+(-1)^n(k-1),\qquad \chi(C_n)=\begin{cases}2 & n \text{ even}\\ 3 & n \text{ odd}\end{cases}\;}
ExampleA Tree and a Concrete Scheduling Count

Given: a company schedules 5 final exams (vertices A,B,C,D,E). Two exams conflict (edge) if some student takes both: pairs {A,B},{A,C},{B,C},{C,D},{D,E}\{A,B\},\{A,C\},\{B,C\},\{C,D\},\{D,E\}. We have k=4k=4 available time slots ("colors"). How many valid timetables exist, and what is the minimum number of slots?

Build the graph: edges = AB, AC, BC, CD, DE. Vertices A,B,C form a triangle K3K_3; D attaches to C; E attaches to D — a triangle with a pendant path.

Decompose. This graph is "K3K_3 with a path C ⁣− ⁣D ⁣− ⁣EC\!-\!D\!-\!E hanging off." Use the rule for adding a vertex adjacent to exactly one already-colored vertex (it multiplies by k−1k-1):

11
P(G,k)=k(k−1)(k−2)⏟triangle ABC⋅(k−1)⏟D adj to C⋅(k−1)⏟E adj to D.\quad P(G,k)=\underbrace{k(k-1)(k-2)}_{\text{triangle }ABC}\cdot \underbrace{(k-1)}_{D \text{ adj to } C}\cdot \underbrace{(k-1)}_{E \text{ adj to } D}.

Derivation hint: attaching a leaf to an already-colored vertex multiplies the count by (k−1)(k-1) since the leaf only avoids its one neighbor.

Plug in k=4k=4:

P(G,4)=4⋅3⋅2⋅3⋅3=24⋅9=216.P(G,4)=4\cdot 3\cdot 2\cdot 3\cdot 3 = 24\cdot 9 = 216.

Minimum slots: the triangle forces χ≥3\chi\ge 3; three slots suffice (color A,B,C distinctly, then D≠C, E≠D), so χ(G)=3\chi(G)=3.

  P(G,4)=216 valid 4-slot timetables;χ(G)=3 slots minimum  \boxed{\;P(G,4)=216 \text{ valid 4-slot timetables};\quad \chi(G)=3 \text{ slots minimum}\;}

Common Misconceptions

⚠️ Common mistake

χ(G)\chi(G) is not always equal to the maximum degree plus one. A common error is to assume χ(G)=Δ(G)+1\chi(G)=\Delta(G)+1. In fact Brooks' Theorem says χ(G)≤Δ(G)+1\chi(G)\le \Delta(G)+1 always, with equality only for complete graphs and odd cycles. For most graphs χ(G)\chi(G) is strictly smaller. A long even path has Δ=2\Delta=2 but χ=2\chi=2, not 33.

A graph's chromatic polynomial does not determine the graph. Different (non-isomorphic) graphs can share the same chromatic polynomial; they are called chromatically equivalent. So P(G,k)P(G,k) is a powerful invariant but not a complete one.

Containing a large clique gives only a lower bound. If the largest clique has size ω(G)\omega(G), then χ(G)≥ω(G)\chi(G)\ge \omega(G), but the gap can be arbitrarily large: there exist triangle-free graphs (ω=2\omega=2) with arbitrarily large chromatic number (Mycielski's construction).

Counterexample

Claim (false): "If GG has no triangle, then GG is 2-colorable."

Refutation: The 5-cycle C5C_5 has no triangle (its shortest cycle has length 5) yet χ(C5)=3\chi(C_5)=3. By equation [10], P(C5,2)=(1)5+(−1)5(1)=1−1=0P(C_5,2)=(1)^5+(-1)^5(1)=1-1=0, confirming no proper 2-coloring exists, while P(C5,3)=25−2=30>0P(C_5,3)=2^5-2=30>0. More dramatically, the Grötzsch graph is triangle-free with χ=4\chi=4, and Mycielski's iteration produces triangle-free graphs of every chromatic number. Absence of triangles bounds neither χ\chi from above nor near 2.

Connections

connection

Graph coloring threads through much of discrete mathematics:

  • <span class="wiki-link-missing">Bipartite Graphs</span>: exactly the 2-colorable graphs; equivalently, graphs with no odd cycle (König's characterization).
  • <span class="wiki-link-missing">Chromatic Number and Independent Sets</span>: a color class is an independent set, so a kk-coloring is a partition of VV into kk independent sets. Thus χ(G)\chi(G) is the minimum number of independent sets covering VV.
  • <span class="wiki-link-missing">The Tutte Polynomial</span>: P(G,k)P(G,k) is a specialization P(G,k)=(−1)n−ckc T(G;1−k,0)P(G,k)=(-1)^{n-c}k^{c}\,T(G;1-k,0) of the two-variable Tutte polynomial, linking coloring to flows and the structure of matroids.
  • <span class="wiki-link-missing">Planar Graphs and the Four Color Theorem</span>: every planar graph is 4-colorable, the celebrated and computer-aided result.
  • <span class="wiki-link-missing">Computational Complexity and NP-Completeness</span>: deciding whether χ(G)≤3\chi(G)\le 3 is NP-complete, placing exact coloring among the hardest tractable-to-state problems.
  • <span class="wiki-link-missing">Edge Coloring and Vizing&#39;s Theorem</span>: the dual notion coloring edges so no two sharing a vertex match; χ′(G)∈{Δ,Δ+1}\chi'(G)\in\{\Delta,\Delta+1\}.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1852 — Francis Guthrie poses the Four Color Conjecture while coloring a map of England's counties; passed via De Morgan to the mathematical community.
- 1879 — Alfred Kempe publishes a "proof" of the Four Color Theorem using "Kempe chains"; widely accepted for a decade.
- 1890 — Percy Heawood finds the flaw in Kempe's argument but salvages it to prove the Five Color Theorem and establishes the Heawood bound for higher-genus surfaces.
- 1912 — G. D. Birkhoff introduces the chromatic polynomial P(G,k)P(G,k), hoping to prove the Four Color Theorem by showing P(G,4)>0P(G,4)>0 for planar graphs.
- 1932 — Hassler Whitney develops broken-circuit theory, giving combinatorial meaning to the coefficients of P(G,k)P(G,k) via subgraph counts.
- 1941 — R. L. Brooks proves Brooks' Theorem: χ(G)≤Δ(G)+1\chi(G)\le\Delta(G)+1, with equality only for cliques and odd cycles.
- 1955 — Jan Mycielski constructs triangle-free graphs with arbitrarily large chromatic number, shattering naive clique-based intuition.
- 1968 — Tutte (and earlier Whitney) clarify the connection between chromatic and flow polynomials, unified by the Tutte polynomial.
- 1976 — Kenneth Appel and Wolfgang Haken prove the Four Color Theorem with extensive computer assistance — the first major theorem to rely on a computer.

Subtleties & Limits

open-problem

Where can the roots of P(G,k)P(G,k) live? The real and complex zeros of chromatic polynomials ("chromatic roots") are far from understood. Key facts and open questions:

  • No chromatic root lies in the intervals (−∞,0)(-\infty,0), (0,1)(0,1), or (1,32/27](1,32/27] — proven by Jackson and Thomassen for connected graphs.
  • It is a theorem (Tutte) that P(G,k)P(G,k) has no roots in (1,32/27](1,32/27], but the distribution of complex roots is largely conjectural; they are dense in the complex plane for general graphs (Sokal, 2004).
  • Birkhoff–Lewis conjecture: for planar graphs, P(G,k)>0P(G,k)>0 for all real k≥5k\ge 5 (known for k=5k=5 and large kk, open in between historically; resolved positively in key cases but the full real-line behavior remains delicate).
  • Hadwiger's Conjecture (1943), among the deepest open problems in the field, asserts every graph with χ(G)≥t\chi(G)\ge t contains KtK_t as a minor — proven for t≤6t\le 6, open for t≥7t\ge 7.
  • Computational reality: evaluating P(G,k)P(G,k) exactly is #P-hard, and even deciding χ(G)≤3\chi(G)\le 3 is NP-complete, so the elegant theory coexists with intrinsic computational intractability.

See Also

Bipartite Graphs · Chromatic Number and Independent Sets · The Tutte Polynomial · Planar Graphs and the Four Color Theorem · Brooks' Theorem · List Coloring and Choosability · Edge Coloring and Vizing's Theorem · Hadwiger's Conjecture · Computational Complexity and NP-Completeness