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 , is the largest size of an independent set of . A pair is valid if is an induced subgraph of , is independent in , and no vertex of is in or adjacent to a vertex of . Then is independent in for every independent set of . Define the value of a valid pair as .
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: has no neighbor in . The new pair is valid, and , since a maximum independent set of plus is independent, and an independent set of minus is one of .
Line L6: has one neighbor . The new pair is valid, as the only neighbor of in is deleted. Let be a maximum independent set of . If , then is independent, since has no other neighbor, and has the same size. If has neither, is independent, a contradiction with maximality. So some maximum contains and not , and is independent in . Hence , and the other inequality holds as any independent set of plus is independent in .
Line L7: is an edge and . Clearly . Let be a maximum independent set of with . Then , so has no vertex of , and is independent in with the same size. So . Validity is kept as only is deleted.
Lemma 2 (leaves). At line L9, every vertex of has degree exactly 2, is a disjoint union of cycles, and the set added at line L9 is an independent set of of size .
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 , the vertices are pairwise non-adjacent, since the largest index is at most and, when is odd, at most , so it is not adjacent to . Each vertex of a cycle lies on two of its edges, and each edge has at most one end in an independent set , so and .
Lemma 3 (branching). At lines L11 and L12, both children are valid, and .
Proof. Both children are valid, as in Lemma 1. A maximum independent set of either does not contain , so it is one of , or contains and none of , so is one of . Conversely, an independent set of , or one of plus , is independent in .
Claim 4 (invariant). At the start of each iteration of line L2, , every pair on the stack is valid, and is independent in .
Proof. At the start, holds with value , and . In an iteration, the popped pair keeps its value through line L4 by Lemma 1. If it is a leaf, Lemma 2 makes an independent set of of size , and line L9 keeps the larger of it and . 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 since every value is the size of an independent set of .
Claim 5 (termination). Each pushed child has fewer vertices than its parent, as line L11 deletes and line L12 deletes , and each reduction deletes at least one vertex. So the stack holds at most pairs at any time, every path of the tree has at most branches, and the loop ends.
Theorem. BRANCH-AND-REDUCE-MIS returns a maximum independent set of .
Proof. By Claim 5 the loop ends with empty. Claim 4 then gives , and is independent in .