Algorithm Search⌘K

Proofs: Best-first branch and bound

These are the human proofs of Best-first branch and bound, at full length.

Best-first branch and bound returns an optimal leaf and expands only nodes with bound at least the optimum full

This proof shows: correctness, termination, optimality.

We use the pseudocode of the page. TT is a finite rooted tree. Some nodes are leaves, the feasible solutions, and ff gives each leaf a value; an inner node with no children is a dead end. The bound satisfies ub(N)≥f(x)ub(N) \ge f(x) for each node NN and each leaf xx in the subtree of NN, which we write x⪯Nx \preceq N. Let z∗=max⁡{f(x):x a leaf of T}z^* = \max \{ f(x) : x \text{ a leaf of } T \}, with z∗=−∞z^* = -\infty if TT has no leaf. In HH each node NN has the key ub(N)ub(N).

Claim 1 (the incumbent is real). At each point, either z=−∞z = -\infty and best=NILbest = \text{NIL}, or bestbest is a leaf and z=f(best)z = f(best). In particular z≤z∗z \le z^*. Proof. Only line L7 changes zz and bestbest, and it sets them to f(N)f(N) and NN for a leaf NN. □\square

Claim 2 (invariant). At the start of each iteration of line L3, every leaf xx with f(x)>zf(x) > z satisfies x⪯Mx \preceq M for some node MM in HH.

Proof. At the start H={root}H = \{root\}. Suppose the claim holds at the start of an iteration that does not stop at line L5. Let z0z_0 and z1z_1 be the values of zz at the start and at the end of the iteration, so z0≤z1z_0 \le z_1, and let NN be the node taken at line L4. Let xx be a leaf with f(x)>z1f(x) > z_1. Then f(x)>z0f(x) > z_0, so x⪯Mx \preceq M for a node MM that was in HH. If M≠NM \ne N, then MM is still in HH. If M=NM = N and NN is a leaf, then x=Nx = N and line L7 gives z1≥f(x)z_1 \ge f(x), which is false. If M=NM = N is an inner node, then x⪯Cx \preceq C for a child CC of NN; if line L10 inserts CC, it is in HH, and if not, f(x)≤ub(C)≤z0f(x) \le ub(C) \le z_0, which is false. □\square

Claim 3 (termination). Each node joins HH at most once: the root at line L2, and any other node only at line L10 while its parent is expanded, which happens at most once by induction on depth. So the loop runs at most ∣T∣|T| times. □\square

Theorem 1. The algorithm returns (z∗,best)(z^*, best), where bestbest is a leaf with f(best)=z∗f(best) = z^*, or best=NILbest = \text{NIL} when TT has no leaf.

Proof. By Claim 3 the loop ends, either because HH is empty or by the break at line L5. If HH is empty, Claim 2 says no leaf has f(x)>zf(x) > z. If line L5 breaks with node NN, then NN had the largest key, so every node MM of HH and NN itself has ub(M)≤ub(N)≤zub(M) \le ub(N) \le z, and so every leaf x⪯Mx \preceq M has f(x)≤zf(x) \le z; by Claim 2, applied at the start of this iteration, no leaf has f(x)>zf(x) > z. In both cases z≥z∗z \ge z^*, and with Claim 1, z=z∗z = z^*. If TT has a leaf, z∗>−∞z^* > -\infty, so bestbest is a leaf of value z∗z^*. If not, line L7 never runs and best=NILbest = \text{NIL}. □\square

Theorem 2. Every node NN that the algorithm expands has ub(N)≥z∗ub(N) \ge z^*.

Proof. When NN is expanded, line L5 did not break, so ub(N)>zub(N) > z. If z=z∗z = z^*, then ub(N)>z∗ub(N) > z^*. If z<z∗z < z^*, then an optimal leaf x∗x^* has f(x∗)>zf(x^*) > z, so by Claim 2 x∗⪯Mx^* \preceq M for a node MM that was in HH when NN was taken; NN had the largest key, so ub(N)≥ub(M)≥f(x∗)=z∗ub(N) \ge ub(M) \ge f(x^*) = z^*. □\square

Theorem 3. Call NN critical if every node on the path from the root to NN, including NN, has ub>z∗ub > z^*. Any search that starts with only the root live, keeps zz equal to the value of a leaf or −∞-\infty, makes live each child CC of an expanded node with ub(C)>zub(C) > z, and removes a live inner node only by expanding it or when ub(N)≤zub(N) \le z, expands every critical inner node, provided it runs until no live node remains or until all live nodes have ub≤zub \le z.

Proof. By induction on depth, every critical node becomes live. The root is live at the start. If a critical node NN is live, then ub(N)>z∗≥zub(N) > z^* \ge z at all times, so the search cannot stop while NN is live and cannot remove NN by its bound; if NN is an inner node, it is expanded, and each critical child CC has ub(C)>z∗≥zub(C) > z^* \ge z and becomes live. ■\blacksquare

Back to Best-first branch and bound