# How Google Maps Works in Real Time

How Google Maps turns phone location probes into live traffic colours, predicts the speed of each road segment ahead of you, and ranks routes by estimated arrival time\.

By Samaran

Topic: Computing, AI &amp; Electronics

[Open the interactive Jig](https://ask.jig.com/j/I1zlijPt6j8C)

## Transcript

### 1. Live traffic is a forecast

Each road on this illustrative network is a sequence of segments carrying a live speed estimate\. The overlay you see is only the input: Maps also predicts the conditions a driver will meet on each segment at the time they reach it, then ranks candidate routes by that ETA\.

Drag empty space to turn the table\. Network, speeds and routes are illustrative; Google does not publish its thresholds\.

### 2. Probe data from phones

Phones with location sharing enabled report anonymised GPS positions; Google derives speeds along road stretches from consecutive fixes\. Trip start and end points are deleted, and anomalous vehicles such as frequently stopping delivery vans are filtered out before aggregation\.

Source: Google, "The Bright Side of Sitting in Traffic" \(2009\), via Wikipedia "Google Traffic"\.

### 3. Segment state

Fixes are map\-matched to segments and aggregated into a current speed per segment\. The overlay encodes speed relative to free flow: green normal, orange slower, red congested, dark red stop\-and\-go; a segment with too little data carries no overlay\.

Colour classes follow the public Maps legend; numeric speed thresholds are not published\.

### 4. Live is not enough

Live speeds describe now, but a driver reaches a segment 10, 20 or 50 minutes into the trip\. The ETA model therefore combines live conditions with historical traffic patterns for that road, time and day\. Move the horizon to see the illustrative jam spill upstream and the arterial recover\.

DeepMind, "Traffic prediction with advanced Graph Neural Networks", 3 Sep 2020\.

### 5. Supersegments as graphs

Adjacent segments with significant traffic are grouped into supersegments, from 2 segments up to hundreds of nodes\. Each segment becomes a node; an edge joins segments that follow each other on the same road or meet at an intersection\. Training samples are drawn in proportion to traffic density\.

Nodes are segments, not intersections: the graph is the line graph of the road network\.

### 6. Message passing

A graph neural network updates every node from learned messages sent by its neighbours, round after round\. That locality captures spillover from a jam into upstream and side streets, turn and merge delays, and stop\-and\-go traversal, with one model serving every supersegment size\.

It replaced one fully connected model per supersegment \(millions of models\) and RNNs, which fit road structure poorly\.

### 7. Routes ranked by ETA

The routing system proposes candidate routes between origin and destination\. Predicted traversal times for the supersegments along each route are combined into an ETA, and candidates are ranked by it before the result reaches the app and the Maps API\.

Ranking order shown: brightest is fastest\. Route geometry is illustrative\.

### 8. Measured impact

Before the GNN, predictive ETAs were already accurate for over 97% of trips\. In production the GNN reduced negative ETA outcomes by 16% in London and Copenhagen up to 51% in Taichung, and by 40% or more in cities such as Sydney\.

Gains are fewer negative ETA outcomes, not seconds saved\. Derrow\-Pinion et al\., CIKM 2021, arXiv:2108\.11482\.
