Everything you need to know about the vrp

The vehicle routing problem, explained

The vehicle routing problem (VRP) asks a deceptively simple question: what is the cheapest set of routes for a fleet of vehicles to serve every customer? Answering it well is worth millions in fuel, time, and service quality, and it's one of the hardest problems in computer science. This page covers what the VRP is, why it's so hard, and how modern solvers crack it at scale.

What is the vehicle routing problem?

The vehicle routing problem (VRP) is a combinatorial optimization problem that asks: what is the optimal set of routes for a fleet of vehicles to travel in order to serve a given set of customers at the lowest possible cost? Typically, goods sit at one or more depots and must be delivered to customers who have placed orders, and each vehicle's route must start and end at its depot while every customer is served exactly once.

That single sentence hides enormous operational reality. "Cost" might mean distance, drive time, fuel, driver hours, or a blend of all of them. "Serve" might mean a delivery, a pickup, a repair visit, or a passenger transfer. And the "fleet" almost never behaves like a textbook: vehicles have different capacities, drivers have shifts and skills, and customers expect service inside narrow time windows.

What is the VRP trying to optimize?

The standard objective of the VRP is to minimize total route cost. In practice, most operations optimize for one or more of the following, often at the same time:

  • Minimize total distance travelled or total drive time.
  • Minimize the number of vehicles (and drivers) needed to serve every customer.
  • Minimize total operating cost: fuel, labour, overtime, tolls.
  • Maximize service quality: on-time arrivals, honoured time windows, balanced workloads.

Real fleets rarely optimize for one number. The art of solving the VRP well is trading these goals off against each other in a way that reflects how the business actually makes money.

The constraints that make it real

A VRP is defined as much by its constraints as by its objective. The most common ones:

  • Vehicle capacity: weight, volume, or number of items a vehicle can carry.
  • Time windows: the interval in which a customer can be served.
  • Driver shifts and breaks: legal driving hours, start/end depots, mandatory rest.
  • Service durations: the time each stop takes on site.
  • Skills and requirements: certifications, equipment, or vehicle type a stop demands.
  • Pickups and deliveries: items collected at one location and dropped at another, kept on the same vehicle in the right order.
  • Priorities and SLAs: which stops are mandatory, which are optional, and which carry contractual response times.

Add a few of these together and the number of feasible plans explodes, which is exactly why the VRP is hard.

A short history

The VRP was introduced in 1959 by George Dantzig and John Ramser in their paper "The Truck Dispatching Problem," which applied it to petrol deliveries from a bulk terminal to service stations. It generalized the earlier Traveling Salesman Problem (TSP) from a single traveller to a fleet. More than six decades later it remains one of the most studied problems in operations research, precisely because so many real industries (like logistics, field service, waste collection, home care, public transport) are VRPs in disguise.

Vehicle routing problem vs. traveling salesman problem

The VRP is a generalization of the traveling salesman problem. The TSP asks for the shortest single route that visits every location once and returns to the start: one traveller, no capacity, no time windows. The VRP keeps that sequencing challenge but layers on a whole fleet plus real-world constraints, namely which vehicle serves which customers, in what order, without breaking capacity, shift, or time-window rules. Put simply, a VRP is many interacting TSPs solved together under shared constraints, which is what makes it dramatically harder.

Why is the vehicle routing problem so hard to solve?

The VRP is NP-hard: as you add stops, the number of possible route combinations grows factorially, far faster than any computer can enumerate. A route with just 10 stops already has over 3.6 million possible orderings. Push that to a few dozen stops across a fleet and the number of feasible plans exceeds the number of atoms in the observable universe. You cannot check every option, not today and not ever.

That is why brute force is off the table for anything but toy problems, and why real fleets rely on optimization algorithms  (heuristics and metaheuristics) that find near-optimal routes in seconds rather than perfect routes in geological time. The best modern solvers reach solutions within roughly 0.5-1% of the theoretical optimum on problems with hundreds or thousands of stops, and vendors of routing tools routinely report 5-30% cost savings versus manual planning.

One problem, many variants

Real operations rarely match the textbook. These are the VRP variants you'll actually encounter, and Timefold's routing APIs are built to solve them.

