Route optimization
What is VRP and how algorithms build the optimal delivery route
VRP (the Vehicle Routing Problem) is a mathematical problem about delivering many orders with the least mileage, splitting them across several couriers while respecting constraints: delivery windows, vehicle capacity, working hours. Below is a no-formula explanation of how it works and why a delivery operation should solve it with an algorithm instead of by hand.
In plain terms: what the problem is
Imagine a dispatcher with 80 addresses and 6 couriers in the morning. Two questions have to be answered: which courier carries which orders, and in what order they visit them. The number of possible assignments is astronomical, and a human finds far from the best one by eye. That is exactly VRP: find a set of routes where every order is delivered, constraints are met, and total mileage (or time, or cost) is minimal.
The single-courier special case of VRP is the well-known "travelling salesman problem": in what order should one courier visit all points to return by the shortest path. VRP generalizes it to several drivers and adds real business constraints.
What constraints routing takes into account
A real route is not just the shortest line on the map. A good routing algorithm accounts for:
- Delivery windows — a customer expects the order between 2 and 4 pm, so arriving at 11 am is not allowed.
- Capacity and volume — how many orders physically fit for a courier or into a vehicle.
- Working hours and shifts — the route must fit within the driver's shift.
- Order priorities — urgent and paid express deliveries go first.
- Vehicle type — a walking courier, a bike courier and a car cover the same points differently.
The more of these conditions there are, the more manual planning loses to an algorithm: a person cannot hold dozens of constraints in their head at once.
How the algorithm finds a solution
Checking every option is impossible — there are too many even for a dozen points. So heuristics and optimization methods are used: the algorithm builds a reasonable initial solution and then improves it iteratively — moving orders between routes and within a route until no further improvement is found. Specialized libraries (such as Google's OR-Tools) do this in seconds even for hundreds of points.
Importantly, "optimal" here does not mean perfect in the mathematical sense, but close enough to the best within acceptable time. For a business that is exactly the result needed: the plan is ready by the start of the shift, not by lunch.
What it gives a delivery operation
Automatic routing solves several operational tasks at once:
- less mileage — lower fuel and vehicle costs;
- more deliveries per courier per shift — higher throughput without growing headcount;
- predictable arrival time — more accurate promises to customers and fewer delays;
- load taken off the dispatcher — the plan is built in seconds, not hours.
In itlogist, routing is built into the dispatch loop: orders are assigned to couriers and laid out into map routes with windows and constraints in mind, and the courier sees their sequence of stops in the mobile interface.
→ how routing works in itlogist
FAQ
How is VRP different from the travelling salesman problem?
The travelling salesman problem is about a single route: the order in which one courier visits all points. VRP generalizes it to several drivers and adds constraints: delivery windows, capacity, working hours.
Can routes be planned manually?
For a few addresses, yes. But when there are dozens of points and many constraints, a human finds a far-from-optimal option and spends hours on it. Here an algorithm saves both mileage and dispatcher time.
Does this require expensive software?
The core of the problem is solved by open libraries such as OR-Tools. The value of a product is not the algorithm itself but its integration into the workflow: orders, the map, the courier's mobile app and real business constraints.