Inferensys

Glossary

Capacitated VRP (CVRP)

A variant of the Vehicle Routing Problem where each vehicle has a finite carrying capacity, adding a binding constraint to the assignment of customer demand to specific routes.
ML engineer developing custom LLM, model architecture diagrams on screens, technical deep work environment.
DEFINITION

What is Capacitated VRP (CVRP)?

The Capacitated Vehicle Routing Problem (CVRP) is a combinatorial optimization challenge that extends the standard VRP by imposing a finite carrying capacity on each vehicle, making it a foundational model for real-world logistics.

The Capacitated Vehicle Routing Problem (CVRP) is a variant of the Vehicle Routing Problem where a homogeneous fleet of vehicles, each with an identical maximum carrying capacity, must service a set of customers with known demands. The objective is to find a set of minimum-cost routes, originating and terminating at a central depot, such that the total demand of customers assigned to any single route does not exceed the vehicle's capacity constraint.

This binding capacity constraint transforms the problem from a pure spatial assignment into a complex bin-packing and routing hybrid. Solving a CVRP requires simultaneously deciding how to cluster customer demands into feasible vehicle loads and determining the optimal Hamiltonian path through each cluster. Exact solutions via Mixed-Integer Linear Programming (MILP) are computationally prohibitive for large instances, making the CVRP a primary benchmark for metaheuristics like Adaptive Large Neighborhood Search (ALNS) and Genetic Algorithms.

CONSTRAINED LOGISTICS

Core Characteristics of CVRP

The Capacitated Vehicle Routing Problem (CVRP) extends the standard VRP by introducing a binding vehicle capacity constraint, making it a fundamental model for real-world distribution where payload limits dictate route feasibility.

01

The Capacity Constraint

The defining feature of CVRP is that each vehicle k has a finite, non-negative capacity Q. The sum of customer demands qᵢ on any single route cannot exceed Q. This transforms the problem from a pure spatial challenge into a bin-packing and routing hybrid. A solution is infeasible if a route's total demand surpasses the vehicle's limit, regardless of how optimal the travel sequence is. This constraint is typically modeled as a knapsack-style restriction within the route construction logic.

02

Mathematical Formulation

CVRP is formally defined on a complete graph G = (V, A) where V = {0, 1, ..., n} (0 is the depot). Each customer i has a non-negative demand dᵢ. The objective is to find a set of K Hamiltonian cycles minimizing total travel cost, subject to:

  • Route continuity: Each route starts and ends at the depot.
  • Visit uniqueness: Each customer is visited exactly once.
  • Capacity feasibility: For any route R, the sum of dᵢ for all i in RQ. This is an NP-hard problem, solvable exactly only for small instances via Mixed-Integer Linear Programming (MILP).
03

Two-Index Vehicle Flow Model

A common exact formulation uses binary variables xᵢⱼ equal to 1 if a vehicle travels directly from i to j. The capacity constraint is enforced using subtour elimination constraints (SECs). The standard Miller-Tucker-Zemlin (MTZ) formulation introduces auxiliary variables uᵢ representing the cumulative load after visiting customer i. The constraint uⱼ ≥ uᵢ + dⱼ - Q(1 - xᵢⱼ) simultaneously prevents subtours and enforces capacity. This compact model is suitable for MILP solvers like Gurobi.

04

Savings Algorithm Heuristic

The classic Clarke-Wright Savings Algorithm is a constructive heuristic specifically designed for CVRP. It starts with a trivial solution where each customer is served by a dedicated route. It then iteratively merges two routes (0...i,0) and (0,j...0) if the combined demand does not exceed Q. The merge is prioritized by the 'savings' value: sᵢⱼ = cᵢ₀ + c₀ⱼ - cᵢⱼ. This greedy approach quickly generates a good feasible solution, often used as a starting point for metaheuristics like Adaptive Large Neighborhood Search (ALNS).

05

Split Deliveries vs. CVRP

A key distinction is between CVRP and the Split Delivery VRP (SDVRP). In CVRP, each customer's demand is indivisible and must be fulfilled by a single vehicle. This is a hard assignment constraint. In SDVRP, a customer's demand can be split across multiple vehicles, which can reduce total cost when demand exceeds vehicle capacity. CVRP is the more restrictive model, applicable when splitting a delivery is operationally impossible or cost-prohibitive, such as delivering a single palletized machine.

06

Benchmark Datasets

Standardized test instances are crucial for comparing CVRP algorithms. The most famous are the CVRPLIB datasets, including:

  • Set A (Augerat et al.): Instances with 32-80 customers, widely used for exact methods.
  • Set P (Christofides & Eilon): Classic instances with 50-199 customers.
  • Set X (Uchoa et al.): Large-scale instances with 100-1,000 customers, designed to challenge modern metaheuristics. These datasets provide known optimal solutions, allowing researchers to benchmark the optimality gap of their heuristics.
CONSTRAINT COMPARISON

CVRP vs. Other VRP Variants

How the capacitated constraint distinguishes CVRP from other fundamental vehicle routing problem variants.

Constraint / FeatureCVRPVRPVRPTWSDVRP

Vehicle Capacity Limit

Customer Time Windows

Split Deliveries Allowed

Heterogeneous Fleet

Objective Function

Minimize total distance

Minimize total distance

Minimize total distance

Minimize total distance

Typical Solver Approach

Branch-and-Cut, ALNS

Savings Algorithm, Sweep

Branch-and-Price, Tabu Search

Branch-and-Cut, ALNS

Computational Complexity

NP-Hard

NP-Hard

NP-Hard

NP-Hard

Primary Industry Application

Retail distribution, food delivery

Postal services, meter reading

Pharma delivery, field service

Bulk fuel, industrial gases

CVRP ESSENTIALS

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the Capacitated Vehicle Routing Problem, its constraints, and its solution methodologies.

The Capacitated Vehicle Routing Problem (CVRP) is a combinatorial optimization problem where a fleet of identical vehicles, each with a finite carrying capacity Q, must service a set of customers with known demands d_i from a single depot, such that the total demand on any route does not exceed Q. The primary distinction from the standard Vehicle Routing Problem (VRP) is the explicit capacity constraint. In a basic VRP, the sole constraint might be route length or time, whereas the CVRP introduces a binding knapsack-like constraint on each vehicle. This transforms the problem from a pure partitioning and sequencing challenge into one where the assignment of customers to vehicles is fundamentally constrained by the sum of their demands. The objective remains to minimize the total distance traveled or the total cost of all routes, but the solution space is now restricted to only those partitions of customers that are weight-feasible.

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.