Part 1 · Routing
From the CVRP to fuel-aware heterogeneous fleets
The vehicle routing problem asks a simple question: a depot, a set of customers with known demands and a fleet of vehicles; which vehicle visits which customers, in which order, at minimum cost? Simple to state, hard to solve, and the starting point of almost every real logistics model.
This note builds the model in three steps. Each step adds one thing real fleets care about.
Step 1: the capacitated VRP
Let be the depot and the customers , with demands and travel costs . We have identical vehicles of capacity . The binary variable is if some vehicle drives directly from to , and is the load delivered on a route up to and including customer .
The first line says every customer is entered once and left once. The load constraints do two jobs at the same time: they keep each route within capacity, and they rule out subtours, because a cycle that never returns to the depot would need to increase forever.
Step 2: a heterogeneous fleet
Real fleets mix vehicle types: a few large trucks, more small vans. Give each type a capacity , an available count and its own cost, and add the type as an index: is if a vehicle of type drives from to . The changes are mechanical:
- each customer is visited once by some type: ;
- a vehicle that enters a customer leaves it with the same type: ;
- at most routes of type leave the depot: ;
- the load constraints use for routes of type .
Step 3: fuel that depends on load
A loaded truck burns more fuel than an empty one, so the order of stops matters: deliver heavy orders early and the rest of the route is cheaper. A common linear model is fuel per kilometre for a type- vehicle carrying load .
The trick is to stop thinking about load at customers and think about load on arcs. Let be the load carried on arc by a type- vehicle:
The flow balance says each customer keeps exactly its own demand; the bounds tie the flow to the arcs that are actually used and enforce capacity. The objective is still linear. A model from this family, with a heterogeneous fleet, capacity limits and emissions counted as an operating cost, is the one I published in Politeknik Dergisi (2024) and applied to staff shuttle routes. The load-dependent fuel cost above is exactly the objective of Monthly Problem #01.
In practice
- Formulations with load or flow variables have weak LP relaxations. A MIP solver will prove optimality for a few dozen customers; beyond that, expect large gaps.
- Real instances add time windows, driver shifts, speed effects and depot rules. Each is easy to model and each makes exact solving harder.
- The usual workflow: an exact model on small instances to get trusted optimal values, and a metaheuristic for the real size, checked against those values. The exact model is your measuring stick, not your production engine.
Exercises
- Show that a subtour violates the load constraints of Step 1.
- In Step 3, what does the objective reduce to when every ?
- Two vehicle types have the same capacity but different and . Sketch a route where the “cheaper” vehicle is the wrong choice.
Discussion
Questions or corrections? Send me an email.