1. Gyanastra
  2. Algorithms
  3. Branch and Bound, Puzzles and Comparison of Design Paradigms
  4. Where this chapter sits
Free lesson, no account needed 4 min read

Algorithms · Branch and Bound, Puzzles and Comparison of Design Paradigms

Where this chapter sits

Backtracking (Chapter "Subset Sum and Traveling Salesman") explores the state-space tree and stops as soon as a partial solution cannot be completed. Branch and Bound (B&B) does the same tree exploration but adds a numerical bound: it computes, for every live node, the best value any completion of that node could possibly achieve, and kills the node when that bound cannot beat the best solution already found. B&B is therefore the tool for optimization problems (min/max), while backtracking is the tool for feasibility problems (find any/all solutions).


Definitions and vocabulary

TermMeaning
State-space treeTree whose root is the empty partial solution; children extend a partial solution by one decision.
Live nodeGenerated but not yet expanded.
E-node (expansion node)The live node currently being expanded.
Dead nodeKilled: (a) infeasible, (b) cannot beat the incumbent, or (c) fully explored.
IncumbentBest complete solution found so far; its value is the current best z∗z^*.
Bounding functionc^(x)\hat{c}(x) = optimistic value of the best completion of node xx.
Pruning / fathomingDiscarding a node because its bound is not better than z∗z^*.

2.1 Upper bound vs lower bound — the sign convention trap

There are two conventions in the literature and both appear in exams. Fix the language first:

  • Minimization problem (TSP, assignment): we keep a lower bound LB(x)LB(x) = smallest cost any completion of xx can have. Prune when LB(x)≥z∗(current best cost).LB(x) \ge z^* \quad(\text{current best cost}).
  • Maximization problem (0/1 knapsack): we keep an upper bound UB(x)UB(x) = largest profit any completion of xx can have. Prune when UB(x)≤z∗(current best profit).UB(x) \le z^* \quad(\text{current best profit}).

Horowitz–Sahni and most GATE questions use exactly this pairing: knapsack → upper bound (fractional relaxation), TSP/assignment → lower bound (reduced cost matrix). If a question says "lower bound" for a maximization problem, it means the bound on the remaining profit, i.e. UB=profit so far+bound on remainderUB = \text{profit so far} + \text{bound on remainder} — always write the bound as "value of the whole solution through this node", never as a bare remainder, and the sign confusion disappears.

2.2 The three search strategies

StrategyData structure for live nodesOrder of expansionMemoryNotes
FIFO (breadth-first)QueueLevel by levelLarge (whole frontier)Simple; no early good incumbent
LIFO (depth-first / D-search)StackDeepest firstO(depth)O(\text{depth})Same tree as backtracking; finds a leaf fast
LC (least cost / best-first)Min-heap on c^\hat{c}Node with best bound firstLargestFewest nodes expanded; needs good c^\hat{c}

LC search is the "intelligent" one: it always expands the live node with the smallest (min problem) or largest (max problem) bound. It is the B&B analogue of Dijkstra/A*.


Pages 1–2 of 2