This piece adapts operational learnings originally published by Francisco Crizul, CTO of Deri, our all-in one logistics company.
One of the problems that comes up again and again in real logistics operations is route optimization.
At first glance, the problem looks simple.
There are a series of orders, several vehicles, and the goal is to find the best routes.
But once a solution stops being a theoretical exercise and has to function inside a real operation, the problem changes completely.
It is no longer just about finding the shortest path.
It is about deciding which orders to assign, to which resource, at what moment, in what order, and under what restrictions.
And all of those decisions are related to each other.
From a routing problem to an operational problem
Classic Vehicle Routing Problem formulations are an excellent foundation for understanding route optimization.
But a last-mile operation usually brings in many more constraints.
Vehicle capacity.
Driver availability.
Time windows.
Service times.
Delivery priorities.
Zone priorities.
Geographic restrictions.
Number and characteristics of orders.
Load balancing.
Deliveries and pickups.
Operating costs.
On top of this comes something that in practice is key: fleet heterogeneity.
Not all vehicles are the same.
Small vehicles, ideal for high urban density or difficult access.
Medium vehicles, which tend to balance capacity and flexibility.
Large vehicles, built for volume and efficiency on long or consolidated routes.
Refrigerated vehicles, where the constraint is not just capacity but also temperature conditions and cargo type.
Enclosed vehicles, which impose additional restrictions on handling, security, and product type.
And within this heterogeneity there is a level of detail that is often underestimated but is critical in practice: the physical configuration of the vehicle.
A vehicle with side doors is not the same as one with rear-only access. Nor is a vehicle with one or two cargo doors the same as another, and neither is the way the cargo compartment is accessed.
This directly affects:
how easy loading and unloading is at each stop,
actual service time,
compatibility with certain delivery points,
and the feasibility of certain order combinations.
Another important operational factor adds to this: the number of axles or «boxes» of cargo the vehicle has.
In practice, this defines how volume is distributed inside the vehicle and how the load can be segmented. Not all orders can coexist in the same physical space in the same way, even if total capacity looks sufficient.
Each of these attributes introduces new dimensions to the problem.
Which orders can be transported.
Which zones can be served.
Which loading and unloading times are realistic.
Which order combinations are compatible.
And which visit sequences are actually executable.
Each of these variables changes the space of possible solutions.
And the more constraints that are added, the more obvious one thing becomes: there is no single function that can perfectly represent the entire operation.
Assignment is also part of optimization
A point that Deri considers fundamental, alongside Diego Bermúdez, is that optimizing a route should not necessarily start with a route.
Decisions about resources have to come first.
For example:
Which orders should be grouped together?
Which driver should receive them?
What type of vehicle is most appropriate (small, medium, large, refrigerated, or enclosed)?
What door and access configuration is compatible with each type of delivery?
Which vehicle has sufficient capacity, and how is that capacity distributed internally?
Which zones should be prioritized?
Which restrictions should carry more weight?
Because of this, the problem can be understood as different levels of decision-making.
First, a possible structure for the operation is determined, and only then are routes optimized within that context.
This allows the system to automatically assign orders to available drivers and vehicles, instead of depending on a person to manually build the entire plan.
The goal is not to replace human decision-making with a single formula.
It is to automate a significant part of the decisions that normally require a lot of time and operational knowledge.
Capacity is not always static
One of the most interesting scenarios appears when deliveries and pickups are combined within the same route.
Imagine a vehicle that starts its route with a certain amount of available capacity.
It makes several deliveries.
As those deliveries are completed, it frees up space.
That space can later be used to make one or more pickups.
So the vehicle’s available capacity changes as the route progresses.
Conceptually, this can be thought of as something like:
Available capacity = initial capacity + deliveries completed − pickups completed
But the real problem is much more complex, because each movement happens at a different point on the route and at a specific moment in time.
A pickup that looks perfectly viable from a capacity standpoint may stop being viable if it happens before certain deliveries.
Because of this, the order of stops also becomes part of the optimization.
This makes it possible to find combinations that would not be obvious if the problem were thought of only in terms of delivery routes.
Prioritizing zones changes the solution
Another interesting aspect is that not all zones necessarily carry the same operational priority.
In a real operation it may be necessary to prioritize certain areas for different reasons.
Commercial commitments.
Order density.
Schedules.
Costs.
Service level.
Characteristics of the operation.
Logistics strategy.
This means that a solution that minimizes kilometers is not necessarily the solution that should be executed.
Consider two solutions:
Solution A
Fewer total kilometers, but lower compliance with operational priorities.
Solution B
Some additional kilometers, but better resource utilization and greater compliance with priorities.
From a purely mathematical standpoint, A might look better.
From a business standpoint, B can be clearly superior.
This is one of the reasons optimizing logistics does not simply mean minimizing distance.
Why a single algorithm is not enough
This was probably one of the most important conclusions to come out of the development process.
When the problem incorporates assignment, capacity, time windows, vehicle types, physical configurations (doors, access, cargo axles), priorities, zones, deliveries, and pickups, trying to solve all of it as a single decision becomes extremely complex.
It is more useful to think in terms of a leveled optimization architecture.
For example:
Level 1: Distribution
Determine how to distribute demand across available resources.
Level 2: Restrictions and compatibilities
Apply capacity, availability, vehicle types (small, medium, large, refrigerated, enclosed), access configuration (side or rear doors), number of axles or cargo compartments, zones, schedules, and operational priorities.
Level 3: Route construction
Generate visit sequences that are feasible.
Level 4: Optimization
Improve those solutions by reducing costs and improving resource utilization.
Level 5: Operational evaluation
Determine whether the solution actually makes sense for the business.
This does not necessarily mean using completely independent algorithms for each stage.
It means understanding that different decisions require different optimization strategies.
The mathematically optimal solution is not always the best one
This is a distinction that matters a great deal.
In engineering it is very easy to become fixated on a single metric.
For example:
«This solution uses 8% fewer kilometers.»
Great.
But what happens if achieving that requires:
assigning too many orders to a small vehicle,
underutilizing a large or refrigerated vehicle,
forcing a load configuration that is incompatible with the vehicle’s access type,
reducing the capacity margin,
generating poorly balanced routes,
compromising a time window,
or making the operation harder to execute?
The metric improved, but the operation may have gotten worse.
That is why last-mile optimization needs to work with multiple objectives and constraints simultaneously.
Optimization has to consider not just what is mathematically efficient, but also what is operationally viable.
From research to a real feature
At Deri, this work has already moved from research and experimentation into an available feature.
The system can currently work with scenarios where:
multiple drivers are available;
orders are assigned automatically;
capacity restrictions exist;
time windows are taken into account;
different vehicle types are considered (small, medium, large, refrigerated, and enclosed);
physical vehicle configurations are taken into account (doors, access, and cargo axles);
certain zones can carry priorities;
deliveries and pickups can be combined;
capacity can change during the route;
and routes are built while accounting for multiple constraints simultaneously.
The feature has already gone through different stages of testing and continues to evolve.
If you are interested in learning how these optimization models are being brought into real logistics operations, Katherine Chelhond, from Deri’s Business Development team, can help you learn more about Deri.
Because once you start solving real cases, new scenarios keep appearing.
And that is exactly what makes it interesting.
Every new constraint forces part of the model to be rethought.
The real challenge
After working on this problem, the conclusion is that the last mile is not simply a routing problem.
It is a problem of assignment, planning, optimization, and decision-making.
The route is only one part of the result.
The real objective is to get available resources (small, medium, large, refrigerated, or enclosed vehicles, with different access and load configurations, drivers, capacity, and time) used in the best possible way to meet the needs of the operation.
Because of this, one idea becomes more convincing over time.
In logistics, it is not about finding the shortest route. It is about finding the best possible decision given all of the operation’s constraints.
And that problem is far from being completely solved.
The interesting part is that it does not need to be.
Every new operation, constraint, or scenario opens up a new opportunity to keep improving the optimization.
Originally posted at: https://www.linkedin.com/pulse/m%C3%A1s-all%C3%A1-de-la-ruta-corta-el-desaf%C3%ADo-optimizar-%C3%BAltima-crizul-opqdf