OPTIMISATION
IN PRODUCTION
Vehicle Routing & Optimisation Engine
A pickup-and-delivery engine planning 2,000-stop routes under twelve hard constraints, built independently and exposed to agents over MCP.
- C++
- ALNS
- gRPC
- Docker
- Solve time
- 143s → 30s
- Provider calls
- 1,225 → 174
- Tests gating CI
- 257
Solve time
Provider calls
Tests gating CI
The constraint
Real logistics does not fail on distance. It fails on everything wrapped around distance — a vehicle that cannot enter a zone, a pickup that has to happen before its delivery, a shift that ends before the last stop. An engine that optimises distance and ignores those produces plans dispatchers stop trusting.
- Capacity
- Time windows
- Shifts
- Vehicle compatibility
- Precedence
- Zones
- Max stops
- Max duration
- Incompatible cargo
- Breaks
- Backhaul
- Store capacity
TWELVE HARD CONSTRAINTS · A PLAN VIOLATING ONE NEVER LEAVES THE ENGINE
Solve pipeline
REQUEST
Visits, fleets, capacities, shifts and constraint configuration arrive over REST, with a caller-supplied time limit the solver must respect.
What changed
143s→30s
End-to-end solve time
Routing and optimisation pipeline rework, on typical 60–70 task workloads.
235s→52s
Distance-matrix acquisition
Bounded worker pool replaced barrier-synchronised fetching.
1,225→174
Provider calls per request
Hilbert-ordered spatial pruning removed redundant lookups.
0 routes→13s
1,720-stop request
An unbounded construction phase returned nothing; per-route batch commits route every stop.
Solved plan
Route viewer
3 VEHICLES · MATRIX 693ms · SOLVE 1864ms · UNASSIGNED 0
VEHICLE 2000
LOAD 6/12
8.8 km
39m
14 STOPS
| # | STOP | TYPE | ARRIVE | SERVICE | PALLETS |
|---|---|---|---|---|---|
| 1 | P1 | pickup | 00:00 | 120s | +1 |
| 2 | P3 | pickup | 00:02 | 120s | +1 |
| 3 | P8 | pickup | 00:04 | 120s | +1 |
| 4 | P2 | pickup | 00:06 | 120s | +1 |
| 5 | P9 | pickup | 00:08 | 120s | +1 |
| 6 | P0 | pickup | 00:10 | 120s | +1 |
| 7 | D0 | delivery | 00:12 | 120s | -1 |
| 8 | P4 | pickup | 00:14 | 120s | +1 |
| 9 | D3 | delivery | 00:20 | 120s | -1 |
| 10 | D4 | delivery | 00:23 | 120s | -1 |
| 11 | D9 | delivery | 00:26 | 120s | -1 |
| 12 | D2 | delivery | 00:29 | 120s | -1 |
| 13 | D8 | delivery | 00:33 | 120s | -1 |
| 14 | D1 | delivery | 00:37 | 120s | -1 |
ENGINE OUTPUT FROM A DEMO REQUEST. STOPS ARE SYNTHETIC; THE SOLVE IS REAL.
Engineering
- TEST SUITE
- 257 GoogleTest cases across unit, integration and endpoint suites, run under ctest in CI. Shipped via a multi-stage Docker build so the runtime image carries the binary rather than the toolchain.
- COST
- Routing moved onto GraphHopper and search onto Pelias, cutting the per-plan API bill without losing plan quality.
- INTEGRATION
- Webhook callbacks POST finished plans to the caller. An MCP server exposes the engine to Claude Code, Claude Desktop and IDE extensions.
- OPERATIONS
- A route viewer renders a solved plan onto a map. SIGSEGV, SIGABRT, SIGFPE, SIGILL and SIGBUS are caught and logged rather than dying silently.