Skip to content

The Data Scientist

Reinforcement Learning

Smart Routing, Real Roads: When Reinforcement Learning Outplays Heuristics

Dispatch rooms do not ask for theory; they ask for routes that keep working after the morning rush. By 8:00 a.m., the plan looks tidy. By 8:15, a ramp closes, a high-value pickup appears, and a driver’s scanner goes dark. For years, teams survived those mornings with heuristics — clever rules that stitch tours together fast. They still help. But when the day keeps throwing curveballs, fixed rules start to feel like guesses. Reinforcement learning (RL) offers something different: a policy that keeps learning how to steer through the mess.

Heuristics capture what a sharp dispatcher would do on a typical route. RL absorbs what actually happens across thousands of atypical ones. It balances windows, distance, penalties, and driver limits to maximize the whole day’s outcome, not just the next turn. And crucially, it does so without pinging humans for constant approvals — no more blinking buttons that say ckick here whenever traffic flips or a VIP order lands; the policy adjusts itself and keeps the plan coherent.

Where Rules Break — and Why RL Doesn’t

In calm suburbs with wide delivery windows, a well-tuned heuristic is cheap and cheerful. Real networks, however, rarely stay calm. Travel times breathe with weather, curb space vanishes at lunch, and late orders arrive exactly when crews are short. Local fixes can create global setbacks; a stop served at the “right” moment can block a high-priority pickup an hour later. RL, trained on these realities, learns optionality: sometimes the best move is to wait ten minutes, swap two stops, or take a short detour that unlocks a better afternoon.

Patterns that expose the limits of heuristics:

 

  • Compounding uncertainty. A five-minute delay at Stop 3 ripples through every time window downstream; a locally sensible choice can render the tour infeasible later.
  • Interdependent choices. Serving a nearby stop now may force a costly return to depot or cause a cascade of penalties elsewhere.
  • Dynamic capacity. Same-day orders, no-shows, equipment hiccups, and breaks turn a “morning plan” into a midday wish list.

 

What Reinforcement Learning Adds

An RL agent experiments in a simulator or live environment and receives feedback from a reward that encodes operational goals — on-time-in-full (OTIF), kilometers per stop, driver hours, emissions, and customer priority. Across thousands of episodes, it discovers policies that generalize beyond the exact scenarios seen in training. That means it values the whole day, not just the next turn.

Operational advantages that matter on the floor:

  • Adaptivity in real time. Policies react to telematics, order flow, and traffic without restarting an optimizer from scratch.
  • Global trade-offs. Rewards capture long-horizon value, so a small detour now can protect a high-stakes window later.
  • Anytime decisions. The agent can act feasibly now and refine as horizons shift, which is how dispatchers work under pressure.
  • Policy reuse. A trained policy can bootstrap new depots or regions with minimal returning, shortening rollout cycles.

 

None of this eliminates the value of operations research (OR). High-performing stacks blend them: OR seeds strong initial tours; RL steers continuous adjustments under uncertainty.

A Field-Tested Rollout

Teams that succeed treat RL as an upgrade, not a rip-and-replace. They run a fair bake-off against today’s playbook, then expand where results are clear. The emphasis is on measured steps and visible wins, not grand declarations.

Practical rollout steps:

  1. Define the objective. Translate goals into numbers: penalties for late windows, bonuses for consolidation, and soft costs for driver churn.
  2. Instrument the network. Stream GPS pings, order events, and traffic feeds; log outcomes per route and per decision.
  3. Train in simulation first. Calibrate a digital twin with historical logs; use domain randomization to prepare for tail events.
  4. Go shadow, then live. Run the policy alongside the current heuristic, compare deltas, and flip by depot or region where the uplift is consistent.
  5. Blend with OR. Keep a solver for initial plans; let RL handle re-sequencing, late orders, and exception handling throughout the day.
  6. Close the loop. Feed live data back into training; retire fragile behaviors and promote robust ones based on evidence.

 

What to Measure (Proof, Not Hype)

Executives want numbers, not adjectives. A concise scorecard keeps the program honest and prevents cherry-picking. Track service level (OTIF), window-violation rate, kilometers per stop, driver hours, reroutes per day, and exception-handling time in the control room. If sustainability matters, include CO₂ per kilometer. Also measure operator workload: if clicks and overrides drop while outcomes improve, the policy is doing real work.

Transparency Builds Trust

 

Black-box anxiety is real. Dispatchers and drivers adopt faster when they can see why a suggestion wins: “Swap 7 ↔ 8 to save 12 minutes and preserve the window at Stop 10.” Keep guardrails — hard constraints, a safe mode, audit logs — and give operators override buttons. The result is collaboration: people supervise the system; the system carries the tedium.

Where Heuristics Still Shine

If the map behaves — low variance, generous windows, small fleets — heuristics remain cost-effective. RL earns its keep where the map argues back: dense cities, mixed fleets with strict driver rules, narrow windows, same-day demand spikes, or service promises that actually change customer outcomes. The question is not “RL or heuristics?” but “Which mix fits today’s volatility?”

The Practical Payoff

The first change is the room, not the dashboard. Fewer radio calls. Fewer rebuilds. A supervisor who used to hover over three problem routes now watches one. After a quarter, costs settle lower, late deliveries fall, and afternoons feel less noisy. The plan did not become perfect; it became adaptable. RL does not remove uncertainty from the road; it learns the road’s habits and turns them into better ones for the fleet. In networks where minutes and constraints collide, that habit compounds — routes bend with reality instead of breaking against it, and the day ends closer to the promise the schedule made in the morning.