Back to Blog

Engineering

Dispatch Algorithms That Learn From Every Run

Marcus Okafor 9 min read
Engineers reviewing dispatch performance charts on a monitor

An isolated-run dispatch system discards its most useful asset after each shift: evidence about how your routes actually behave. Current routes reveal which corridors slow at specific hours, which stops exceed their default service estimates, and which courier-to-zone pairings deliver more consistent results.

That knowledge reaches the next day's assignments only when the system is designed to retain and use it. Most systems do not.

What One Run Reveals

Every completed delivery creates a small signal. One is the gap between estimated and actual service time at an address. Another is the difference between projected and actual travel time on a corridor. A third is whether a courier's route changed mid-run, and by how much.

Each signal is noisy by itself. A stop may run long because the customer was not ready. A corridor may slow because of a one-time closure. Across dozens of runs over several weeks, though, patterns appear. Some stops take 25 percent longer than the default repeatedly. Some corridors run slower on Wednesday afternoons. Some couriers perform better in dense neighborhoods than suburban zones.

Better Defaults From Patterns

The main use of accumulated data is refining baseline estimates. If the default service time for a stop category is 3 minutes, but your data shows an average of 4.2 minutes for that type in a neighborhood, the next assignment there should use the revised figure. Accurate baselines produce routes that meet their windows.

Transit estimates follow the same pattern. If a mapping API predicts 8 minutes for a corridor segment but your fleet averages 11 minutes there during afternoon hours, routes based on 8 minutes will routinely fall short. Updating the estimate narrows the difference between planned and actual delivery performance.

Zone Affinity and Courier-Stop Matching

Accumulated data also shows where particular couriers work best. Someone who regularly serves a dense commercial corridor learns its parking patterns, loading dock access, and building entry logistics. The algorithm cannot know those details upfront, but it can observe consistently better service times over time.

Assignment logic can include an affinity signal without complex machine learning. A basic weighted score using historical zone performance can improve assignments by directing experienced couriers to areas where their familiarity provides a measurable benefit.

Creating the Feedback Loop

A learning dispatch architecture begins with capturing and storing completion data. At minimum, each delivery provides two useful values: the estimated completion time when assigned and the actual completion time recorded with proof of delivery. Their difference is the signal. A positive difference, meaning the stop took longer than estimated, across multiple stops in one zone or category marks the start of a pattern.

The difficult part is aggregation cadence. Data from one run is too noisy to guide action. Stop times vary for reasons unrelated to the zone: a customer taking three minutes to answer, a double-parked vehicle on a busy afternoon, or an occupied building elevator. Carrying one run's outliers into the next day's plan adds noise instead of removing it. For a zone with moderate volume, meaningful signal typically requires two to three weeks of operating data. Lower-volume zones need a longer window, or keep the default until reaching a minimum sample threshold.

In practice, after the final route closes each night, the system recomputes zone and stop-category averages from the trailing data window. When an observed average differs from the current estimate beyond a set threshold, the estimate is updated. The next morning's assignments use those values instead of static defaults.

Avoiding Overfit in Low-Sample Zones

Learned parameters can overfit. If a zone has only four or five data points, and those runs were unusually fast, its learned estimate will be too optimistic. A courier serving that zone under normal conditions may then miss the window by more than under the original default.

The usual fix combines a minimum sample threshold with confidence weighting. Below the threshold, typically 15 to 20 completed stops in a zone, the learned average receives only partial weight and blends with the global default. At 5 stops, the blend might be 80 percent default and 20 percent observed. At 15 stops, the weights reverse. At 30 stops, the observed average takes full weight. This keeps early, possibly unrepresentative data from driving aggressive changes.

For operators entering a new delivery zone, this means the first few weeks use default parameters. That is expected, not a failure. The system is recognizing that it lacks enough data to improve on the baseline. Set the baseline conservatively, giving learning room to converge as familiarity grows instead of starting optimistically and raising the estimate after missed windows.

How Pattern Insights Appear in the Dispatcher View

A learning dispatch interface should provide value without requiring manual setup. The clearest signal is that zones with established learned parameters produce more predictable routes than zones still using defaults. Showing which zones rely on calibrated data gives dispatchers a practical planning aid: routes through calibrated zones can run tighter, while uncalibrated zones need more schedule buffer.

A common failure is displaying raw pattern statistics that dispatchers must interpret. Saying, "Zone 7 average stop time is 4.2 minutes with a standard deviation of 1.8 minutes," is accurate but not useful for daily decisions. The actionable output is that Zone 7's estimate is now 4.2 minutes and tomorrow's routes use it. The dispatcher needs no configuration.

The Limits of Learning From Your Own Data

A system trained on its own operating history has one important limitation: it can optimize only for conditions already observed. A new closure, construction that changes building access, or seasonal traffic shift at the start of a major event season will not appear in historical data until affecting a run for the first time.

That does not make historical learning a mistake. It means history should inform routing, not serve as the only input. Real-time traffic and courier-position data provide the event correction that past patterns cannot anticipate. Combining calibrated historical baselines with live adjustment is more reliable than either alone. History improves default assignments on typical days. Real-time data handles deviations that historical data could never predict.

Dispatch That Improves as Your Fleet Runs

Bevylle captures data from every run and automatically uses it in future assignments. Start a free trial and see the difference in week two.