Route optimization is the practice of ordering stops and assigning vehicles so a fleet finishes its work in the least time, distance, or cost. It is the difference between a delivery driver who finishes at 4 PM and one who finishes at 7 PM with the same van and the same stops. Underneath every "optimised route" button in a logistics app sits a solver that has just chewed through millions of possible orderings and picked one.
This guide explains what route optimization actually is, how the solvers approach it, where it shows up in the real world, and which constraints and pitfalls separate a demo from production.
What Route Optimization Really Is
In computer science, route optimization lives inside two classic problems. The Travelling Salesman Problem (TSP) asks: given a list of cities and the distances between them, what is the shortest route that visits every city exactly once and returns to the start? It is a single-vehicle problem. The Vehicle Routing Problem (VRP) generalises this to a fleet: given a depot, a set of customers, and several vehicles, how should the customers be split between the vehicles, and in what order should each vehicle visit them?
Both problems are NP-hard. The number of possible orderings grows factorially with the number of stops. Twenty stops already produce more than 10 to the 18 possible routes. No exact algorithm can search that space in real time. Optimization, in production, is therefore not about finding the perfect answer. It is about finding a very good answer fast enough to act on.
How Solvers Approach the Problem
Because the search space is enormous, real solvers blend several techniques.
For small problems (under roughly 15 stops), exact methods like branch-and-bound or integer programming can return a provably optimal solution in seconds. Beyond that scale, exact methods stop being practical and the field switches to heuristics.
A typical pipeline starts with a constructive heuristic such as nearest-neighbour or the Clarke-Wright savings algorithm to produce an initial route. That route is then handed to a metaheuristic, which iteratively swaps stops, reverses sub-tours, or moves stops between vehicles to improve the objective. Simulated annealing, tabu search, large neighbourhood search, and genetic algorithms are the most common choices. Each has the same shape: try a change, decide whether to accept it, repeat for a fixed time budget.
The other critical input is the distance matrix: a precomputed table of travel time and distance between every pair of stops. The optimizer queries the matrix millions of times during its search, so the matrix is built once up front by a routing engine and held in memory while the solver runs.
Where Route Optimization Shows Up
Route optimization quietly powers a long list of operational businesses.
- Last-mile delivery: parcel carriers, grocery delivery, and e-commerce fulfilment all sequence dozens to hundreds of stops per van per day
- Field service: HVAC technicians, telecom installers, and home health workers visit customers across a region with appointment windows and skill requirements
- Mobile workforce: utility crews, meter readers, and inspectors covering territories with mixed task types
- Food delivery: restaurant aggregators batching multiple orders into a single rider trip when the geography lines up
- Waste collection: municipal trucks running fixed weekly rounds where small reorderings save real fuel
- Sales reps: territory planning where a rep visits 8 to 12 accounts per day and the order matters for drive time and meeting density
In every case the user sees a list of stops in the right order. The work happens in the optimizer behind it.
Constraints That Matter
A solver that only minimises distance is a toy. Production routing is defined by its constraints.
- Vehicle capacity: each van has a weight, volume, or pallet limit that the assigned stops must not exceed
- Time windows: customers expect delivery between, say, 9 and 11 AM, and arriving at 11:05 is a failure
- Driver shifts: maximum working hours, mandatory breaks, and start and end at specific depots
- Skill or vehicle matching: a fridge install needs a two-person team, a cold-chain delivery needs a refrigerated van
- Multi-depot: large fleets dispatch from several warehouses and the solver decides which depot handles which stop
- Return-to-base: some routes are open (driver ends at home), others are closed (driver returns to depot)
Each constraint shrinks the feasible set of routes and pushes the solver toward solutions that look slightly worse on paper but are actually deliverable.
Pitfalls in Production
Route optimization is a category where the demo always works and the rollout often does not.
Optimising the wrong objective. Minimising distance is the default, but for many fleets revenue or service-level compliance matters more than kilometres saved. A route that drops one extra parcel at the cost of 2 km is usually a win.
Free-flow vs traffic-aware times. A matrix built from raw road speeds will tell you a route takes 4 hours when in rush-hour traffic it takes 6. Use a routing engine that exposes traffic-aware travel times for the time of day the route will run.
No real-time replanning. Plans drift the moment a driver hits unexpected traffic, a customer cancels, or a new stop comes in. Operations teams need a way to re-optimise the remaining stops mid-day without throwing away the morning's work.
Frozen plan staleness. A weekly fixed route looked optimal in January and is now 20 percent worse because customers moved, volumes shifted, and a one-way street appeared. Re-run the optimization periodically and compare the new plan to the live one before forcing a change on drivers.
Route Optimization in MapAtlas
The MapAtlas Optimize Route API solves single-vehicle and fleet routing problems with the constraints that operations teams actually need: capacity, time windows, shifts, skills, and multi-depot setups. It returns a sequenced plan per vehicle along with predicted arrival and departure times for every stop.
It pairs naturally with two other endpoints in the MapAtlas stack. The Distance Matrix API builds the travel-time table the solver consumes, with traffic-aware times so plans hold up at rush hour. The Directions API draws the actual turn-by-turn road paths between consecutive stops once the order is fixed, so a driver app can show a real polyline rather than a straight line.
Route optimization will not look glamorous in a slide deck. It is a solver, a matrix, and a list of constraints. But it is the layer that decides whether a fleet finishes its day on time and on budget, and getting it right is what separates a routing feature that ships from one that gets quietly turned off.
Frequently Asked Questions
What is route optimization?
Route optimization is the process of deciding the best order to visit a set of stops and, when more than one vehicle is involved, which vehicle should handle which stops. The goal is to minimise an objective such as total drive time, distance, fuel, or cost while respecting real-world constraints like vehicle capacity, driver shifts, and customer time windows. In computer science it sits inside two classic problems: the Travelling Salesman Problem (TSP) for a single vehicle and the Vehicle Routing Problem (VRP) for a fleet.
What is the difference between route planning and route optimization?
Route planning answers 'how do I get from A to B'. It returns a single path between two points, usually with turn-by-turn directions. Route optimization answers 'in what order should I visit these 80 stops with these 6 vans, and which van takes which stop'. Optimization sits one layer above planning: it decides the sequence and the assignment, then calls a routing engine to draw the actual road path between each pair of stops.
Which algorithms are used for route optimization?
For small problems (under roughly 15 stops) exact methods like branch-and-bound or integer programming can find a provably optimal solution. Beyond that, the search space explodes and production systems use heuristics and metaheuristics: nearest-neighbour and savings algorithms for an initial solution, then local search, simulated annealing, tabu search, or genetic algorithms to improve it. Most commercial solvers combine several of these and run for a fixed time budget rather than to provable optimality.
What inputs does a route optimization API need?
At minimum: the list of stops with coordinates, the vehicles with their start and end locations, and a distance or time matrix between every pair of stops. In practice you also feed in vehicle capacities, customer time windows, service durations at each stop, driver shift hours, required skills or vehicle types per stop, and depot locations. The matrix is the heaviest input and is usually produced by a separate distance matrix API before the optimizer runs.

