Grow partial tours, compute a lower bound on the cheapest possible completion, and prune any partial tour that can't beat the best full tour found.
The travelling salesman problem (TSP) asks for the shortest tour that visits every city exactly once and returns to the start. Trying every order is (n − 1)! — astronomically large. Branch and bound tames it by growing partial tours city by city while keeping a lower bound on how cheaply each partial tour could possibly finish. The instant that optimistic estimate is no better than the best complete tour found, the branch is pruned.
Fix a start city (say A) to avoid counting the same cyclic tour n times. Each branch adds one more unvisited city to the current path, growing the search tree one level. A leaf is a full tour; its cost is the sum of edges plus the return edge to A.
Since TSP is a *minimisation*, the bound is a lower bound — a cost the branch can never go below. A classic estimate: for every city, add its two cheapest incident edges and divide the total by two. Every city in any tour uses exactly two edges (one in, one out), so this can never overestimate the true tour cost. As cities get committed to the path, the bound tightens.
≥ the best full tour you've found, then no completion of it can win. Cut the branch without extending it further.Four cities with symmetric distances: AB 10, AC 15, AD 20, BC 35, BD 25, CD 30. Compute the root lower bound from each city's two cheapest edges:
A: cheapest two = 10(B), 15(C) -> 25
B: cheapest two = 10(A), 25(D) -> 35
C: cheapest two = 15(A), 30(D) -> 45
D: cheapest two = 20(A), 25(B) -> 45
sum = 150, lower bound = 150 / 2 = 75
optimal tour: A - B - D - C - A
10 + 25 + 30 + 15 = 80The optimal tour costs 80, and the root lower bound of 75 sits just below it — exactly what a valid lower bound should do. During the search, any partial tour whose bound climbs to 80 or more (once an 80-cost tour is known) is pruned immediately, so most of the 3! = 6 orderings here are never fully expanded.