Variant
What it adds
Typical use case
Solvable with Timefold
CVRP - Capacitated VRP
Vehicles have a maximum load
Parcel and grocery distribution
Yes
VRPTW - VRP with Time Windows
Each stop must be served within a set interval
Appointment-based delivery, field service
Yes
VRPPD / PDP  Pickup & Delivery
Items collected at one stop, delivered to another, same vehicle
Courier, freight, waste, moving
Yes
MDVRP - Multi-Depot VRP
Multiple start/end depots
Regional distribution networks
Yes
HVRP / VRPHF - Heterogeneous Fleet
Mixed vehicle types and capacities
Mixed van/truck fleets
Yes
OVRP - Open VRP
Vehicles don't return to the depot
Contracted / third-party drivers
Yes
SDVRP - Split Delivery VRP
A customer's demand can be split across vehicles
Bulk / high-volume delivery
Yes
DVRP - Dynamic VRP
New orders arrive mid-route; routes replan live
On-demand delivery, dispatch
Yes
EVRP - Electric VRP
Battery range and charging stops
EV fleets
Yes (range/charging as constraints)

Timefold's explicitly covers CVRP, VRPTW, SDVRP, VRPHF and DVRP. The Field Service Routing API and the Pickup & Delivery Routing API extend these into full operational problems.

How do you actually solve a VRP?

Four families of approaches, and where each one fits.

Approach
How it works
Best for
Trade-off
Exact methods (branch-and-cut, column generation, MILP)
Mathematically guarantee the optimal solution
Small, well-defined problems (tens of stops)
Does not scale; impractical for real fleets
Construction heuristics (nearest neighbour, savings / Clarke-Wright, insertion)
Build a decent route quickly, step by step
Fast first solution / initialization
Result is good but not optimal
Metaheuristics (tabu search, simulated annealing, late acceptance, genetic algorithms, Large Neighbourhood Search)
Iteratively improve a solution, escaping local optima
Real-world VRPs at scale with many constraints
Near-optimal rather than provably optimal, which is what production needs
AI / learning-based (reinforcement learning, graph neural networks)
Learn routing policies from data
Emerging, very large or highly repetitive problems
Early-stage; hard to constrain and explain

The practical answer: production routing runs on metaheuristics initialized by construction heuristics. That is exactly how the Timefold Solver works. It combines construction heuristics with metaheuristics like Tabu Search, Simulated Annealing and Late Acceptance, then pairs them with an incremental score engine that evaluates every constraint in real time.

Solving the VRP well pays for itself

−25%
Average travel-time reduction for Timefold customers
5-30%
Cost savings routing tools deliver vs. manual planning
<1 sec
To replan around a real-time disruption
40,000
Jobs optimized in a single Timefold solve

Sources: Timefold customer results; industry range per Springer / VRP literature.

/ How Timefold helps

How Timefold solves the vehicle routing problem

Defined in constraints

Timefold's vehicle routing APIs ship with 100+ pre-configured constraints and stay extensible for the rules unique to your operation, without breaking as you scale from dozens to millions of scheduling decisions. Capacity, time windows, skills, dependencies, SLAs, priorities: combine any of them and the solver optimizes around all of them at once.

01
02

Routing and scheduling, solved together

Assign jobs first and plan routes second, and you lock in a schedule that ignores travel. Timefold solves both together, matching the right jobs to the right vehicles on the most efficient routes in a single optimization pass.

Continuous and real-time planning

Plan the week, month, or year ahead, then continuously roll the horizon forward and optimize only what's new. When reality disrupts the plan (think of a cancellation, a delay, or a new urgent order) Timefold replans in real time, resolving disruptions in under a second.

03
04

Explainable decisions you can trust

Every schedule shows trade-offs and impact, with real-world metrics. Planners and dispatchers see the reason behind each routing decision and can adjust constraint weights with confidence, instead of fighting a black box.

Works with your stack, and any map

JSON in, JSON out. Stateless. Technology agnostic. Timefold slots into your existing systems over a stable REST API, and it never locks you to one map provider. Point it at any source of distance and travel-time data and the Platform handles pre-calculation, updates, throttling, and concurrency.

05

Nothing gets overlooked

A sample of the routing constraints Timefold optimizes out of the box. All are configurable as hard, medium, or soft, with adjustable weights.

