Branch and bound explores the tree of partial solutions of an optimisation problem, keeps the best complete solution found so far, and prunes a node when a bounding function shows that no completion of it can beat that solution. A continuous relaxation of a problem allows fractions where the problem requires whole choices; its optimum is at least the problem’s, and gives a bound.
figures/bb_tree.py). The first leaf reached, A and C, is the optimum; its value 65 then prunes both remaining branches. Counted as best counts them (a pruned node is visited, an item that does not fit is not tried), plain backtracking visits 20 nodes here and branch and bound 7.