Algorithm Search⌘K

Proofs: Lawler's chromatic number algorithm

These are the human proofs of Lawler's chromatic number algorithm, at full length.

Lawler's dynamic program computes the chromatic number of every induced subgraph full

This proof shows: correctness, termination.

Let G=(V,E)G = (V, E) be a finite simple graph. For S⊆VS \subseteq V write G[S]G[S] for the induced subgraph and χ(S)=χ(G[S])\chi(S) = \chi(G[S]), with χ(∅)=0\chi(\emptyset) = 0. Identify each subset with its bitmask, so that a proper subset T⊊ST \subsetneq S has a smaller bitmask than SS.

Termination. Line L2 visits the 2n−12^n - 1 nonempty subsets once each. For each SS, line L4 runs over the finite family of maximal independent sets of G[S]G[S], and this family is not empty when S≠∅S \ne \emptyset, since any single vertex of SS extends greedily to a maximal independent set. So the algorithm stops, and X[S]X[S] is finite after the turn of SS.

Order of evaluation. If S≠∅S \ne \emptyset and II is a maximal independent set of G[S]G[S], then I≠∅I \ne \emptyset, so S∖IS \setminus I is a proper subset of SS. Its bitmask is smaller, so its turn in line L2 came earlier (or it is ∅\emptyset, set in line L1). Hence line L5 reads only final values.

Claim. After the turn of SS, X[S]=χ(S)X[S] = \chi(S).

Proof. By strong induction on the bitmask of SS. For S=∅S = \emptyset, line L1 sets X[∅]=0=χ(∅)X[\emptyset] = 0 = \chi(\emptyset). Let S≠∅S \ne \emptyset and assume the claim for all smaller bitmasks, in particular for all proper subsets of SS. After the loop of lines L4 and L5,

X[S]=1+min⁡{ χ(S∖I):I a maximal independent set of G[S] }.X[S] = 1 + \min \{\, \chi(S \setminus I) : I \text{ a maximal independent set of } G[S] \,\}.

Upper bound on χ(S)\chi(S). Fix a maximal independent set II of G[S]G[S] and a proper coloring of G[S∖I]G[S \setminus I] with χ(S∖I)\chi(S \setminus I) colors. Give every vertex of II one new color. No edge joins two vertices of II, since II is independent, and an edge between II and S∖IS \setminus I has ends of different colors because the color of II is new. So G[S]G[S] has a proper coloring with χ(S∖I)+1\chi(S \setminus I) + 1 colors, and χ(S)≤X[S]\chi(S) \le X[S].

Lower bound on χ(S)\chi(S). Let k=χ(S)≥1k = \chi(S) \ge 1 and fix a proper coloring of G[S]G[S] with classes C1,…,CkC_1, \ldots, C_k; we may take C1≠∅C_1 \ne \emptyset. The class C1C_1 is independent in G[S]G[S]. Add vertices of SS to it one at a time, each time a vertex with no neighbor in the current set, until no such vertex is left. The result I⊇C1I \supseteq C_1 is a maximal independent set of G[S]G[S]. The sets C2∖I,…,Ck∖IC_2 \setminus I, \ldots, C_k \setminus I are independent and cover S∖IS \setminus I, because S∖I⊆S∖C1=C2∪⋯∪CkS \setminus I \subseteq S \setminus C_1 = C_2 \cup \cdots \cup C_k. So χ(S∖I)≤k−1\chi(S \setminus I) \le k - 1, and the term of II in the minimum gives X[S]≤1+(k−1)=χ(S)X[S] \le 1 + (k - 1) = \chi(S).

The two bounds give X[S]=χ(S)X[S] = \chi(S), which proves the claim. □\square

Output. Line L6 returns X[V]=χ(G)X[V] = \chi(G). For the coloring, the implementation stores at each SS the set II that gave the minimum. Following these choices from VV gives sets I1,I2,…I_1, I_2, \ldots with S0=VS_0 = V, Sj=Sj−1∖IjS_j = S_{j-1} \setminus I_j and X[Sj]=X[Sj−1]−1X[S_j] = X[S_{j-1}] - 1, so the chain reaches ∅\emptyset after exactly X[V]X[V] steps. Each IjI_j is independent and the IjI_j partition VV, so giving color jj to IjI_j is a proper coloring with χ(G)\chi(G) colors. ∎

Back to Lawler's chromatic number algorithm