- Introduced by
- George Dantzig & John Ramser
- Year
- 1959
- Type
- Combinatorial optimization problem
- Family
- Routing
What does it do?
The Vehicle Routing Problem (VRP) seeks the minimum-cost set of routes for a fleet of vehicles to serve a collection of geographically dispersed customers, each with a known demand, departing from and returning to a central depot.
Originally formulated as the Truck Dispatching Problem by Dantzig and Ramser in 1959, VRP is a foundational model in logistics, supply chain management, and operations research, applicable whenever goods or services must be delivered efficiently across multiple stops.
The intuition behind the method
Imagine a depot that must supply dozens of stores using a small fleet of trucks, each with a weight limit. Naively assigning one truck per store wastes capacity; combining stops randomly may violate weight limits or balloon travel distance. VRP systematically assigns customers to vehicles and orders the stops so that total travel cost is minimized while every vehicle stays within its capacity. The challenge is combinatorial: as customers grow, the number of feasible route combinations explodes, making exhaustive search impossible and demanding smart heuristics or exact solvers.
History
In 1959 Dantzig and Ramser described the problem as the truck dispatching problem, concerned with routing gasoline delivery trucks from a bulk terminal to a set of service stations. They proposed a procedure based on a linear programming formulation that assigns stations to trucks so that station demands are met and total mileage is near-minimal. The calculations could be done by hand or on a digital computer. They noted that the method had not yet been applied in practice, though it was tested on several trial problems. The arc-based mixed-integer formulation shown on this page is a later, modern presentation of the problem.
When to use it
Use VRP when a fleet must serve multiple demand points from a shared depot and vehicle capacity is a binding constraint. Core assumptions include known customer locations and demands, homogeneous or heterogeneous fleet with known capacities, and a symmetric or asymmetric cost matrix. The model extends naturally to time-window VRP, split-delivery VRP, and stochastic VRP variants. It is less appropriate when customer demand is highly uncertain, routes are fixed by contract, or only a single vehicle is involved (reducing to the Traveling Salesman Problem).
Limitations and considerations
- Because the problem is NP-hard, the time needed for exact solution grows rapidly with the number of customers. Exact methods are therefore restricted to modest instances, and larger ones depend on heuristics that carry no optimality guarantee.
- Model quality depends critically on accurate cost matrices and demand estimates; errors in either propagate directly into route quality.
- The static formulation does not naturally accommodate real-time events such as traffic disruptions or last-minute orders, which require re-optimization.
- Setting up and solving the integer program requires specialized solver software and modelling expertise beyond basic spreadsheet tools.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Exact integer programming formulations can certify optimality for small instances, and heuristics still return feasible routes when exact proof is out of reach.
- The basic model can be extended: time windows, multiple depots, heterogeneous fleets and split deliveries are added as further constraints or variables.
- Established commercial solvers (CPLEX, Gurobi) and open-source libraries (OR-Tools, VRPy) support the standard variants.
- Column-generation and metaheuristic methods allow routing of instances too large to enumerate.
Applications
- Last-mile parcel delivery routing for e-commerce fulfillment centers.
- School bus scheduling to minimize fleet size while meeting pickup time windows.
- Municipal waste collection with fixed vehicle capacities and daily collection cycles.
- Medical supply distribution to rural health clinics from a regional warehouse.
- Field service technician dispatching for utility repair and maintenance teams.
How it works
How it works
A common modern way to state the problem is as a mixed-integer program (a later formulation, not the one in Dantzig and Ramser's 1959 paper). The binary variable x_ijk equals 1 when vehicle k travels directly from location i to location j, and the objective minimizes total travel cost summed over all vehicles and arcs. Further constraints are needed to ensure that each customer is served exactly once and that each vehicle's route starts and ends at the depot.
Formula
\min \sum_{k=1}^{K} \sum_{i=0}^{n} \sum_{j=0}^{n} c_{ij} x_{ijk}Each vehicle k has a finite capacity Q_k, and the total demand of the customers assigned to it must not exceed that limit. This constraint distinguishes the capacitated problem from a plain travelling salesman tour and is the main reason the fleet must be split into several routes.
Formula
\sum_{i=1}^{n} d_i y_{ik} \leq Q_k \quad \forall k \in KFor each customer, the number of arcs entering it on vehicle k equals the number leaving it, and both equal y_jk, so a vehicle that serves a customer also passes through it. The four formulas shown here do not include a depot balance constraint (arcs leaving the depot equal arcs returning to it for each vehicle), which a complete model needs so that every route starts and ends at the depot. They also do not exclude loops that avoid the depot; such subtours need separate elimination constraints.
Formula
\sum_{i=0}^{n} x_{ijk} = \sum_{i=0}^{n} x_{jik} = y_{jk} \quad \forall j \in N,\, k \in KEach customer i must be assigned to exactly one vehicle. Together with flow conservation, the depot balance constraint and subtour elimination, and the capacity limits, this completes the formulation. Exact solution is typically pursued with branch-and-cut for modest instances, while metaheuristics such as tabu search and genetic algorithms are commonly used on large cases where an exact proof of optimality is impractical.
Formula
\sum_{k=1}^{K} y_{ik} = 1 \quad \forall i \in \{1, \dots, n\}Common pitfalls
- Ignoring subtour elimination constraints in custom implementations leads to infeasible solutions that look optimal on paper.
- Treating a multi-depot problem as single-depot distorts route costs and produces unrealistic assignments.
- Using Euclidean distance as a proxy for road travel time can yield routes that are impractical due to road network topology.
- Overfitting the fleet size to a single historical demand snapshot may leave the model brittle when demand fluctuates seasonally.
Frequently asked questions
How does VRP differ from the Traveling Salesman Problem?
TSP finds a single minimum-cost tour visiting all customers once. VRP generalizes TSP to multiple vehicles, each with a capacity limit, so the problem also decides how to partition customers across vehicles. TSP is a special case of VRP with one vehicle of unlimited capacity; in practice VRP is significantly harder because the partitioning and sequencing decisions interact.
Can VRP handle time windows and real-time updates?
Yes, through the Vehicle Routing Problem with Time Windows (VRPTW) variant, each customer is given an earliest and latest service time and the model adds temporal feasibility constraints. Dynamic VRP extensions re-optimize routes as new orders or disruptions arrive during the day, typically using rolling-horizon heuristics that re-solve a reduced problem at each decision epoch.
What solver or library should I use to implement VRP?
Google OR-Tools and VRPy are commonly used open-source options for prototyping, and OR-Tools handles many standard variants. For larger exact optimization, commercial solvers such as CPLEX or Gurobi are often used with branch-and-cut or branch-and-price approaches. Check the documentation of the chosen tool for the variants it supports.
Related methods
Sources
Dantzig, G. B., & Ramser, J. H. (1959). The truck dispatching problem. Management Science, 6(1), 80–91.
Open DOI reference