Problem Statement: Personalized Routing Is a Ranking Problem, Not a Shortest-Path Problem
Frames the system as candidate generation plus learned per-driver ranking over a live traffic-aware graph, with a closed feedback loop.
Problem statement
Design a service that, given a driver, an origin, a destination and a departure time, returns a small ranked set of route suggestions optimized for that driver's revealed preferences — fewer unprotected left turns, less highway driving, lower fuel burn, fewer hard-braking corridors, familiar streets — while respecting live traffic, legal restrictions and the platform's fleet-level congestion goals. The service must ingest traffic and incidents in real time, re-suggest while the driver is moving, learn from what the driver accepts and from where the driver deviates, and prove with experiments that the suggestions actually reduce travel time or fuel rather than merely sounding personalized.
The naive answer is 'run Dijkstra with a preference-weighted cost function.' That answer fails three ways at production scale, and naming those failures early is what separates a senior answer from a tutorial answer.
Failure one: the objective is not scalar and not known. 'Comfort' is not a number in the road graph. Two drivers on the same corridor at the same minute legitimately want different routes: a courier who knows every alley wants the shortest legal path; a new driver at night wants arterial roads with signalized crossings. The cost vector is learned per driver from behaviour, and it is estimated with uncertainty, not read from a settings row.
Failure two: personalized graph search does not fit the latency or the compute budget. Contraction hierarchies deliver sub-millisecond queries precisely because the metric is fixed at preprocessing time. The moment every request carries its own weight vector, you lose the preprocessing that made the query fast. Under the assumed peak of roughly 8,700 suggestion requests per second, running a fresh personalized bidirectional search per driver is one to two orders of magnitude more expensive than the platform can afford.
Failure three: the system creates the traffic it predicts. If every driver in a corridor receives the same 'quiet' alternative, the quiet street becomes the jam. Individually optimal suggestions are not fleet-optimal. This is a routing externality, and it also destroys naive A/B testing, because treated and control drivers share the same asphalt.
The architecture that follows from those failures
- Shared candidate generation. A traffic-aware routing tier maintains a small number of shared metrics — fastest, eco, arterial-preferring, toll-free — customized against a versioned traffic epoch. Each request produces K candidates (typically 3 to 5) from those shared metrics using a partition-based engine that supports fast metric customization.
- Per-driver ranking, not per-driver search. Candidates are hydrated into feature vectors (ETA, distance, fuel estimate, unprotected-left count, signal count, highway share, driver familiarity, historical deviation on those edges) and scored by a cheap learned ranker. Personalization lives in a 4-millisecond model call, not in a 400-millisecond graph search.
- Hard constraints stay outside the model. Turn restrictions, truck bans, closed roads, geofences and jurisdiction rules filter candidates before scoring. A model may never learn its way past a legal restriction.
- A closed, bias-corrected learning loop. Suggestions, selections, dismissals and map-matched deviations are logged with the exact epoch, metric, model version and propensity so that offline evaluation is not fooled by the fact that we only ever observe outcomes for routes we chose to show.
- Fleet-aware arbitration. Reroute hysteresis suppresses churn; a dispersion term and road-class protection prevent the optimizer from dumping arterial traffic onto residential streets.
What 'AI' actually means here
Three distinct learned components, each with a different failure posture: a traffic prediction model that fills gaps where probe coverage is thin, a preference model that infers per-driver cost weights from acceptance and deviation, and a ranking model that orders candidates. None of them replaces graph search. Uber Engineering's 2022 DeepETA write-up makes exactly this architectural choice: the routing engine still computes the physical route, and a transformer corrects the residual ETA, because the engine already encodes road-network truth that a model would have to relearn.
Public anchors versus design assumptions
UPS has publicly described its ORION route-optimization programme as saving on the order of 100 million miles and 10 million gallons of fuel per year, and its long-standing operational guidance to minimize left turns is the canonical real-world example of a preference-shaped cost model. Google reported that the first year of eco-friendly routing in Maps prevented more than 1.2 million metric tons of CO2e emissions, which is direct evidence that swapping the objective function changes fleet outcomes measurably. Uber's public earnings reporting for 2024 put trip volume on the order of 30 million trips per day. Every other number in this answer — fleet concurrency, QPS, bytes, latency targets, improvement thresholds — is an explicit design assumption for a fictional platform and is labelled as such.
Key Highlights
- •Personalization belongs in a 4 ms learned re-ranker over K candidates, not in a per-driver graph search at 8,700 requests/s peak.
- •Contraction hierarchies are fast because weights are fixed; per-request weights require partition-based metric customization instead.
- •Hard legal restrictions filter candidates before scoring; a model may never trade away a turn restriction for a better predicted score.
- •Individually optimal routes are not fleet-optimal: dispersion and hysteresis are architecture, not polish.
- •UPS ORION's published ~100M miles and ~10M gallons saved per year is the real precedent for preference-shaped cost models.
Section Rescue Kit
Buzzwords to use:
Safe statements:
- "Let me separate the objective we can compute from the objective we must learn before choosing an engine."
- "I will state which decisions are shared and versioned, and which are per-driver and approximate."