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. is a finite rooted tree. Some nodes are leaves, the feasible solutions, and gives each leaf a value; an inner node with no children is a dead end. The bound satisfies for each node and each leaf in the subtree of , which we write . Let , with if has no leaf. In each node has the key .
Claim 1 (the incumbent is real). At each point, either and , or is a leaf and . In particular . Proof. Only line L7 changes and , and it sets them to and for a leaf .
Claim 2 (invariant). At the start of each iteration of line L3, every leaf with satisfies for some node in .
Proof. At the start . Suppose the claim holds at the start of an iteration that does not stop at line L5. Let and be the values of at the start and at the end of the iteration, so , and let be the node taken at line L4. Let be a leaf with . Then , so for a node that was in . If , then is still in . If and is a leaf, then and line L7 gives , which is false. If is an inner node, then for a child of ; if line L10 inserts , it is in , and if not, , which is false.
Claim 3 (termination). Each node joins 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 times.
Theorem 1. The algorithm returns , where is a leaf with , or when has no leaf.
Proof. By Claim 3 the loop ends, either because is empty or by the break at line L5. If is empty, Claim 2 says no leaf has . If line L5 breaks with node , then had the largest key, so every node of and itself has , and so every leaf has ; by Claim 2, applied at the start of this iteration, no leaf has . In both cases , and with Claim 1, . If has a leaf, , so is a leaf of value . If not, line L7 never runs and .
Theorem 2. Every node that the algorithm expands has .
Proof. When is expanded, line L5 did not break, so . If , then . If , then an optimal leaf has , so by Claim 2 for a node that was in when was taken; had the largest key, so .
Theorem 3. Call critical if every node on the path from the root to , including , has . Any search that starts with only the root live, keeps equal to the value of a leaf or , makes live each child of an expanded node with , and removes a live inner node only by expanding it or when , expands every critical inner node, provided it runs until no live node remains or until all live nodes have .
Proof. By induction on depth, every critical node becomes live. The root is live at the start. If a critical node is live, then at all times, so the search cannot stop while is live and cannot remove by its bound; if is an inner node, it is expanded, and each critical child has and becomes live.