Building Convenient Driving Routes

kkalmutskiy5 Sep 2023

Problem

A navigation service builds the fastest route with A* over a road graph, but the fastest route can be one nobody drives: it cuts through courtyards, uses broken roads or needs awkward turns. Real preferences (road quality, familiarity, avoided intersections, speed errors on some roads) are unknown in advance. The search scans tens of thousands of edges per request, so a heavy model cannot sit inside it.

Example from the article: the route on the left is faster than the one on the right but passes through courtyards.

Solution in brief

Divide each edge's travel time by a weight derived from the probability that users drive that edge when a route through it is built. The probability is estimated offline from stored route and GPS-track pairs. Weights are updated iteratively until probabilities are high, because the probabilities depend on the algorithm that uses them. The same idea is applied to turns, and changes are checked with A/B tests on implicit-feedback metrics.

Questions this case answers
  • How to learn from logged recommendations and the user's actual behavior which options people reject, and feed that back into a ranking cost function without a heavy model at serving time
  • How to tune weights iteratively when the signal being learned depends on the algorithm that uses the weights
  • How to make a navigation service build routes that drivers actually follow, not just the fastest ones?
  • How to learn which road segments and turns users avoid from past routes and GPS tracks?

Tools and methods

  • A* on a road graph — minimum-cost path; the cost is a penalized pseudo-time, not ETA
  • Soft penalties — roundabouts, broken roads, barriers, turns
  • Edge and turn driving probability — offline averages over route and track pairs, used as weights
  • Iterative weight updates (gradient descent) — repeated until probabilities are high
  • A/B test on implicit feedback — time on route, covered length, rebuild count
Continue reading — it's free

Google or a one-time email code. No password.