Inspiration

When one delivery van runs late, a dispatcher can ask another driver to help. That only works if both vans can reach the same place, the helper has room, and the rescued parcels arrive without making the helper late on its own route. Route software can re-plan a whole fleet; we focused on that one decision in the dispatcher's worst hour.

What it does

Spareline replays a group of real delivery vans from the same depot and day, applies a clearly labelled simulated disruption, and shows which packages will now miss their delivery window or the driver's shift. It then searches for a rescue: which van helps, where the two drivers meet, which stops move and in what order. It compares that plan with doing nothing and with sending the nearest van.

If a rescue holds up, the dispatcher approves it and each driver gets a revised stop list (CSV and a phone view). Nothing counts as transferred until both drivers confirm. If no transfer is safe, Spareline says so and why: the helper would be late, the van is full, or the gain disappears when cross-route travel runs slow.

How we built it

  • Data: the Amazon Last Mile Routing Research Challenge evaluation split (2018 routes, CC BY-NC 4.0), downloaded from the public S3 bucket. We formed 160 same-depot, same-day groups of 2 to 4 vans: 397 routes and 94,229 packages.
  • Solver (Python + Google OR-Tools): replays each van in its observed stop order using that route's own historical travel times, then searches helpers × meeting points × whole-stop transfers. OR-Tools re-sequences the helper while keeping its own stops in their original order, so any gain comes only from where the moved stops go. An independent checker verifies every plan: every package assigned exactly once, no van overfilled, both vans present before the handoff, time only moving forward.
  • Travel between routes: the dataset only has travel times within a route, so we estimate cross-route legs from distance, fitted on development routes. On 424,165 held-out pairs the mean error is 59.9 s and the 80% range covers 81.1%. A rescue is only recommended if it still helps with every cross-route leg at its slow (q90) estimate.
  • App: FastAPI and Postgres in Docker on a VPS, Next.js and MapLibre on Vercel. 34 backend tests and 24 browser tests at four screen widths, plus CI on every push.

Challenges we ran into

  • No cross-route ground truth. We publish the estimator's held-out error, and require every rescue to survive slow travel instead of claiming exact times.
  • Our first delay model was wrong. It held the late van in place, so any helper had to wait out the whole delay at the meeting point, and no long delay was ever rescuable. Modelling delay as "X minutes behind plan, still driving" fixed it.
  • The data had traps. Only 7.1% of packages carry a delivery window. In 99.1% of stops with several packages, every package repeats the same service time, so summing them would roughly triple stop times. Stop IDs also repeat across routes.

Accomplishments that we're proud of

  • On 456 scenarios fixed in advance (114 held-out depot-days), Spareline missed 23,593 packages, against 24,474 doing nothing and 24,889 sending the nearest van, out of 195,279.
  • It never did worse than doing nothing, and made helpers miss 0 of their own packages. The nearest-van policy made helpers miss 14, or 129 when cross-route travel ran slow.
  • It held back in 280 of the 354 risky scenarios. We publish the 4 scenarios where the nearest van did better.
  • p95 solver time is 3.65 s.

What we learned

A transfer that rescues the late van can still make the fleet worse. Much of the value is in saying no clearly and showing why, and in publishing the misses next to the wins.

What's next for Spareline

Test on real concurrent van GPS data and measured travel between routes, then pilot with a consenting delivery operator on licensed data. Today it is a research replay: historical routes, simulated disruptions, no field validation.

Built With

Share this project:

Updates

Submission history