Branch and bound


Branch and bound is an algorithm design paradigm for discrete and combinatorial optimization problems, as well as mathematical optimization. A branch-and-bound algorithm consists of a systematic enumeration of candidate solutions by means of state space search: the set of candidate solutions is thought of as forming a rooted tree with the full set at the root. The algorithm explores branches of this tree, which represent subsets of the solution set. Before enumerating the candidate solutions of a branch, the branch is checked against upper and lower estimated bounds on the optimal solution, and is discarded if it cannot produce a better solution than the best one found so far by the algorithm.
The algorithm depends on efficient estimation of the lower and upper bounds of regions/branches of the search space. If no bounds are available, the algorithm degenerates to an exhaustive search.
The method was first proposed by Ailsa Land and Alison Doig whilst carrying out research at the London School of Economics sponsored by British Petroleum in 1960 for discrete programming, and has become the most commonly used tool for solving NP-hard optimization problems. The name "branch and bound" first occurred in the work of Little et al. on the traveling salesman problem.

Overview

The goal of a branch-and-bound algorithm is to find a value that maximizes or minimizes the value of a real-valued function, called an objective function, among some set of admissible, or candidate solutions. The set is called the search space, or feasible region. The rest of this section assumes that minimization of is desired; this assumption comes without loss of generality, since one can find the maximum value of by finding the minimum of. A B&B algorithm operates according to two principles:
Turning these principles into a concrete algorithm for a specific optimization problem requires some kind of data structure that represents sets of candidate solutions. Such a representation is called an instance of the problem. Denote the set of candidate solutions of an instance by. The instance representation has to come with three operations:
Using these operations, a B&B algorithm performs a top-down recursive search through the tree of instances formed by the branch operation. Upon visiting an instance, it checks whether is greater than the lower bound for some other instance that it already visited; if so, may be safely discarded from the search and the recursion stops. This pruning step is usually implemented by maintaining a global variable that records the minimum lower bound seen among all instances examined so far.

Generic version

The following is the skeleton of a generic branch and bound algorithm for minimizing an arbitrary objective function. To obtain an actual algorithm from this, one requires a bounding function, that computes lower bounds of on nodes of the search tree, as well as a problem-specific branching rule. As such, the generic algorithm presented here is a higher order function.
  1. Using a heuristic, find a solution to the optimization problem. Store its value,. will denote the best solution found so far, and will be used as an upper bound on candidate solutions.
  2. Initialize a queue to hold a partial solution with none of the variables of the problem assigned.
  3. Loop until the queue is empty:
  4. # Take a node off the queue.
  5. # If represents a single candidate solution and, then is the best solution so far. Record it and set.
  6. # Else, branch on to produce new nodes. For each of these:
  7. ## If, do nothing; since the lower bound on this node is greater than the upper bound of the problem, it will never lead to the optimal solution, and can be discarded.
  8. ## Else, store on the queue.
Several different queue data structures can be used. This FIFO queue-based implementation yields a breadth-first search. A stack will yield a depth-first algorithm. A best-first branch and bound algorithm can be obtained by using a priority queue that sorts nodes on their lower bound. Examples of best-first search algorithms with this premise are Dijkstra's algorithm and its descendant A* search. The depth-first variant is recommended when no good heuristic is available for producing an initial solution, because it quickly produces full solutions, and therefore upper bounds.

Pseudocode

A C++-like pseudocode implementation of the above is:

// C++-like implementation of branch and bound,
// assuming the objective function f is to be minimized
CombinatorialSolution branch_and_bound_solve

In the above pseudocode, the functions heuristic_solve and populate_candidates called as subroutines must be provided as applicable to the problem. The functions and are treated as function objects as written, and could correspond to lambda expressions, function pointers or functors in the C++ programming language, among other types of callable objects.

Improvements

When is a vector of, branch and bound algorithms can be combined with interval analysis and contractor techniques in order to provide guaranteed enclosures of the global minimum.

Applications

This approach is used for a number of NP-hard problems
Branch-and-bound may also be a base of various heuristics. For example, one may wish to stop branching when the gap between the upper and lower bounds becomes smaller than a certain threshold. This is used when the solution is "good enough for practical purposes" and can greatly reduce the computations required. This type of solution is particularly applicable when the cost function used is noisy or is the result of statistical estimates and so is not known precisely but rather only known to lie within a range of values with a specific probability.

Relation to other algorithms

Nau et al. present a generalization of branch and bound that also subsumes the A*, B* and alpha-beta search algorithms from artificial intelligence.