Take max 5x₁ + 4x₂ subject to 6x₁ + 4x₂ ≤ 25 machine hours and 3x₁ + 5x₂ ≤ 22 inspection hours. The relaxation stops at (37/18, 19/6), worth 413/18, which is about 22.94 and is not a plan. Both coordinates are fractional, so there are two variables to choose between and the method works either way.
Definition · Branching on a fractional variableIf the relaxation of a node returns x_k = v with v not an integer, the node is replaced by two children: the same problem with x_k ≤ ⌊v⌋ added, and the same problem with x_k ≥ ⌈v⌉ added. The node itself is not solved again.
Theorem · Branching loses no whole-number planEvery integer point feasible for the parent is feasible for exactly one of the two children, and the parent's fractional optimum is feasible for neither.
Let x be feasible for the parent with x_k an integer. Then either x_k ≤ ⌊v⌋ or x_k ≥ ⌊v⌋ + 1 = ⌈v⌉, because there is no integer strictly between ⌊v⌋ and ⌈v⌉ when v is not an integer. So x satisfies one of the two added rows and every other row unchanged.
The parent's optimum has x_k = v with ⌊v⌋ < v < ⌈v⌉, so it satisfies neither added row. Hence the union of the children contains every whole-number plan of the parent and the two bounds are computed on strictly smaller regions.
□
That is the whole correctness argument, and it is why the children are inequalities. Fixing x₁ = 2 in one child and x₁ = 3 in the other would lose every plan with x₁ = 0 or x₁ = 4, and the search would return a confident wrong answer.
Three reasons to close a node, and no others
- Infeasible. The added rows have emptied the region. There is nothing in it, so there is nothing to find.
- Bounded out. The node's bound is no better than the best whole plan already in hand. Nothing inside beats the bound, so nothing inside beats the plan you have.
- Integral. The relaxation came back whole. It is feasible and it attains the node's bound, so it is the best plan in that node — and if it beats the plan in hand it becomes the new one.
Example · The five-node tree on this instanceBranch on x₁ at 37/18. Child x₁ ≤ 2 bounds at 114/5 and stops at (2, 16/5), still fractional; child x₁ ≥ 3 bounds at 22 and stops at (3, 7/4). Split the first on x₂ at 16/5: x₂ ≤ 3 comes back at (2, 3), whole, worth 22, and becomes the plan in hand; x₂ ≥ 4 bounds at 58/3, about 19.33, which cannot beat 22, so it closes. Now x₁ ≥ 3 bounds at exactly 22 and cannot beat 22 either, so it closes too. Five nodes, no open nodes, answer 22 at (2, 3).
Read the last two closures again, because they are the method. Neither node was explored and neither needed to be: a bound of 58/3 is a promise that nothing inside is worth more than 58/3, and 22 is already in hand. The tree did not decide those subtrees were unpromising; it proved there was nothing in them.
The search tree itself — explore, keep the best so far, prune any branch whose optimistic bound cannot beat it, and accept that the bound's quality is the whole algorithm — belongs to the Algorithms path's “Backtracking and Branch-and-Bound”, which works it on a six-item knapsack with the fractional bound. What is this course's own is that the bound here is a linear programme, and that each child is re-solved from its parent's final tableau by the dual simplex rather than from scratch.
One reconciliation worth stating once: on a binary variable the two branching schemes are the same tree. “Include the item” and “exclude the item” are x ≥ 1 and x ≤ 0, which is exactly x ≥ ⌈v⌉ and x ≤ ⌊v⌋ for any v strictly between 0 and 1. The knapsack tree of that lesson and the tree here are one method described in two vocabularies.
None of this is a complexity result. Pruning removes subtrees that have been proved empty of better plans, and on a bad instance it removes none of them: the worst case is still exponential, and that fact is Algorithms’. The practical consequence is visible in the lab, where the order the nodes are taken in changes the work and never the answer — depth first closes this instance in five nodes and best bound takes seven, which is the opposite of the usual expectation and is what measuring is for.