The road network is a directed graph — one-way streets are edges that only exist in one direction. Before any ordering happens we run Dijkstra's algorithm from every stop to build a cost matrix:
Live road speeds and one-way detours are baked into C, so C[i][j] ≠ C[j][i] in general. The van's position is stop 0 and the hub is pinned as the forced final stop.
From wherever you are, always drive to the closest remaining parcel. Repeat until none are left, then return to the hub.
Runs in O(n²) time — effectively instant. But it is myopic: grabbing the nearest parcel now can strand the route far from everything else, forcing expensive final legs. In the worst case the tour can be a log-factor longer than optimal, and the return-to-hub leg it never planned for is where it usually pays.
This is why the other two cards are usually cheaper — the % saving shown in the stats panel is measured against this strategy.
Start from the nearest-neighbour tour. Pick two positions i < j and reverse the segment between them:
On a symmetric network you'd only re-price the two cut edges. Ours is asymmetric (one-way streets), so reversing also flips every interior leg — we re-price the whole candidate tour:
Try all O(n²) segment reversals; accept any that reduces cost; repeat until a full pass finds no improvement. The hub stays pinned as the final stop throughout — the return leg is part of every comparison.
Terminates at a local optimum: no single reversal can improve it. That eliminates the crossings you'd see in the greedy route, but it can still be trapped — a better tour may exist that requires temporarily making things worse. Escaping such traps is exactly what annealing adds.
The other three strategies inherit a fixed split of parcels between vehicles (a zone allocator ported from our LmfHub simulator: a polar sweep around the hub, chunked into capacity-limited work packages). But the best split depends on the routes, and the best routes depend on the split. Optimising them separately leaves savings on the table at every zone boundary.
Add assignment variables to the ordering ones:
with penalties so every parcel is carried exactly once and no vehicle exceeds its capacity. This is one bigger QUBO: for a real fleet it reaches tens of thousands of binary variables, which is exactly the regime where GPU annealing-class solvers and quantum annealers are aimed.
In the browser we anneal the same objective directly: starting from the zone split, random parcel reassignments are accepted by the Metropolis rule (always if fleet drive time drops, with probability exp(−ΔE/T) if it rises) under a geometric cooling schedule, re-touring the affected vehicles at each step. It is the same annealing family the QUBO backends run; on the Python service the equivalent binary QUBO is handed whole to GPU simulated bifurcation or a D-Wave machine, and nothing upstream changes.
A single simulated day tells you what today costs. Resilience asks a harder question: across everything that could go wrong, what is the chance the day fails, and what do the worst days look like?
Each scenario day samples disruptions — street closures (the network is re-checked for stops that become unreachable), city-wide or corridor congestion surges, demand spikes, a vehicle off the road — then re-plans the whole day with the same allocation and 2-opt tour engine the live sim uses, and records what was delivered and how long it took.
Streets are ranked by fragility: the average unserved demand and delay attributed to the days on which that street was closed.
After the stress test, the at-risk demand map becomes a siting problem: place k standby vehicles at candidate sites so the expected at-risk demand within reach is maximised, across the whole scenario ensemble. This is a covering QUBO — one binary per candidate site, geographic couplers, a single choose-k constraint — the problem shape that fits directly on today's quantum annealers (unlike dense routing QUBOs). It is the same formulation North Wales Police piloted with D-Wave for police vehicle placement, made stochastic — and the same maths whether the asset is a spare van, a gritter, an ambulance or a counter-drone sensor.
Estimating a tail probability to error ε needs about 1/ε² sampled days classically, but about 1/ε queries with quantum amplitude estimation. A 1-in-10,000 compound failure needs ~10⁸ classical days but ~10⁴ quantum queries. Rare failures are exactly what resilience planning cares about, which is why this workload is our research track with the Hartree Centre for early fault-tolerant machines.
Treat total drive time as the energy of a physical system:
The same problem in QUBO form — binary switch xi,p = "stop i sits at position p" — is what a quantum annealer or GPU bifurcation machine minimises:
The two penalty terms (weight A) enforce "each stop once, each slot once" — breaking a rule always costs more than any legal tour. This identical formulation feeds our Python solver's neal, OpenJij, simulated-bifurcation and D-Wave backends.
Propose a random segment reversal, compute ΔE, then apply the Metropolis rule:
Early on, temperature T is high and the walk happily goes uphill — that's how it escapes the local optima that trap 2-opt. Cooling is geometric:
As T → 0 the acceptance rule hardens into pure greed and the system freezes into a low-energy tour, which we then polish with 2-opt — the classical post-processing step of the hybrid pipeline, exactly as QATO ran it.
Quantum annealing follows the same recipe but replaces thermal jumps with quantum tunnelling through cost barriers, cooling the transverse field instead of temperature. Because the QUBO above is solver-agnostic, this card's strategy can be swapped for a real annealer without touching anything upstream.