Pack a knapsack of capacity 5 from 4 items, each taken whole or not at all, for the most value. The items are sorted by value per unit of weight, best first: A (2 for 3), B (3 for 4), C (4 for 5), D (5 for 6). Search take-or-skip, item by item, but before entering any branch compute an optimistic bound, the value you would get if the rest of the capacity could be filled with a fraction of the next item. A branch whose bound cannot beat the best complete answer so far is cut without being searched.
Branch and bound knapsack, 4 items, capacity 5.
Deciding item A with nothing taken, weight 0 of 5, value 0. Fill the remaining 5 optimistically, fractions allowed: the bound is 7. The best complete answer is 0. The bound is higher, so the branch might still win: explore it, taking A first.
Bound 7 against best 0: explore.
Deciding item B with A taken, weight 2 of 5, value 3, already better than anything complete so far. Fill the remaining 3 optimistically, fractions allowed: the bound is 7. The best complete answer is 3. The bound is higher, so the branch might still win: explore it, taking B first.
Bound 7 against best 3: explore.
Deciding item C with A, B taken, weight 5 of 5, value 7, already better than anything complete so far. Fill the remaining 0 optimistically, fractions allowed: the bound is 7. The best complete answer is 7. Even the optimistic bound cannot beat that, so this whole subtree is cut: 4 leaves never visited.
Bound 7 against best 7: prune.
Deciding item C with A taken, weight 2 of 5, value 3. Fill the remaining 3 optimistically, fractions allowed: the bound is 6.8. The best complete answer is 7. Even the optimistic bound cannot beat that, so this whole subtree is cut: 4 leaves never visited.
Bound 6.8 against best 7: prune.
Deciding item B with nothing taken, weight 0 of 5, value 0. Fill the remaining 5 optimistically, fractions allowed: the bound is 6.5. The best complete answer is 7. Even the optimistic bound cannot beat that, so this whole subtree is cut: 8 leaves never visited.
Bound 6.5 against best 7: prune.
Best value 7 with A, B (weight 5 of 5). The search visited 5 nodes and cut 3 subtrees, out of 31 nodes in the full take-or-skip tree. Two things made the cutting safe: the bound never underestimates, because allowing a fraction of an item can only raise the value, and the incumbent is a real, complete answer. Branch and bound is backtracking plus that one comparison, and it is how exact solvers for hard problems get anywhere at all.
Best value 7 with A, B.