Turning a logistics idea into an experiment
I wanted to find out whether couriers could avoid depot returns by exchanging part of their load around the city. I built a workflow that generates a scenario, searches for routes and exports stops, schedules and vehicle loads. Customers, fleet size, capacity and candidate transfer points can all change between scenarios.
I started from the OR-Tools routing example with depot reloading, then added transfers, a scenario API and comparison tools. Python coordinates the experiments; OR-Tools searches under the model’s constraints. An optional OSRM bicycle matrix supplies road distances and durations alongside the default straight-line approximation.
Making transfers optional and coherent
A transfer joins a deposit and a collection at the same location. I require both stops to be active together, on different vehicles, with the deposit before the collection and a delivery afterwards. These conditions apply only when the point is used, so an unnecessary transfer can be left out.
The model transfers quantities of cargo without tracking individual parcels to their recipients. Candidate locations are fixed within each scenario. Around 700 documented solves did not show a convincing benefit in the single-depot configurations studied. That result helped narrow the conditions under which the original idea should be investigated further.
Comparing quality against computation time
For calibration, I rank solutions by customers served, then the finish time of the last route, then distance. Settings use the same instances and equal search budgets, followed by longer runs.
One apparent saving of 3,186 seconds fell to 76 seconds when the search budget tripled. The setting mainly reached a good solution sooner. I also built comparisons on Solomon reference problems, separating published objectives and checking route feasibility independently of the solver’s score. This makes the benchmark about a defined problem and budget rather than a headline number.
Inspecting the result on a map
A JSON tour document separates computation from the reusable React and Leaflet replay. Visitors can follow movements, deliveries and changes in load. A precomputed corpus supports comparisons across four budgets, from 5 to 60 seconds, while an interchangeable solver handles requests for a new calculation.
The interface gives the measurements a practical use: inspect where a route changes, then connect that change to distance, duration or workload.