Algorithms

The Math Behind the Match: Architecting High-Speed Dispatch Algorithms

Dispatch is the heart of every on-demand product. Doing it well is a deeply quantitative problem — and the wrong abstraction will sink the product before launch.

1 min read
Algorithmic dispatch matching and routing visualisation

Dispatch looks simple in a demo: match the order with the closest worker. In production, simple closest-first matching produces worse outcomes than any operations researcher can stomach.

#1Why naive greedy matching fails

Greedy matching ignores opportunity cost. A driver dispatched to a nearby short ride may be unavailable for a more valuable distant ride seconds later. The system optimises a local move and a global loss.

#2Defining the objective function honestly

The hardest part of dispatch is not the algorithm — it is admitting what the system should optimise. Customer ETA? Driver earnings? Network throughput? Most products want a weighted blend, and the weights have to be transparent.

#3Picking the right model class

  • Bipartite matching with deferred acceptance for small markets.
  • Mixed-integer optimisation for batched dispatch windows.
  • Reinforcement learning at very large scale when reward functions are well understood.

#4Production engineering around the algorithm

Dispatch math earns its keep only if the engineering around it is rock-solid: fast geospatial indexing, deterministic deadlines, idempotent retries, and observability into every match decision.

The takeaway

Great dispatch is the multiplier on every other investment in an on-demand business. Treat it as a product surface — engineered, measured, and continuously improved.

Frequently asked questions

How long should a dispatch decision take?
Most production systems target under 300ms end-to-end, including geospatial query and matching computation. Beyond that, the experience degrades materially.
Should drivers see the matching logic?
They do not need to see the algorithm, but they need to see fairness. Explain outcomes to drivers in product UX so they trust the system.
Keep reading

Similar articles