Decision Atlas
LOGLogistics & transportationStop 6 of 10
  1. Transportation fundamentals
  2. Transport planning & TMS
  3. Lane & mode optimization
  4. Load building & consolidation
  5. Carrier selection & freight tenders
  6. Vehicle routing & last mile
  7. Fleet sizing & mix
  8. Intermodal & drayage
  9. Warehousing & throughput
  10. ETA prediction & shipment visibility

Vehicle routing & last mile

Planning delivery routes to many doors with limited vehicles and time windows, and why the last mile is the costliest leg.

3 min gist, 11 min in full Draft, review pending

Read atChange any time

Which van visits which customers, in which order, within everyone's time window.

A distributor in Pune has 8 vans and 120 kirana stores to deliver to today. Each store orders a different amount, some can only receive goods before 11 am, and each van holds a limited load. Which van visits which stores, in what order?

That is the vehicle routing problem (VRP). Its simplest relative, the travelling salesman problem (TSP), finds the shortest loop through every stop for one vehicle. The VRP adds what real life brings:

  • vehicle capacity (weight, volume, crates),
  • time windows (deliver between 8 and 11 am),
  • driver hours, breaks and shift limits,
  • multiple depots, vehicle types and pickup-and-delivery combinations.

The number of possible routes explodes as stops are added, so exact solutions are only practical for small problems. Real systems use heuristics: classic ones like the Clarke-Wright savings algorithm, which starts with one trip per customer and keeps merging the pairs that save the most distance, plus modern search methods that improve routes step by step. They find very good routes in seconds, even if not provably perfect.

The last mile, the final leg to a home or shop, is usually the most expensive part of delivery per unit: many small drops, parking, waiting, and failed deliveries when nobody is home. Companies cut it with route density (more drops per street), delivery time slots, lockers and pickup points, and dark stores close to customers.

Words to use

VRP
Vehicle routing problem: design routes for a fleet to serve customers at minimum cost under constraints.
Time window
The period during which a customer can receive a delivery.
Savings algorithm
Clarke-Wright heuristic: merge routes in the order that saves the most distance.

The Clarke-Wright savings algorithm worked by hand on four customers, time windows, and the economics of drops per route.

The savings idea

Start by serving every customer with its own trip from the depot. Joining customers ii and jj into one route saves the trip back to the depot and the trip out again:

sij=d0i+d0j−dijs_{ij} = d_{0i} + d_{0j} - d_{ij}

Sort all pairs by saving, and merge them in that order whenever the merge keeps the route within capacity and joins customers at the ends of their routes.

Worked example: four customers, vans of capacity 10

Distances from the depot: A 10, B 12, C 15, D 11 km. Between customers: A–B 5, A–C 14, A–D 18, B–C 9, B–D 20, C–D 12. Demands: A 4, B 3, C 5, D 6.

Savings, largest first: B–C 18, A–B 17, C–D 14, A–C 11, A–D 3, B–D 3.

  1. B–C (18): join into depot–B–C–depot, load 8. Accepted.
  2. A–B (17): adding A would make the load 12. Rejected.
  3. C–D (14): adding D would make 14. Rejected.
  4. A–C (11): load 12. Rejected.
  5. A–D (3): join into depot–A–D–depot, load 10. Accepted.

Separate trips would cover 2 × (10 + 12 + 15 + 11) = 96 km. The two routes cover 36 + 39 = 75 km, saving 21 km (the 18 + 3 of the accepted savings). Here that happens to be the best possible plan with two vans.

The method is simple enough to run by hand, which is why it is still taught. Modern routing software starts from solutions like this and improves them with search methods that move and swap stops between routes.

Time windows change everything

If customer B can only receive before 9 am and C only after 2 pm, the B–C route that saved the most may become impossible, or force a long wait. Time windows, driver hours and loading times are added as constraints, and they often matter more to the final plan than distance.

Drops per route drive last-mile cost

A van costing ₹3,000 a day delivers at ₹100 a drop with 30 drops, and ₹50 a drop with 60. Failed deliveries are expensive because they consume a drop slot and come back for another one. Time slots, delivery notifications and pickup points all aim to raise successful drops per route.

