Inferensys

Glossary

Branch and Bound

Branch and bound is a general algorithm for finding optimal solutions to combinatorial and discrete optimization problems by recursively exploring the solution space and pruning suboptimal branches.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
ALGORITHM

What is Branch and Bound?

Branch and bound is a foundational algorithmic paradigm for solving discrete and combinatorial optimization problems to optimality.

Branch and bound is a general algorithm for finding optimal solutions to combinatorial optimization and constraint optimization problems (COPs) by systematically exploring a tree of candidate solutions. The algorithm operates by recursively partitioning the solution space into smaller subproblems (branching) and calculating optimistic bounds on the best possible objective value within each partition. Subproblems (or branches) whose bound proves they cannot contain a better solution than the best one found so far are discarded (pruning), dramatically reducing the search space.

The algorithm's efficiency hinges on the quality of its bounding function and branching strategy. For a minimization problem, it maintains a global upper bound (the best feasible solution found) and computes a lower bound (e.g., via a linear programming relaxation) for each node. If a node's lower bound exceeds the current upper bound, the entire subtree is pruned. This method is central to solving integer programming and NP-hard problems like the traveling salesman problem, where exhaustive search is infeasible.

ALGORITHMIC FOUNDATIONS

Core Components of Branch and Bound

Branch and bound is a systematic search algorithm for discrete optimization. Its power derives from the interplay of four core mechanisms that work together to prune the search space and guarantee an optimal solution.

01

Branching

Branching is the process of recursively partitioning the solution space into smaller, disjoint subproblems (or nodes). This creates a search tree where the root represents the original problem and leaves represent candidate solutions.

  • Mechanism: At each node, a decision variable is selected, and its domain is split, creating child nodes for each possible partial assignment (e.g., x = 0 and x = 1).
  • Purpose: It systematically enumerates all possible solutions without explicit brute-force enumeration, as bounding will prune most branches.
  • Example: In a Traveling Salesperson Problem (TSP), branching could decide which city to visit next from the current location, creating a branch for each unvisited city.
02

Bounding

Bounding is the technique of calculating a bound (an optimistic estimate) on the best possible objective value achievable within a subproblem. This is the algorithm's primary pruning tool.

  • For Minimization: A lower bound (e.g., a relaxed solution cost) is computed. If this bound is worse than the cost of the best-known solution (the incumbent), the entire subtree can be fathomed (discarded).
  • For Maximization: An upper bound is used similarly.
  • Key Insight: A tight, quickly computable bound is critical for performance. Common methods include linear programming relaxation (dropping integrality constraints) or Lagrangian relaxation.
03

Selection Rule (Node Selection)

The selection rule determines the order in which active subproblems (nodes) in the search tree are explored. This rule significantly impacts memory usage and how quickly a good incumbent solution is found.

  • Best-First Search (Best-Bound): Always explores the node with the best (lowest for minimization) bound. This aims to improve the global bound quickly but can use significant memory.
  • Depth-First Search: Explores deeply down one branch first. It uses minimal memory (O(tree depth)) and finds feasible solutions quickly, but may explore poor regions if bounds are weak.
  • Hybrid Strategies: Modern solvers often use a combination, such as depth-first initially to find a good incumbent, then switching to best-first to prove optimality.
04

Incumbent & Fathoming

The incumbent is the best feasible solution found so far during the search. Its value provides the global benchmark against which bounds are compared.

  • Fathoming (Pruning): A node is fathomed (eliminated from further consideration) if one of three conditions is met:
    1. Bound Pruning: The node's bound is worse than the incumbent's value.
    2. Feasibility Pruning: The subproblem is proven to have no feasible solution (e.g., a constraint is violated).
    3. Optimality Pruning: The node's solution is itself feasible and optimal for that subproblem; it may become the new incumbent.
  • The algorithm terminates when no active nodes remain, guaranteeing the incumbent is globally optimal.
05

Relaxation (for Bound Calculation)

A relaxation is a modified version of a subproblem that is easier to solve but whose optimal value provides a bound for the original, harder problem.

  • Linear Programming (LP) Relaxation: For an Integer Program, the integrality constraints (x must be integer) are removed, allowing fractional solutions. The LP optimum provides a lower bound for a minimization problem.
  • Lagrangian Relaxation: Complicated constraints are moved into the objective function with penalty multipliers. By adjusting these multipliers, a tight bound can be found.
  • Combinatorial Relaxation: A related but simpler problem is solved (e.g., a Minimum Spanning Tree relaxation for the TSP). The quality of the bound directly dictates pruning efficiency.
BRANCH AND BOUND

Frequently Asked Questions

Branch and bound is a foundational algorithm for discrete optimization. This FAQ addresses its core mechanisms, applications, and relationship to other search techniques in AI and constraint solving.

Branch and bound is a general algorithm paradigm for finding optimal solutions to discrete and combinatorial optimization problems. It works by systematically exploring the solution space through a search tree, where each node represents a partial or candidate solution. The algorithm operates via two core mechanisms: branching, which splits a problem into smaller subproblems (creating child nodes), and bounding, which uses calculated upper and lower bounds to prune entire branches of the tree that cannot contain the optimal solution, dramatically reducing the search space compared to exhaustive enumeration.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.