Branch and bound is an exact search algorithm for discrete and combinatorial problems that recursively splits the solution space into smaller subproblems and prunes every subproblem whose bound proves it cannot contain a better solution than the best one already found. Optimization in artificial intelligence relies on it whenever a model, schedule or plan must be provably optimal rather than merely good.
The method is the backbone of modern integer programming and mixed-integer linear programming solvers, and it also drives exact solvers for the traveling salesman problem, the knapsack problem and many planning tasks. Its power comes from a simple idea: a valid bound on a whole region of solutions lets the algorithm skip that region without examining a single member of it.
How branch and bound explores the search tree
Branch and bound organizes the search as a tree of subproblems. The root is the original problem; each child is a restricted version of its parent, created by fixing or tightening a decision. For a minimization problem, the algorithm maintains an incumbent, the best feasible solution found so far, whose value acts as a global upper bound.
At every node the algorithm computes a lower bound, usually by solving a relaxation that is easier than the node itself. If that lower bound is not better than the incumbent, the node is fathomed and its entire subtree disappears. Otherwise the node is split again. The search ends when no open nodes remain, and the incumbent is then a certified global optimum.
The following table lists the four operations that every implementation repeats.
| Operation | What it does | Typical technique |
|---|---|---|
| Branching | Splits a node into disjoint subproblems | Fix a binary variable to 0 or 1 |
| Bounding | Estimates the best value inside a node | Linear programming relaxation |
| Pruning | Discards nodes that cannot improve the incumbent | Compare node bound with incumbent |
| Selection | Chooses which open node to process next | Best-first or depth-first rule |
Bounds, relaxations and the optimality gap
The quality of the bound decides almost everything about performance. A tight relaxation produces bounds close to the true node value, so far more nodes are pruned early. In integer programming the standard choice is the linear programming relaxation, which drops the integrality requirement and is solved by the simplex algorithm or an interior-point method.
Solvers report progress through the optimality gap, the relative distance between the incumbent and the best remaining lower bound. A gap of 0 percent proves optimality; a user can also stop at a tolerance such as 1 percent and still know exactly how far the answer might be from the best possible value. This built-in quality guarantee distinguishes the method from heuristics.
The table below compares common bounding sources and their usual trade-off between strength and cost.
| Bound source | Strength | Cost per node |
|---|---|---|
| Linear programming relaxation | Moderate to strong | Low to moderate |
| Lagrangian relaxation | Often stronger on structured problems | Moderate |
| Semidefinite relaxation | Very strong | High |
| Combinatorial bound such as a minimum spanning tree | Weak to moderate | Very low |
Branching and node selection strategies
The branching rule chooses which variable or constraint splits a node. In mixed-integer solvers, the variable with a fractional value in the relaxation is the usual candidate. Strong branching tests several candidates by partially solving the child relaxations, which yields small trees but costs time; pseudocost branching learns from earlier branchings and is much cheaper. Modern solvers combine both in reliability branching.
The node selection rule decides the traversal order, and each rule balances memory, speed of finding good incumbents and speed of closing the gap, as the next table shows.
| Strategy | Main advantage | Main drawback |
|---|---|---|
| Depth-first search | Finds feasible solutions quickly, low memory | May explore poor regions for a long time |
| Best-first search | Raises the lower bound fastest | Large memory use, late incumbents |
| Best-estimate search | Targets promising regions using predictions | Depends on estimate accuracy |
| Hybrid with diving | Combines quick incumbents with bound progress | More parameters to tune |
Industrial solvers extend the basic scheme into branch and cut, which adds cutting planes to tighten relaxations, and branch and price, which generates columns on demand for problems with huge numbers of variables, such as crew scheduling or vehicle routing.
Branch and bound compared with related methods
Branch and bound differs from exhaustive enumeration because it evaluates whole regions at once, and from metaheuristics such as simulated annealing or tabu search because it proves optimality. The comparison below places it among neighboring approaches in combinatorial optimization.
| Method | Guarantees optimality | Typical use |
|---|---|---|
| Branch and bound | Yes, with a proven gap | Integer and combinatorial problems |
| Exhaustive enumeration | Yes | Very small instances only |
| Dynamic programming | Yes, with suitable structure | Problems with overlapping subproblems |
| Local search and metaheuristics | No | Large instances needing fast good answers |
| Alpha-beta pruning | Yes, for the game value | Two-player game trees |
In practice these methods cooperate. Solvers run primal heuristics inside the tree to find early incumbents, and a good incumbent from local search can be supplied as a warm start, which makes pruning effective from the first node.
Use in artificial intelligence and machine learning
In artificial intelligence, branch and bound appears in neural network verification, where tools such as branch-and-bound verifiers split the input domain or ReLU activation states to prove that a network is robust within a perturbation radius. It also supports optimal decision tree learning, sparse regression with exact feature selection, and constraint-based planning and scheduling.
- Verification: proving that no adversarial input exists within a defined region.
- Interpretable models: training decision trees or rule lists that are provably optimal for a given depth.
- Combinatorial decisions: allocating compute jobs, routing deliveries or assigning tasks under hard constraints.
- Learning to branch: using machine learning models to imitate strong branching and reduce solver time.
Limitations and common pitfalls
The worst-case running time remains exponential, because many relevant problems are NP-hard and the tree can grow to almost full enumeration when bounds are weak. Practitioners therefore focus on model formulation: a reformulation with tighter constraints often matters more than any solver setting.
- Weak formulations, such as large big-M constants, produce loose bounds and enormous trees.
- Symmetry creates many equivalent subtrees; symmetry-breaking constraints help.
- Numerical tolerances can declare slightly infeasible points feasible if scaling is poor.
- Memory exhaustion occurs in best-first search on large instances without node limits.
A plain-language summary
Imagine searching a huge building for the cheapest item on sale. You can check the price tag on each floor’s cheapest shelf first. If even that shelf costs more than the best deal you already hold, you skip the whole floor. You never walk its aisles.
Branch and bound works the same way. It splits a big problem into smaller pieces. It estimates the best each piece could offer. It throws away pieces that cannot win. When nothing is left to check, the answer it holds is guaranteed to be the best one.
An example from practice
A regional distribution company plans daily delivery routes for 40 vans and about 900 stops, with time windows and vehicle capacities. The planning team models the task as a mixed-integer linear program and solves it with a branch-and-cut solver each night.
A local search heuristic first supplies a feasible plan as the starting incumbent. The solver then tightens the linear programming relaxation with cutting planes and branches on route assignments. After about 20 minutes, the optimality gap reaches 0.8 percent, below the team’s stopping tolerance of 1 percent.
The result is a plan that drives roughly 6 percent fewer kilometers than the previous manual schedule, and the reported gap tells managers that no possible plan could save more than 0.8 percent beyond it.