Algorithm Search⌘K

Proofs: Branch and reduce

These are the human proofs of Branch and reduce, at full length.

Branch and reduce returns a maximum independent set full

This proof shows: correctness, termination.

We use the pseudocode of the page. For a graph HH, α(H)\alpha(H) is the largest size of an independent set of HH. A pair (H,I)(H, I) is valid if HH is an induced subgraph of GG, II is independent in GG, and no vertex of II is in HH or adjacent to a vertex of HH. Then I∪JI \cup J is independent in GG for every independent set JJ of HH. Define the value of a valid pair as val(H,I)=∣I∣+α(H)\mathrm{val}(H, I) = |I| + \alpha(H).

Lemma 1 (reductions). Each of lines L5, L6 and L7 turns a valid pair into a valid pair with the same value.

Proof. Line L5: vv has no neighbor in HH. The new pair is valid, and α(H)=α(H−v)+1\alpha(H) = \alpha(H - v) + 1, since a maximum independent set of H−vH - v plus vv is independent, and an independent set of HH minus vv is one of H−vH - v.

Line L6: vv has one neighbor uu. The new pair (H−N[v],I∪{v})(H - N[v], I \cup \{v\}) is valid, as the only neighbor of vv in HH is deleted. Let JJ be a maximum independent set of HH. If u∈Ju \in J, then J−u+vJ - u + v is independent, since vv has no other neighbor, and has the same size. If JJ has neither, J+vJ + v is independent, a contradiction with maximality. So some maximum JJ contains vv and not uu, and J−vJ - v is independent in H−N[v]H - N[v]. Hence α(H−N[v])≥α(H)−1\alpha(H - N[v]) \ge \alpha(H) - 1, and the other inequality holds as any independent set of H−N[v]H - N[v] plus vv is independent in HH.

Line L7: uvuv is an edge and N[v]⊆N[u]N[v] \subseteq N[u]. Clearly α(H−u)≤α(H)\alpha(H - u) \le \alpha(H). Let JJ be a maximum independent set of HH with u∈Ju \in J. Then J∩N[u]={u}J \cap N[u] = \{u\}, so JJ has no vertex of N[v]−{u}⊆N[u]−{u}N[v] - \{u\} \subseteq N[u] - \{u\}, and J−u+vJ - u + v is independent in H−uH - u with the same size. So α(H−u)=α(H)\alpha(H - u) = \alpha(H). Validity is kept as only uu is deleted. □\square

Lemma 2 (leaves). At line L9, every vertex of HH has degree exactly 2, HH is a disjoint union of cycles, and the set added at line L9 is an independent set of HH of size α(H)\alpha(H).

Proof. The loop of line L4 ends only when lines L5 and L6 do not apply, so no vertex has degree 0 or 1, and line L8 gives degree at most 2. A graph with all degrees 2 is a disjoint union of cycles. In a cycle c0,…,ck−1c_0, \ldots, c_{k-1}, the vertices c0,c2,…,c2(⌊k/2⌋−1)c_0, c_2, \ldots, c_{2(\lfloor k/2 \rfloor - 1)} are pairwise non-adjacent, since the largest index is at most k−2k - 2 and, when kk is odd, at most k−3k - 3, so it is not adjacent to c0c_0. Each vertex of a cycle lies on two of its kk edges, and each edge has at most one end in an independent set JJ, so 2∣J∣≤k2 |J| \le k and ∣J∣≤⌊k/2⌋|J| \le \lfloor k/2 \rfloor. □\square

Lemma 3 (branching). At lines L11 and L12, both children are valid, and val(H,I)=max⁡(val(H−v,I),val(H−N[v],I∪{v}))\mathrm{val}(H, I) = \max(\mathrm{val}(H - v, I), \mathrm{val}(H - N[v], I \cup \{v\})).

Proof. Both children are valid, as in Lemma 1. A maximum independent set JJ of HH either does not contain vv, so it is one of H−vH - v, or contains vv and none of N(v)N(v), so J−vJ - v is one of H−N[v]H - N[v]. Conversely, an independent set of H−vH - v, or one of H−N[v]H - N[v] plus vv, is independent in HH. □\square

Claim 4 (invariant). At the start of each iteration of line L2, max⁡(∣best∣,max⁡(H,I)∈Qval(H,I))=α(G)\max(|best|, \max_{(H, I) \in Q} \mathrm{val}(H, I)) = \alpha(G), every pair on the stack is valid, and bestbest is independent in GG.

Proof. At the start, QQ holds (G,∅)(G, \emptyset) with value α(G)\alpha(G), and best=∅best = \emptyset. In an iteration, the popped pair keeps its value through line L4 by Lemma 1. If it is a leaf, Lemma 2 makes II an independent set of GG of size val(H,I)\mathrm{val}(H, I), and line L9 keeps the larger of it and bestbest. Otherwise, by Lemma 3, the value of the popped pair is the larger of the values of the two pushed pairs. In both cases the maximum is unchanged. It is never above α(G)\alpha(G) since every value is the size of an independent set of GG. □\square

Claim 5 (termination). Each pushed child has fewer vertices than its parent, as line L11 deletes vv and line L12 deletes N[v]∋vN[v] \ni v, and each reduction deletes at least one vertex. So the stack holds at most n+1n + 1 pairs at any time, every path of the tree has at most nn branches, and the loop ends. □\square

Theorem. BRANCH-AND-REDUCE-MIS(G)(G) returns a maximum independent set of GG.

Proof. By Claim 5 the loop ends with QQ empty. Claim 4 then gives ∣best∣=α(G)|best| = \alpha(G), and bestbest is independent in GG. ■\blacksquare

Back to Branch and reduce