Route optimization
Minimize travel time, mileage, and waiting.
Dependencies & sequencing
Prerequisites, mutual exclusions, same-vehicle rules.
Vehicle capacity
Respect load, weight, and volume on every route.
Time windows & opening hours
Serve every stop when it's allowed.
Skills & affinity
Match certifications, equipment, and customer preferences.
Pickup & delivery pairing
Same vehicle, right order, every time.
SLAs & priorities
Honour contractual response times; make optional stops truly optional.
Driver shifts & breaks
Legal hours, start/end locations, rest and lunch.
Multi-resource scheduling
Several vehicles or people on the same visit.
Why Timefold

Built differently from the ground up

Out-of-the-box REST APIs
JSON in, JSON out
No solver expertise required
Production-ready models
Works with any stack
Powered by the Timefold Solver
Constraint-satisfaction engine
Metaheuristics + incremental scoring
Successor to OptaPlanner, 20+ years of heritage
Proven on NP-hard problems in production
Runs on the Timefold Platform
Continuous & real-time replanning
Explainable decisions
Bring any map provider
Enterprise-grade security (SOC 2, ISO 27001, GDPR)
How it works

How does it work?

JSON in, JSON out. Stateless. Technology agnostic.

01 - Send your data
Timefold consumes the data you already have (stops, vehicles, constraints) as structured JSON over a REST API. Fit Timefold into the way you work, and start with sample data or your own.
02 - Solve
Your routing challenge is sent through the API to the stateless constraint solver, which optimizes every constraint at once. No solver expertise required.
03 - Get an optimized plan back
A fully optimized set of routes comes back as structured JSON, ready to render as-is or adjust as things change. Replan in real time, with explainable, metric-backed results.
/ Production-ready models/ No setup required/ Works with any stack via REST API/ Bring your own maps
FAQ

Vehicle routing problem FAQ

What is the vehicle routing problem in simple terms?
The vehicle routing problem (VRP) is the challenge of finding the cheapest set of routes for a fleet of vehicles to serve a group of customers, while respecting real-world limits like vehicle capacity, delivery time windows, and driver shifts.
Is the vehicle routing problem NP-hard?
Yes. The VRP is NP-hard, meaning the number of possible solutions grows factorially with the number of stops, so no algorithm can guarantee the optimal answer quickly for realistic problem sizes. This is why production systems use heuristics and metaheuristics rather than exact methods.
What is the difference between the VRP and the traveling salesman problem?
The traveling salesman problem finds the shortest route for one vehicle visiting every location once. The VRP generalizes this to a whole fleet and adds constraints like capacity and time windows. A VRP is effectively many interacting TSPs solved together.
What are the main types of VRP?
The most common variants are the Capacitated VRP (CVRP), VRP with Time Windows (VRPTW), Pickup & Delivery Problem (PDP/VRPPD), Multi-Depot VRP (MDVRP), Heterogeneous Fleet VRP (HVRP), Open VRP (OVRP), Split Delivery VRP (SDVRP), Dynamic VRP (DVRP), and Electric VRP (EVRP).
How do you solve the vehicle routing problem?
There are four families of methods: exact algorithms (optimal but don't scale), construction heuristics (fast, approximate), metaheuristics (near-optimal at scale, and the production standard), and emerging AI/learning methods. Most real systems combine construction heuristics with metaheuristics.
How much can solving the VRP save?
Routing tools typically report 5–30% cost savings versus manual planning. Timefold customers see an average 25% reduction in travel time after implementation.
What software solves the vehicle routing problem?
Options range from open-source libraries (Google OR-Tools, VROOM) and commercial solvers (Hexaly, Timefold Solver) to full routing APIs. Timefold offers production-ready routing APIs, including Field Service Routing and Pickup & Delivery Routing (in preview), powered by the Timefold Solver.
Can VRP handle real-time changes?
Yes, this is the Dynamic VRP. Timefold supports continuous and real-time planning, replanning around disruptions like cancellations, delays, and new orders in under a second.
Who first defined the vehicle routing problem?
George Dantzig and John Ramser introduced it in 1959 in their paper "The Truck Dispatching Problem," applied to petrol deliveries.
How does Timefold solve the VRP differently?
Timefold solves routing and scheduling together, handles any combination of constraints at any scale, explains every decision, replans in real time, and integrates over a stateless REST API (JSON in, JSON out) without requiring any solver expertise.

When scheduling works, everything works.

Less waste. More control. Teams that trust the plan.