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.

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.
Similar articles
On-Demand ServicesWebSockets vs. HTTP: Why Real-Time Apps Fail Under Pressure
On-demand apps live or die on real-time UX. Choosing between WebSockets, SSE, and long polling — and operating them well — is the difference at scale.
On-Demand ServicesStripe Connect: The Secret to Frictionless Multi-Vendor Payouts
Multi-vendor payouts look simple until you ship them. Stripe Connect makes the pattern viable — provided you respect the operational and compliance load it brings.
Logistics & TransportationAI in Logistics: Moving Beyond Simple Route Optimization
Route optimisation is the surface layer. The real value comes from AI orchestrating dispatch, capacity, and service-level promises end to end.