Introduction

Colouring a graph means giving each vertex a colour so that adjacent vertices get different colours. Colours stand for resources and edges for conflicts: exam slots for courses that share students, frequencies for nearby transmitters, machine registers for variables that are live at the same time (register allocation in a compiler, see Liveness Analysis). The minimum number of colours needed is the chromatic number. Computing it is NP-hard in general, so the development concentrates on exact values for structured graphs, on bounds, and on counting colourings.

Prerequisites

  • Graph Theory Fundamentals: special graphs, bipartite graphs, planar graphs, degrees. Graphs are simple and undirected; a graph with a loop cannot be properly coloured.

Core concepts

Proper colouring and chromatic number

A proper kk-colouring of GG is a function c:V→{1,…,k}c : V \to \{1, \ldots, k\} with c(u)≠c(v)c(u) \ne c(v) for every edge {u,v}\{u, v\}. GG is kk-colourable if one exists. The chromatic number χ(G)\chi(G) is the least such kk.

Each colour class is an independent set, so a kk-colouring partitions VV into at most kk independent sets, one for each colour actually used.

Chromatic numbers of standard graphs

Graphχ\chi
Graph with no edges (n≥1n \ge 1)1
Any bipartite graph with at least one edge (trees, even cycles, Kr,sK_{r,s}, QkQ_k)2
Cycle CnC_n2 if nn even, 3 if nn odd
Complete graph KnK_nnn
Wheel WnW_n (hub + CnC_n)3 if nn even, 4 if nn odd
Petersen graph3
Any planar graphat most 4

Characterisation of χ≤2\chi \le 2: χ(G)≤2\chi(G) \le 2 if and only if GG is bipartite, if and only if GG has no odd cycle. There is no comparable simple test for χ≤3\chi \le 3; deciding 3-colourability is NP-complete.

Colourings of cycles, wheels, bipartite and planar graphs
Figure 1. Optimal colourings of C6C_6 (2 colours), C5C_5 (3), W5W_5 (4), K3,3K_{3,3} (2) and a planar graph needing 4 colours (K4K_4), with colours written as numbers on the vertices.

Bounds

Let ω(G)\omega(G) be the size of a largest clique (complete subgraph), α(G)\alpha(G) the size of a largest independent set and Δ(G)\Delta(G) the maximum degree.

