Vehicle Routing Problem: A Method Guide to Formulations and Algorithms
Updated October 2026
Executive Summary
The Vehicle Routing Problem (VRP) asks how a fleet of vehicles should serve a set of customers at minimum cost while respecting constraints such as vehicle capacity and delivery time windows. It is NP-hard, so practical solvers rely on heuristics rather than exhaustive search.
This paper is an explanation of the method, not a study. It reports no measured results, no customer data and no benchmark of its own. It covers the formulation, the main variants, the families of algorithms, the data a model needs, and the pitfalls that commonly cause a routing project to disappoint. Any improvement an organization sees from routing optimization depends on its own network, data and constraints, and has to be measured against its own baseline.
Key Points
- The VRP is a family of problems. Capacity limits, time windows, multiple depots, pickups and deliveries, dynamic requests and mixed fleets each change the formulation and the choice of algorithm.
- Exact methods scale poorly. The number of possible route sets grows combinatorially, so exact solvers are practical mainly for small to moderate instances and larger ones use heuristics.
- Construction plus local search is a common practical design. A fast construction heuristic gives a feasible start, local search improves it, and a metaheuristic can be added when more compute time is available.
- Input quality bounds output quality. Wrong coordinates, unrealistic travel times or guessed service times produce routes that look optimal on paper and fail on the road.
- Measure against a baseline. Record current routes, then compare candidate plans on the same instance and on several metrics, not distance alone.
Guidance in Brief
Start by fixing the data and recording a baseline, formulate the variant that matches the real constraints, begin with a simple construction and local search solver, and expand scope only after the routes have been checked against how drivers actually operate.
1. Introduction
1.1 Problem Statement
The Vehicle Routing Problem, first formulated by Dantzig and Ramser in 1959, addresses a basic question in logistics: given a fleet of vehicles with limited capacity and a set of geographically dispersed customers with specific demands, how should deliveries be organized to minimize total cost while satisfying all service constraints? The question is easy to state and hard to solve. VRP belongs to the class of NP-hard problems, so the effort needed to find a provably optimal solution grows very quickly with the number of delivery locations.
Real operations add further requirements: tight delivery windows, several competing objectives such as fuel use, driver workload balance and vehicle utilization, and changes that arrive during the day such as traffic or new requests. These are the reasons the basic formulation is extended into the variants described in Section 2.
Manual planning by an experienced dispatcher can work for a small number of stops, but it becomes hard to apply consistently as stops and constraints multiply. Simple rules such as nearest-neighbor or geographic clustering are easy to implement, but they make myopic choices and can violate time windows or capacity when constraints are tight. Search-based methods exist to handle that interaction between route structure and constraints.
1.2 Scope and Objectives
This paper explains the method. It does not present original research, field results or case studies. Its scope is:
- Mathematical formulation of the VRP and its principal variants, including capacitated VRP (CVRP), VRP with time windows (VRPTW) and dynamic VRP (DVRP)
- Algorithm families: exact methods, construction heuristics, local search, metaheuristics and hybrids
- Data requirements for building a routing model and the quality problems to check for
- A suggested sequence for applying the method, from data assessment to a pilot to wider use
- Evaluation: how to compare routing plans across operational, financial and service dimensions
- An illustrative worked example with made-up numbers, in Section 4
The intended reader is a technical or operations lead who needs to understand what a routing solver does, what it assumes, and where it can mislead.
1.3 When Routing Optimization Applies
Routing optimization is relevant when there are enough stops that a plan has many alternatives, when constraints such as capacity or time windows interact, and when the cost of a route (distance, time, fuel, driver hours) is measurable. It is less useful when the stops are few and fixed, when routes are dictated by contract or regulation, or when the distance and time data are too unreliable to trust. In those cases improving the data or the process comes first.
2. Background
2.1 Mathematical Foundations of VRP
The classical VRP can be defined on a complete graph G = (V, E) where V = {0, 1, 2, ..., n} are vertices (vertex 0 is the depot and vertices 1 through n are customers) and each edge has an associated cost c_ij. The objective is to determine a set of routes such that:
- Each route begins and ends at the depot (vertex 0)
- Each customer is visited exactly once by exactly one vehicle
- The total demand of customers on each route does not exceed vehicle capacity Q
- The total cost (typically distance or time) across all routes is minimized
This can be written as an integer linear program with a binary variable x_ij for each edge, flow-conservation constraints at each customer, and capacity (subtour elimination) constraints. The number of possible route sets grows combinatorially with n, which is why direct enumeration is impractical beyond very small instances.
Variants extend this basic formulation with additional constraints:
Principal VRP Variants
| Variant | Additional Constraints | Typical Application Domains |
|---|---|---|
| CVRP (Capacitated VRP) | Vehicle capacity limits | Package delivery, waste collection |
| VRPTW (VRP with Time Windows) | Customer-specific time windows for service | Food delivery, appointment-based services |
| MDVRP (Multi-Depot VRP) | Multiple depot locations | Multi-warehouse distribution networks |
| VRPPD (VRP with Pickup and Delivery) | Items picked up and delivered along routes | Courier services, reverse logistics |
| DVRP (Dynamic VRP) | Requests and conditions that change during execution | Ride-sharing, on-demand delivery |
| HFVRP (Heterogeneous Fleet VRP) | Vehicles with different capacities and costs | Mixed fleet operations |
2.2 Common Approaches and Their Limitations
Organizations route vehicles in several ways, each with characteristic limitations.
Manual routing by dispatchers uses domain knowledge and spatial reasoning, and often handles familiar patterns well. Its limits are consistency and scale: quality depends on the individual, many simultaneous constraints are hard to track by hand, and there is no built-in way to quantify how good a plan is.
Simple rule-based heuristics such as nearest-neighbor or geographic clustering are cheap to compute and easy to explain. Because they decide one step at a time, they can leave obvious improvements on the table and can break time-window or capacity constraints.
Commercial routing software offers interfaces and standard VRP variants. Some products expose little about their method or constraint handling, which makes it harder to diagnose a poor plan or adapt to an unusual rule. Understanding the underlying method makes it easier to evaluate such tools.
Custom implementations give maximum flexibility but need operations research and data engineering skills, and are often held back by data preparation and integration more than by the algorithm.
3. Method
3.1 How This Paper Was Prepared
This paper is a synthesis of standard material on the VRP from the operations research literature (see the references). It contains no experiments, no data collected by MCP Analytics, and no surveys or customer interviews. Where it describes how an algorithm behaves in general terms, the description is qualitative. Any numeric values appear only in the labelled illustrative example in Section 4, where they are made up for explanation.
3.2 Data Considerations for VRP
A routing model is only as good as its inputs. The main categories are:
Essential Data Elements for VRP
Geographic Data: Accurate geocoded coordinates for every location are the foundation. Addresses should be cleaned and standardized, and coordinates are preferably produced by a geocoding service rather than typed by hand. Distances and travel times should come from the road network, not straight-line (Euclidean) distance, unless the area is one where straight-line distance is a reasonable proxy.
Temporal Data: Customer time windows, service time per stop, and the time-of-day variation in travel speed. Congestion can change travel times substantially in cities, so a single static travel time per edge is an assumption worth checking.
Demand Data: Order quantities, weights and volumes determine loading and capacity feasibility. Historical demand supports planning ahead; live order data supports dynamic routing.
Fleet Data: Vehicle capacity (volume and weight), fixed and per-distance costs, shift limits and special equipment such as refrigeration or lift gates.
Performance Data: Actual versus planned arrival times, exceptions and failed deliveries. These are used to calibrate travel and service time estimates and to see where the model and reality diverge.
3.3 A Suggested Sequence for Applying the Method
The following sequence is a general working pattern, not a measured protocol. Durations depend entirely on the organization and are deliberately not given.
Step 1: Data assessment and preparation
Inventory the data sources and check quality across the categories above. Identify missing elements, such as vehicle location history or recorded service times, and decide how to collect them. Consolidate routing-relevant data from order, fleet and customer systems into one place.
Step 2: Baseline measurement and problem formulation
Document current performance: route distance and duration, vehicles used, cost per stop, on-time performance and utilization. This baseline is what any later plan is compared with. Choose the VRP variant that matches reality, separating hard constraints (time windows, capacity) from soft objectives (total distance, route balance).
Step 3: Pilot on a limited scope
Apply a solver to one region, service type or day of the week. Compare its routes with both the baseline and the routes drivers currently run, and review them with dispatchers and drivers to find constraints the model does not capture.
Step 4: Refinement and scaling
Add the constraints and objectives found in the pilot, widen the scope gradually, and keep measuring so that any benefit seen in the pilot is checked as scope grows. Define how exceptions and manual overrides are handled.
Step 5: Dynamic optimization and ongoing review
If the operation needs it, move from fixed daily plans to re-optimization as conditions change. Feed actual execution data back to recalibrate travel and service times, and review the model periodically as operations change.
3.4 Algorithmic Techniques Overview
Solution methods fall into a few families:
Exact algorithms such as branch-and-bound and branch-and-cut return provably optimal solutions but their running time grows rapidly with instance size, so they suit small instances, validating heuristics on test cases, and solving sub-problems inside decomposition schemes.
Construction heuristics build a feasible solution step by step. The Clarke-Wright savings algorithm starts with one route per customer and repeatedly merges the pair of routes that saves the most distance, subject to capacity. Insertion methods add customers to routes at the cheapest feasible position. They run fast and give a feasible starting point, but they do not guarantee quality and are usually improved afterwards.
Local search improves a solution by small changes. Intra-route operators such as 2-opt and Or-opt reorder stops within a route, and inter-route operators such as relocate, swap and cross-exchange move stops between routes. Search stops at a local optimum, a solution that no single move improves.
Metaheuristics such as tabu search, simulated annealing, genetic algorithms and variable neighborhood search guide the search so that it can escape local optima. They typically need more computation time than a single pass of local search, which matters when plans are needed quickly.
Hybrid designs combine these. A typical architecture builds an initial solution with a construction heuristic, improves it with local search, and applies a metaheuristic when the time budget allows. Which combination fits depends on instance size, how quickly a plan is needed, and how much solution quality matters for the decision at hand.
4. Worked Example (Illustrative)
Illustrative example with made-up numbers
This example uses invented numbers to show the arithmetic of the savings algorithm. It does not describe any real operation or result.
Suppose a depot D serves three customers A, B and C with demands of 4, 3 and 5 units, and every vehicle has capacity Q = 10. Suppose the distances are D-A = 10, D-B = 12, D-C = 8, A-B = 5, A-C = 14 and B-C = 9.
The savings for merging two customers into one route is s(i,j) = d(D,i) + d(D,j) - d(i,j):
| Pair | Calculation | Saving |
|---|---|---|
| A, B | 10 + 12 - 5 | 17 |
| B, C | 12 + 8 - 9 | 11 |
| A, C | 10 + 8 - 14 | 4 |
Process pairs from largest saving down. Merging A and B gives a route with demand 4 + 3 = 7, which fits within Q = 10, so it is accepted. Merging C into that route would give demand 12, which exceeds Q, so C stays on its own route. The result is two routes: D-A-B-D with length 10 + 5 + 12 = 27, and D-C-D with length 8 + 8 = 16, for a total of 43. The starting solution, one route per customer, had length 2 x (10 + 12 + 8) = 60. In this made-up instance the savings procedure reduced the total from 60 to 43, which is the sum of the one accepted saving (17) subtracted from 60.
This tiny instance only shows the mechanics. On a real instance, the result of the savings algorithm would then be passed to local search, and its quality would be judged against the organization's own baseline.
5. Key Points and Practical Considerations
Point 1: Choose the Algorithm for the Operating Constraint
Academic benchmarks often allow hours of computation. An operational planner may need a plan in seconds or minutes. A fast construction heuristic followed by local search is a common way to meet a short time budget, with a metaheuristic reserved for offline or strategic planning where more time is available. The right balance is an engineering choice to be tested on the organization's own instances.
Point 2: Travel Time Realism Matters
Distance-only models ignore time-dependent travel speed, parking and access time, and the variation in service time between stops. When a plan assumes the same few minutes at every stop, the schedule drifts from reality. Calibrating travel and service times from recorded data is usually a better investment than a more elaborate search algorithm.
Point 3: Data Foundations Come First
A solver cannot repair bad inputs. Typical minimum inputs are checked, geocoded locations, a road-network distance or time matrix, vehicle capacities, and customer time windows where they apply, with hard constraints distinguished from preferences. A sophisticated algorithm on poor data produces precise-looking but unreliable routes.
Point 4: Roll Out Incrementally
Introducing routing optimization in stages (one region, then more constraints, then wider scope) makes problems visible earlier, keeps day-to-day operations running, and gives planners and drivers time to give feedback. A big-bang change gives up those checkpoints.
5.1 Technical Considerations for Implementation Teams
Data integration needs design. Routing depends on data from order management, fleet management, customer records and traffic sources, each with its own update frequency and quality. Pipelines should include validation, and failures in data engineering are a common reason a routing project underdelivers.
Measure several dimensions. Optimizing only total distance can produce plans that violate soft constraints or load some drivers far more than others. Track operational metrics (distance, time, utilization), service metrics (on-time performance, time-window compliance), cost metrics (fuel, labor, depreciation) and qualitative feedback. Multi-objective or constrained formulations make trade-offs explicit.
Plan for the human side. Planners and drivers know constraints that no data file contains. Involve them in constraint definition, make the logic of the solver understandable, and allow overrides for exceptions. A routing system works best as support for human judgment, not a replacement for it.
5.2 Scalability Considerations
Decomposition splits a large instance into sub-problems, for example by geographic clustering into regions that are solved separately, with a rule for the boundaries between them. Dynamic routing can combine an offline plan with fast re-optimization when something changes.
Computing resources. Optimization runs are typically batch jobs and can often be parallelized, so elastic computing capacity is a natural fit for peak planning periods.
Standard data models and interfaces make it easier to bring a new depot or business unit into an existing routing setup.
6. Guidance for Applying the Method
The following is general guidance based on the method described above. It is not derived from measured results.
Guidance 1: Establish Data Quality Before Tuning Algorithms
- Audit the data sources and check quality across the elements in Section 3.2
- Geocode all delivery locations and check a sample against real addresses
- Capture actual route execution data (GPS, driver app) if it is not already recorded
- Consolidate routing-relevant data from source systems into one analytical environment
- Record a baseline of current routing performance before changing anything
Guidance 2: Deploy in Stages
Follow the sequence in Section 3.3: assess data, set a baseline and formulate the problem, pilot on a limited scope, refine and scale, then consider dynamic optimization. Define the metrics used to judge each stage before it starts.
Guidance 3: Start with a Simple Hybrid Solver
- Use a construction heuristic (savings or insertion) for the initial solution
- Apply local search operators (2-opt, Or-opt, cross-exchange) within the time available for planning
- Add a metaheuristic (for example simulated annealing or tabu search) only if the extra solution quality is worth the extra computing time for the decision at hand
- Compare each solver configuration against the baseline on the same instances
Guidance 4: Add Contextual Data Incrementally
Add one data source at a time and compare the planned routes against what drivers actually did, keeping an addition only if the plan matches execution better:
- Historical service times by customer or customer type
- Time-of-day travel speeds from a traffic source or historical GPS data
- Demand forecasts and exception patterns for proactive capacity planning
Guidance 5: Keep Reviewing the Model
- Performance monitoring: track route distance, utilization, on-time performance and cost per stop
- Model updating: recalibrate travel and service time estimates from recent data as patterns change
- Exception analysis: investigate manual overrides to find missing constraints or data errors
- Controlled comparisons: test algorithm or parameter changes against the current setup before adopting them
6.1 Sequencing by Starting Point
An organization with little routing data should begin with data collection and a baseline, using a simple solver on clean data. One with an existing routing system and decent data can focus on calibrating travel and service times and on the choice of solver. One with an established system can look at dynamic routing, multi-objective formulations, or learned predictors for service time and demand.
7. Conclusion
The Vehicle Routing Problem is a well-studied optimization problem with many variants. This paper has explained its formulation, the families of algorithms used to solve it, the data a routing model depends on, and a staged way of applying the method. It is an explanation of a method, not a study: it reports no measured results, and the worked example uses made-up numbers.
Whether routing optimization pays off in a given operation depends on that operation's stops, constraints and data quality. The way to find out is to record a baseline, apply a solver on a limited scope, and compare the results with the baseline on several metrics.
In practice the quality of the inputs, the fit between the formulation and real constraints, and the acceptance of the plan by the people who run it matter at least as much as the choice of search algorithm.
Your turn
Bring your own data and the question you actually need answered.
MCP AnalyticsData science by email Send us your data and your question, and we will reply. ds@mcpanalytics.ai
Frequently Asked Questions
What is the Vehicle Routing Problem?
The Vehicle Routing Problem (VRP) is a combinatorial optimization problem: choose a set of routes for a fleet of vehicles, each starting and ending at a depot, so that every customer is served and total cost (usually distance or time) is minimized subject to constraints such as vehicle capacity and time windows.
How does a data-driven VRP differ from rule-based routing?
A data-driven VRP uses recorded inputs such as geocoded locations, road-network travel times, historical service times and demand to build the cost matrix and constraints, and then searches over route sets with an algorithm. Rule-based approaches such as nearest-neighbor or geographic clustering apply a fixed procedure and do not search for better alternatives. How much a given operation gains, if anything, depends on its data and constraints and must be measured against its own baseline.
What are the main algorithmic approaches for solving VRP?
Exact methods (branch-and-bound, branch-and-cut) give proven optimal solutions but only for small to moderate instances. Construction heuristics such as the Clarke-Wright savings algorithm build a feasible solution quickly. Local search operators (2-opt, Or-opt, cross-exchange) improve a solution, and metaheuristics (tabu search, simulated annealing, genetic algorithms, variable neighborhood search) guide the search past local optima. A common practical design builds with a construction heuristic, improves with local search, and adds a metaheuristic when time allows.
How should the quality of a routing plan be measured?
Compare plans on the same instance using several dimensions: operational (total distance, vehicles used, route duration), financial (cost per stop, fuel, labor), service (time-window compliance, on-time rate) and balance (workload spread across drivers). Record a baseline from current operations before changing anything, and compare the planned routes to what was actually driven.
What data does a VRP need?
At minimum: geocoded delivery locations, a distance or travel-time matrix over the road network, demand per stop, vehicle capacities and costs, service times, and any time windows. Historical records of actual arrival and service times are used to calibrate travel and service time estimates. Errors in these inputs carry directly into the routes the algorithm produces.
References and Further Reading
Academic References
- Toth, P., & Vigo, D. (2014). Vehicle Routing: Problems, Methods, and Applications (2nd ed.). Society for Industrial and Applied Mathematics.
- Laporte, G. (2009). Fifty years of vehicle routing. Transportation Science, 43(4), 408-416.
- Gendreau, M., & Potvin, J. Y. (2010). Handbook of Metaheuristics (2nd ed.). Springer.
- Cordeau, J. F., Laporte, G., Savelsbergh, M. W., & Vigo, D. (2007). Vehicle routing. Transportation, Handbooks in Operations Research and Management Science, 14, 367-428.
- Pillac, V., Gendreau, M., Guéret, C., & Medaglia, A. L. (2013). A review of dynamic vehicle routing problems. European Journal of Operational Research, 225(1), 1-11.
Industry Resources
- VeRoLog - Vehicle Routing and Logistics Optimization (International research community)
- INFORMS Transportation Science & Logistics Society - Academic and practitioner research