Home › Blog › How we loaded 300 packages into 4 trucks in 1.3 seconds

Technical case · July 27, 2026

How we loaded 300 packages into 4 trucks in 1.3 seconds

A complete run with 300 synthetic deliveries spread over the real road network of Querétaro, Mexico. These are the numbers, including the ones that don't flatter the algorithm.

The instance

300 deliveries placed on real nodes of the Querétaro road network extracted from OpenStreetMap, with per-package dimensions and weights ranging from 20 × 15 × 10 cm boxes weighing 400 grams up to 80 × 50 × 40 cm parcels of almost 19 kilograms. A mixed fleet of four vehicles: a high-roof van with a 365 × 139.2 × 164.8 cm cargo area and a 1,900 kg payload, a panel van of 339.5 × 149 × 157 cm and 1,351 kg, and two compact vans of 200 × 150 × 150 cm and 600 kg. Active constraints: minimum support, fragility and LIFO unloading.

Map of Querétaro with the four routes of the run: blue in the center, green to the north, orange to the east and purple to the west, with the distribution center in the middle.
The four routes on the Querétaro road network. Each color is one vehicle; the dark square is the distribution center. Paths are computed along the streets, not as straight lines. Map © OpenStreetMap contributors.

The results

MetricValue
Planned deliveries300
Vehicles used4
Total distance (road network)519.54 km
Total operating costMXN 5,319.96
Average cost per deliveryMXN 17.73
Average volume occupancy60.2%
3D loading time (300 boxes)1.34 s

Per route: 98, 73, 49 and 80 packages, with distances of 138.4, 198.9, 98.6 and 83.6 km. The asymmetry is not a bug: the 98-delivery route covers the dense downtown area, where stops are a few hundred meters apart; the 73-delivery route heads out to the periphery, where every customer costs kilometers.

Packages per routeRoute 1Route 1: 9898Route 2Route 2: 7373Route 3Route 3: 4949Route 4Route 4: 8080Kilometers drivenRoute 1Route 1: 138.4 km138.4 kmRoute 2Route 2: 198.9 km198.9 kmRoute 3Route 3: 98.6 km98.6 kmRoute 4Route 4: 83.7 km83.7 km
More packages does not mean more kilometers. Route 1 delivers 98 packages in 138.4 km inside the dense area; route 2 delivers 73 and drives 198.9 km toward the periphery.

Why occupancy stays at 60%

It's the question everyone asks the first time they see the loading diagram. The answer is geometry, not inefficiency. When every box must have at least 75% of its base supported, nothing heavy may rest on a fragile parcel, and the packages for stop 12 must come out without moving those for stop 13, the truly usable space falls far below the nominal volume.

Isometric diagram of how the 98 packages of route 1 are loaded inside the 365 × 139.2 × 164.8 cm cargo area, with the cab at the back and the door at the front.
Actual loading of route 1: 98 packages, 62.6% occupancy. Color goes from orange (first deliveries, next to the door) to blue and purple (last ones, next to the cab). The visible gaps are the price of giving every box support, keeping heavy items off fragile ones and letting each stop unload without moving the next.

The practical takeaway: if your planning system assumes that an 8.3 m³ vehicle accepts 8.3 m³ of goods, it is building routes the loading dock won't be able to load. We route with a calibrated effective capacity—roughly 51% to 59% of the nominal volume depending on the active constraints—and the result is plans that run without last-minute fixes.

0%25%50%75%100%Nominal volumeNominal volume: 100%100%Effective capacity used for routingEffective capacity used for routing: 51–59%Effective capacity used for routing: 51–59%51–59%Average occupancy achievedAverage occupancy achieved: 60.2%60.2%
What fits is not what the spec sheet says. The engine routes with a calibrated effective capacity and, even so, the average occupancy achieved was 60.2% of the nominal volume.

The cost of geometry

Here is the uncomfortable number. If the same instance is solved as a classic CVRP, ignoring the third dimension, the total distance drops to 431.7 km. In other words, accounting for real loading cost 87.8 extra km, 20% more.

Classic CVRP (no 3D loading)Classic CVRP (no 3D loading): 431.70 km431.7 kmWith real 3D loadingWith real 3D loading: 519.54 km519.5 km+87.8 km · +20%
The price of feasibility. The same instance solved as a classic CVRP drives 431.7 km, but those routes cannot be loaded; with real 3D loading, 519.54 km.

That difference is not a loss by the algorithm: it is the price of feasibility. The 431 km routes exist on paper and cannot be loaded. Any tool that boasts much shorter distances is probably solving an easier problem than the one you have at the loading dock.

What failed and how we fixed it

The first version of the system let the routing engine work with the nominal volume and relied on a mediator to repair unloadable routes afterwards. It worked, but at a cost: in the formal evaluation on the Gendreau instances, the repair achieved feasibility at the expense of 13.7% extra distance, and 36.6% in the worst case.

The change was to move the constraint forward instead of repairing backwards: route from the start with an effective capacity calibrated per variant. In smoke tests the mediator sat idle—zero repairs—and in the loading-only variant the distance fell from 429.6 to 329.3 km. The lesson is old but often forgotten: in combinatorial optimization it pays to charge the constraint in the cost function, not in a later patch.

Reproducibility

The results come from a logged run of the planner, with a shortest-path matrix over the road network, a fuel price of MXN 24.50/L and real fuel economy per vehicle. The map, the loading diagram and the charts in this article (and the site demo) are drawn from that run's data: the diagram shows the exact positions computed for the 98 packages of route 1, not an illustration.

Further reading

The base problem is formulated in what is the CVRP (in Spanish), and the three-dimensional constraints are detailed in 3L-CVRP (in Spanish). If you want to try your own data, the Planner takes a distance matrix and a list of packages.

See LATTIMEX with your own deliveries

In the assessment we measure your current routes and show you, with your own orders, how kilometers, vehicles and loading change.

Request a demo