max⁡ ⁣(ω(G), ⌈nα(G)⌉)  ≤  χ(G)  ≤  Δ(G)+1.\max\!\left(\omega(G),\ \left\lceil \frac{n}{\alpha(G)} \right\rceil\right) \;\le\; \chi(G) \;\le\; \Delta(G) + 1 .
  • Lower bounds. A clique of size ω\omega needs ω\omega colours. Each colour class has at most α\alpha vertices, so χ⋅α≥n\chi \cdot \alpha \ge n.
  • Upper bound by greedy colouring. Colour vertices in any order, giving each the smallest colour not used by its already-coloured neighbours. A vertex has at most Δ\Delta neighbours, so at most Δ+1\Delta + 1 colours are used.
  • Brooks' theorem. If GG is connected and is neither a complete graph nor an odd cycle, then χ(G)≤Δ(G)\chi(G) \le \Delta(G). The two exceptions are exactly where Δ+1\Delta + 1 is needed.
  • χ\chi can be much larger than ω\omega: there are triangle-free graphs (ω=2\omega = 2) with arbitrarily large chromatic number (Mycielski's construction; the Grotzsch graph has ω=2\omega = 2, χ=4\chi = 4).
  • Greedy depends on the order. On a bipartite graph a bad order can force many colours. For the "crown" graph (Kk,kK_{k,k} minus a perfect matching, k≥2k\ge2) with vertices taken in the order a1,b1,a2,b2,…a_1, b_1, a_2, b_2, \ldots, greedy uses kk colours although χ=2\chi = 2.

Planar graphs

  • Four colour theorem (Appel and Haken, 1976): every planar graph satisfies χ≤4\chi \le 4. The proof is computer-assisted.
  • The five colour theorem has a short proof using the fact that a planar graph has a vertex of degree at most 5.
  • The bound 4 is tight (K4K_4 is planar). Colouring the regions of a map so that neighbouring regions differ is the same as colouring the vertices of its dual graph, which is planar.

The chromatic polynomial

P(G,k)P(G, k) is the number of proper colourings of GG using colours from a set of kk colours (colourings that differ only by which colour goes where count as different). Then χ(G)\chi(G) is the least positive integer kk with P(G,k)>0P(G, k) > 0.

GraphP(G,k)P(G, k)
nn isolated verticesknk^n
KnK_nk(k−1)(k−2)⋯(k−n+1)k(k-1)(k-2)\cdots(k-n+1)
Any tree on nn verticesk(k−1)n−1k(k-1)^{n-1}
Cycle CnC_n(k−1)n+(−1)n(k−1)(k-1)^n + (-1)^n (k-1)
Disjoint union G1∪G2G_1 \cup G_2P(G1,k) P(G2,k)P(G_1, k)\, P(G_2, k)

Deletion-contraction: for any edge ee,

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 ee and G/eG / e merges its endpoints (removing duplicate edges). The colourings of G−eG - e split into those that give the ends of ee different colours (the colourings of GG) and those that give them the same colour (the colourings of G/eG / e).

Properties: P(G,k)P(G, k) is a polynomial in kk of degree nn, with leading coefficient 1; the coefficient of kn−1k^{n-1} is −m-m; the constant term is 0.

Edge colouring

A proper edge colouring gives adjacent edges (sharing an endpoint) different colours; each colour class is a matching. The chromatic index χ′(G)\chi'(G) is the least number of colours.

  • χ′(G)≥Δ(G)\chi'(G) \ge \Delta(G) always.
  • Vizing's theorem: χ′(G)=Δ\chi'(G) = \Delta or Δ+1\Delta + 1 for every simple graph.
  • Konig's edge-colouring theorem: for bipartite graphs, χ′(G)=Δ(G)\chi'(G) = \Delta(G).
  • χ′(K1)=0\chi'(K_1)=0; for n≥2n\ge2, χ′(Kn)=n−1\chi'(K_n) = n - 1 if nn is even and nn if nn is odd. (Round-robin tournaments: with nn even, n−1n - 1 rounds suffice.)
  • χ′(Cn)=2\chi'(C_n) = 2 for even nn and 3 for odd nn. The Petersen graph has χ′=4\chi' = 4 although Δ=3\Delta = 3.

See Matching in Graphs for matchings.

Worked examples

Example 1: chromatic number by bounds

GG = C5C_5 with one chord added (vertices 1 to 5 in a cycle, chord {1,3}\{1, 3\}). It contains the triangle 1, 2, 3, so χ≥3\chi \ge 3. A 3-colouring: c(1)=1,c(2)=2,c(3)=3,c(4)=1,c(5)=2c(1) = 1, c(2) = 2, c(3) = 3, c(4) = 1, c(5) = 2. Hence χ=3\chi = 3.

Example 2: chromatic polynomials

  • P(K3,k)=k(k−1)(k−2)P(K_3, k) = k(k-1)(k-2). With 3 colours: 3⋅2⋅1=63 \cdot 2 \cdot 1 = 6 colourings.
  • P(C4,k)=(k−1)4+(k−1)P(C_4, k) = (k-1)^4 + (k-1). With 3 colours: 16+2=1816 + 2 = 18. With 2 colours: 1+1=21 + 1 = 2.
  • A path on 4 vertices (a tree): P=k(k−1)3P = k(k-1)^3. With 3 colours: 3⋅8=243 \cdot 8 = 24.
  • C5C_5 with 3 colours: 25−2=302^5 - 2 = 30; with 2 colours: 1−1=01 - 1 = 0, confirming χ(C5)=3\chi(C_5) = 3.

Example 3: deletion-contraction on C4C_4

Delete an edge of C4C_4: a path P4P_4 with k(k−1)3k(k-1)^3 colourings. Contract it: K3K_3 (the triangle C3C_3), with k(k−1)(k−2)k(k-1)(k-2). So

P(C4,k)=k(k−1)3−k(k−1)(k−2)=k(k−1)(k2−3k+3),P(C_4, k) = k(k-1)^3 - k(k-1)(k-2) = k(k-1)(k^2 - 3k + 3),

which equals (k−1)4+(k−1)(k-1)^4 + (k-1) on expanding.

Example 4: exam scheduling

Five courses; pairs sharing a student: AB, AC, BC, CD, DE, EA. The conflict graph contains the triangle A, B, C, so at least 3 slots. Slots: A = 1, B = 2, C = 3, D = 1, E = 2. Check: CD (3, 1), DE (1, 2), EA (2, 1) are all different. Minimum: 3 slots.

Important properties and observations

  • χ(G)≤1+\chi(G) \le 1 + the length of a longest path (a greedy argument along a DFS tree).
  • χ(G)+χ(G‾)≤n+1\chi(G) + \chi(\overline{G}) \le n + 1.
  • Removing a vertex lowers χ\chi by at most 1. Adding an edge raises it by at most 1.
  • A graph with mm edges has χ(χ−1)/2≤m\chi(\chi - 1)/2 \le m (every two colour classes must be joined by an edge in an optimal colouring).
  • Counting colourings with "exactly kk colours used" is different from P(G,k)P(G, k), which counts colourings from kk available colours.

GATE examination perspective

  • Chromatic number of a given graph. Find a clique for the lower bound, then exhibit a colouring that matches it. Check odd cycles for χ≥3\chi \ge 3.
  • Special families. CnC_n, WnW_n, KnK_n, Kr,sK_{r,s}, trees, planar graphs. Watch which wheel convention is used (hub + CnC_n here).
  • Chromatic polynomial evaluation. Trees, cycles and complete graphs by formula; others by deletion-contraction.
  • Bounds statements. ω≤χ≤Δ+1\omega \le \chi \le \Delta + 1; Brooks; χα≥n\chi \alpha \ge n.
  • Trap: χ=ω\chi = \omega is not true in general (C5C_5: ω=2\omega = 2, χ=3\chi = 3).
  • Trap: the four colour theorem is about planar graphs only; K5K_5 needs 5 colours.

Summary

Sources

  1. K. H. Rosen, Discrete Mathematics and Its Applications, 7th ed., McGraw-Hill, 2012: Section 10.8 (Graph Coloring).
  2. D. B. West, Introduction to Graph Theory, 2nd ed., Prentice Hall, 2001: Sections 5.1 (Vertex Colorings and Upper Bounds), 5.3 (Enumerative Aspects) and 7.1 (Line Graphs and Edge-coloring).

Next steps