The Balas additive algorithm returns an optimal 0-1 vector full
This proof shows: correctness, termination.
We use the pseudocode of the page. The problem is to minimize c⊤x over X={x∈{0,1}n:Ax≤b}, with c≥0. Let z∗=minx∈Xc⊤x, or ∞ if X=∅. For a node N=(O,v,s,F), let X(N) be the set of x∈{0,1}n with xj=1 for j∈O and xj=0 for j∈/O∪F. For such x, write U={j∈F:xj=1}; then c⊤x=v+∑j∈Ucj and b−Ax=s−∑j∈UAj.
Claim 1 (node data). For every node on the stack, v=∑j∈Ocj, s=b−∑j∈OAj, and O and F are disjoint. Proof. True for the root. Line L11 adds j∈F to O, adds cj to v, subtracts Aj from s, and removes j from F; line L10 removes j from F only. □
Claim 2 (children cover the parent). If N is split on j at lines L10 and L11 into N0 and N1, then X(N)=X(N0)∪X(N1). Proof. A vector in X(N) has xj=0, and lies in X(N0), or xj=1, and lies in X(N1). □
Claim 3 (a node that is not split loses nothing). Let N be popped at line L3 with the current value z. If the loop continues at line L6, then after line L5, every x∈X(N)∩X has c⊤x≥z. If the loop continues at line L8, then every x∈X(N)∩X has c⊤x≥z.
Proof. Line L6: s≥0, so the vector with U=∅ is in X and costs v. Line L5 makes z≤v, and every x∈X(N) has c⊤x=v+∑j∈Ucj≥v≥z since c≥0.
Line L8: suppose that x∈X(N)∩X has c⊤x<z. Every j∈U has v+cj≤c⊤x<z. Let I−={i:si<0}, which is not empty because line L4 failed. For i∈I−, feasibility gives si−∑j∈Uaij≥0, so si−∑j∈U,aij<0aij≥si−∑j∈Uaij≥0. Every j∈U with aij<0 for some i∈I− is in T. As si<0, some j∈U has aij<0, so T=∅; and ∑j∈Tmin(0,aij)≤∑j∈U,aij<0aij, so si−∑j∈Tmin(0,aij)≥0 for every i∈I−. Then the test of line L8 fails, a contradiction. □
Claim 4 (invariant). At the start of each iteration of line L2, every x∈X with c⊤x<z lies in X(N) for some node N on the stack, and z=∞ with best=NIL, or best gives a vector in X of cost z.
Proof. At the start, the root has X(root)={0,1}n. Suppose the claim holds at the start of an iteration that pops N, and let x∈X have c⊤x<z after the iteration. Since z never increases, c⊤x was below z at the start too, so x was in X(N′) for some N′ on the stack. If N′=N, then N′ is still there. If N′=N, Claim 3 rules out lines L6 and L8, so N was split, and by Claim 2, x is in a child, which is pushed. For the second part, line L5 sets best=O, whose vector, by Claim 1 and s≥0, is in X with cost v=z. □
Claim 5 (termination). Each child has ∣F∣ one less than its parent, so every path of the search tree has at most n splits, and the tree has at most 2n+1−1 nodes. Each node is pushed once and popped once, so the loop ends. □
Theorem. BALAS(c,A,b) returns z∗ and an optimal vector if X=∅, and (∞,NIL) otherwise.
Proof. By Claim 5 the loop ends with an empty stack. By Claim 4, no x∈X then has c⊤x<z, so z≤z∗; and z is ∞ or the cost of a vector in X, so z≥z∗. Hence z=z∗, and if z<∞, best gives an optimal vector. If X=∅, line L5 never runs, since s≥0 at line L4 means that the zero completion is in X; so best=NIL. ■