Inferensys

Glossary

Branch and Bound

An exact algorithm for solving integer optimization problems by systematically partitioning the solution space into branches and computing bounds on the optimal solution to prune suboptimal regions.
Developer building agentic RAG system, retrieval pipeline diagram on laptop, technical workspace with notes.
EXACT OPTIMIZATION ALGORITHM

What is Branch and Bound?

Branch and Bound is a foundational algorithm for solving combinatorial optimization problems to proven optimality by systematically enumerating candidate solutions and discarding suboptimal regions.

Branch and Bound is an exact algorithm for solving integer optimization problems by systematically partitioning the solution space into smaller subsets (branching) and computing optimistic estimates (bounds) on the best possible solution within each subset. If a subset's bound is worse than the current best-known solution, the entire subset is pruned—discarded without explicit enumeration—dramatically reducing the search space while guaranteeing global optimality.

The algorithm maintains a search tree where each node represents a subproblem. Lower bounds are derived via linear programming relaxation—temporarily ignoring integrality constraints—while feasible integer solutions provide upper bounds. The solver iteratively selects nodes using strategies like best-bound-first search, updating the incumbent solution whenever a better integer-feasible solution is found. This method underpins modern solvers like Gurobi and CPLEX, enabling exact solutions to Mixed-Integer Linear Programming (MILP) formulations of the Vehicle Routing Problem (VRP) and other NP-hard logistics challenges.

ALGORITHM MECHANICS

Key Features of Branch and Bound

Branch and Bound is an exact algorithm design paradigm for solving discrete and combinatorial optimization problems. It systematically enumerates candidate solutions by forming a rooted tree, using computed bounds on the objective function to prune vast regions of the search space that provably cannot contain an optimal solution.

01

The Branching Mechanism

Branching is the process of recursively partitioning the feasible solution space into smaller, mutually exclusive subproblems. This creates a decision tree where each node represents a constrained subset of the original problem.

  • Variable Diving: A common strategy selects a fractional integer variable and creates two child nodes by rounding it down and up.
  • Depth-First vs. Best-First: The search strategy dictates which node to explore next. Best-first prioritizes nodes with the most promising bound.
  • Constraint Propagation: After branching, logical deductions immediately reduce the domains of other variables, shrinking the subproblem before solving.
02

Bounding and Pruning Logic

Bounding computes a numerical limit on the best possible solution obtainable within a given subproblem. Pruning discards a subproblem entirely if its bound proves it cannot improve upon the current best-known feasible solution, the incumbent.

  • Relaxation: The bound is typically found by solving a relaxed, easier version of the problem, such as the Linear Programming (LP) Relaxation of a Mixed-Integer Linear Programming (MILP) model.
  • Pruning by Optimality: If a subproblem's relaxation yields an integer-feasible solution, it is a candidate optimum for that branch.
  • Pruning by Infeasibility: If the relaxed subproblem has no solution, the branch itself is infeasible and is pruned.
03

The Incumbent and Global Bounds

The incumbent is the best integer-feasible solution found at any point during the search. It provides a dynamic global upper bound (for minimization) that drives pruning efficiency.

  • Warm Starts: Providing a high-quality initial incumbent via a heuristic like Adaptive Large Neighborhood Search (ALNS) can dramatically accelerate the algorithm by pruning more nodes early.
  • Absolute vs. Relative Gap: The algorithm terminates when the difference between the incumbent and the best remaining node bound falls below a specified MIP gap tolerance, proving optimality within that threshold.
04

Node Selection Strategies

The order in which subproblems are explored critically impacts memory usage and time-to-solution. Modern solvers like Gurobi and OR-Tools use sophisticated hybrid strategies.

  • Best-Bound First: Selects the node with the most optimistic bound, minimizing total nodes explored but consuming more memory to store the active node list.
  • Depth-First Search: Plunges deep into the tree quickly to find a new incumbent, which is memory-efficient and crucial for large-scale problems.
  • Hybrid Interleaving: Commercial solvers dynamically switch between strategies, often starting with depth-first to find a good incumbent, then switching to best-bound to close the optimality gap.
05

Cutting Planes Integration

Modern Branch and Bound is almost always combined with Cutting Plane methods to form the Branch and Cut algorithm, the backbone of industrial MILP solvers.

  • Gomory Cuts: Generated from the simplex tableau to eliminate fractional LP solutions without removing any integer-feasible points.
  • Clique Cuts: Derived from the constraint matrix structure to tighten the LP relaxation's formulation of binary variables.
  • Separation Problem: The solver iteratively solves a subproblem to find a violated valid inequality, adds it as a cut, and re-optimizes the LP relaxation, tightening the bound before any branching decision.
06

Application in Vehicle Routing

Branch and Bound (and Branch and Cut) is the core exact engine for solving Capacitated VRP (CVRP) and Pickup and Delivery Problems (PDP) to proven optimality for small-to-medium instances.

  • Set Partitioning Formulation: A common VRP model where each variable represents a feasible route. Column Generation is used to dynamically generate these route variables, while Branch and Bound enforces integer selection of routes.
  • Branching on Arcs: Instead of branching on route variables, the algorithm can branch on the flow on a specific edge in the transportation network, forcing it to be used or not.
  • Constraint Programming Hybrids: For highly constrained problems like the Dial-a-Ride Problem (DARP) with complex time windows, Branch and Bound is integrated with Constraint Programming propagation for logical scheduling constraints.
OPTIMIZATION APPROACH COMPARISON

Branch and Bound vs. Heuristic Methods

A comparison of exact Branch and Bound algorithms against common heuristic and metaheuristic approaches for solving combinatorial optimization problems like the Vehicle Routing Problem.

FeatureBranch and BoundMetaheuristicsConstraint Programming

Solution Quality

Provably optimal

Near-optimal, no guarantee

Optimal if run to completion

Scalability

Exponential worst-case

Large-scale instances

Medium-scale, highly constrained

Runtime Predictability

Unpredictable, can be hours

Controllable via iterations

Unpredictable for hard instances

Handles Non-Linear Constraints

Provides Optimality Gap

Typical Solver

Gurobi, CPLEX, SCIP

Custom ALNS, Genetic Algorithm

OR-Tools CP-SAT, Gecode

Memory Usage

High, stores full tree

Low, stores population

Moderate, stores domains

Warm Start Capability

ALGORITHM CLARIFICATIONS

Frequently Asked Questions

Precise answers to common technical questions about the Branch and Bound algorithm, its mechanisms, and its application in solving complex combinatorial optimization problems like vehicle routing.

Branch and Bound is an exact algorithm design paradigm for solving discrete and combinatorial optimization problems, particularly Mixed-Integer Linear Programming (MILP) models. It systematically enumerates candidate solutions by forming a rooted tree. The algorithm branches by partitioning the solution space into smaller subproblems (e.g., splitting a fractional integer variable into two bounds: x ≤ floor(val) and x ≥ ceil(val)). It then calculates a bound (a relaxed objective value) for each subproblem. If this bound is worse than the current best-known integer solution (the incumbent), that entire branch is pruned or fathomed, as it cannot contain the optimal solution. This implicit enumeration avoids exhaustive search, making it the foundational engine behind solvers like Gurobi and CPLEX for solving NP-hard routing problems to proven optimality.

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.