The family of routing problems, how modern solvers work, why density beats distance, and dynamic routing for on-demand delivery.

A family of problems

Since Dantzig and Ramser framed the “truck dispatching problem” in 1959, the vehicle routing problem has grown many variants:

  • Capacitated (CVRP) and with time windows (VRPTW).
  • Pickup and delivery, where items are collected and delivered within the same route, as in courier collections.
  • Multi-depot and heterogeneous fleet versions.
  • Periodic routing, where customers need visits on certain days of the week.
  • Dynamic routing, where orders arrive during the day and routes change in real time.

How solvers work

Exact methods, such as branch-and-price, can prove optimality for problems with up to a few hundred customers, given time. Practical systems mostly use metaheuristics (tabu search, adaptive large neighbourhood search, genetic algorithms) that repeatedly destroy and rebuild parts of a solution, reaching near-optimal routes for thousands of stops in minutes. The quality of the input data (road travel times by hour, service times at stops, accurate time windows) usually matters more than the choice of algorithm.

Density beats distance

A classic result in probability (Beardwood, Halton and Hammersley, 1959) says that the shortest tour through nn random points in an area AA grows in proportion to nA\sqrt{nA}. So the distance per stop shrinks as stops get denser: doubling the number of deliveries in the same area increases total route length by only about 41%. That is the mathematical reason last-mile delivery gets cheaper with density, and why companies fight for more orders per neighbourhood rather than more neighbourhoods.

Dynamic routing for on-demand delivery

Food and quick-commerce deliveries arrive continuously and promise minutes, not days. Dispatch decides, every few seconds, which rider takes which order, whether to batch two orders going the same way, and whether to wait a moment for another order to batch. Waiting improves efficiency but risks the promise, the same consolidation trade-off at a much faster pace.

Plans that drivers follow

Drivers know local realities the model doesn’t: a lane closed for a market, a customer who is only in after lunch, a gate that opens late. Routes that ignore this get overridden. Collecting driver feedback, learning actual service times from tracking data and measuring plan adherence keep plans realistic.

Interview kit

Practise it out loud

Answer each question yourself before opening the model answer.

Say it in 30 seconds

The vehicle routing problem assigns customers to vehicles and sequences stops to minimize distance or cost, subject to vehicle capacity, time windows and driver hours. Because the problem grows explosively, practical systems use heuristics like Clarke-Wright savings plus improvement searches. In last-mile delivery, the biggest levers are route density, time slots, avoiding failed deliveries, and pickup points or local fulfilment.

What is the difference between the TSP and the VRP?

The TSP finds the shortest single route visiting every stop once. The VRP plans routes for several vehicles at once, with constraints such as capacity, time windows and driver hours, so it decides both which stops go on which vehicle and in what order.

How would you reduce last-mile delivery cost for an e-commerce company?

Increase drops per route through density and batching, offer delivery slots and pickup points or lockers, cut failed deliveries with better address data and customer communication, place inventory closer to customers, and choose vehicles suited to the area, such as two-wheelers in dense cities.

Connected stops

Where this idea feeds in, or gets its inputs from.

Sources and further reading

  1. Toth, P. & Vigo, D. (Eds.) (2014). Vehicle Routing: Problems, Methods, and Applications (2nd ed.). SIAM.
  2. Clarke, G. & Wright, J. W. (1964). Scheduling of vehicles from a central depot to a number of delivery points. Operations Research, 12(4), 568–581.
  3. Dantzig, G. B., & Ramser, J. H. (1959). The truck dispatching problem. Management Science, 6(1), 80–91.

Reading settings

Saved on this device. Changes apply as you choose them.

Theme
Text size
Typeface for reading
Line spacing
Line length
Start each topic at

Deeper levels stay one click away whichever you choose.

Preview

Safety stock covers the surprises while you wait for a delivery. It grows with the square root of lead time, not with lead time itself.

Lines

↑ ↓ move ↵ open Topics marked “Soon” open their line