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.
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.