Algorithm Search⌘K

Proofs: Breadth-first branch and bound

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

Breadth-first branch and bound returns an optimal leaf full

This proof shows: correctness, termination.

We use the pseudocode of the page. TT is a finite rooted tree, ff gives a value to each leaf, and ubub 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. Here a leaf is a node that the test of line L6 marks as a complete solution; an inner node can also have no children, and it is then a dead end, not a leaf. 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.

Claim 1 (the incumbent is real). At each point of the run, either z=−∞z = -\infty and best=NILbest = \text{NIL}, or bestbest is a leaf of TT and z=f(best)z = f(best). Proof. This holds after line L1. 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 (z only grows). Line L7 changes zz only to a larger value. □\square

Claim 3 (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 QQ.

Proof. Before the first iteration, Q={root}Q = \{root\} and every leaf is below the root. Suppose the claim holds at the start of an iteration, let z0z_0 be the value of zz then, and let NN be the node removed at line L4. Let xx be a leaf with f(x)>z1f(x) > z_1, where z1≥z0z_1 \ge z_0 is the value of zz at the end of the iteration. Then f(x)>z0f(x) > z_0, so x⪯Mx \preceq M for a node MM that was in QQ. If M≠NM \ne N, then MM is still in QQ. Suppose M=NM = N, so x⪯Nx \preceq N.

  • If line L5 drops NN, then f(x)≤ub(N)≤z0≤z1f(x) \le ub(N) \le z_0 \le z_1, which is false.
  • If NN is a leaf, then x=Nx = N, and after line L7 we have z1≥f(N)=f(x)z_1 \ge f(N) = f(x), which is false.
  • Otherwise NN is an inner node and x⪯Cx \preceq C for a child CC of NN. If line L10 puts CC into QQ, then CC is in QQ at the end of the iteration. If it does not, then ub(C)≤z0ub(C) \le z_0, so f(x)≤ub(C)≤z0≤z1f(x) \le ub(C) \le z_0 \le z_1, which is false.

In each case the claim holds at the start of the next iteration. □\square

Claim 4 (termination). Each node of TT joins QQ at most once, so the loop runs at most ∣T∣|T| times. Proof. The root joins QQ once, at line L2. Any other node CC joins QQ only at line L10, while its parent NN is expanded, and by induction on depth NN is removed at most once, so it is expanded at most once. □\square

Theorem. BFBB stops and 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 4 the loop ends, and then QQ is empty. By Claim 3 no leaf xx has f(x)>zf(x) > z, so z≥z∗z \ge z^*. By Claim 1, either z=−∞≤z∗z = -\infty \le z^*, or z=f(best)≤z∗z = f(best) \le z^* for a leaf bestbest. So z=z∗z = z^*. If TT has a leaf, z∗>−∞z^* > -\infty, so bestbest is a leaf with f(best)=z∗f(best) = z^*. If TT has no leaf, line L7 never runs, so best=NILbest = \text{NIL}. ■\blacksquare

Back to Breadth-first branch and bound