NelworksNelworks

Tech / Season 1 / EP02

Google Maps

Tweet coming soon
Shez

How... how does it know traffic is 'heavier'?

Shez

I haven't even left the driveway yet. Is there a satellite watching my street?

Kurumi

Satellites are too slow. They update once a day. Traffic changes every second.

Shez

Kurumi! Then how? Is it cameras? Is it the CIA birds spying me on every corner?

Kurumi

Cameras?

Kurumi

You are the camera. You, and the millions of other drivers.

Shez

Me? How?

Kurumi

Google Maps has over 1 billion monthly active users.

Kurumi

Every Android phone, every iPhone with Maps open... they are all sending little pings.

Kurumi

You aren't a person to them. You are a **Probe**.

Shez

That... sounds invasive.

Kurumi

It's anonymized. But yes. You're crowd-sourcing your own traffic report.

Shez

Okay, so it knows current traffic. But it says '28 minutes'. That's a prediction for the *future*.

Shez

How does it know what traffic will be like in 15 minutes when I reach the highway?

Kurumi

Ah. Instead of measuring speed, we decide to predict human behavior.

Kurumi

To predict the future, Google use the ghosts of the past.

Kurumi

They store historical speed data for every road segment on Earth.

Shez

Every road?

Kurumi

Every sampled meter. For years.

Kurumi

They know that on Tuesdays at 8:45 AM, this specific on-ramp slows down to 20mph.

Shez

Okay, but today is worse. Why?

Kurumi

Because the **Graph Neural Network (GNN)** saw a pattern.

Shez

A neural network? Like ChatGPT?

Kurumi

No. A **Graph** network. Think of the city not as a picture, but as a web of connected nodes.

Kurumi

Road A connects to Road B. Road B connects to Road C.

Kurumi

If an accident happens on Road A, the cars don't disappear.

Kurumi

They spill over.

Kurumi

The GNN simulates this 'Shockwave'. It knows that a blockage here causes a slowdown 5 miles away in 10 minutes.

Shez

So it's simulating the domino effect?

Kurumi

Exactly. AKA **'Supersegments'**. It groups chunks of roads together to predict how they infect each other.

Shez

That sounds like a lot of data. Millions of roads. How does the phone search it so fast?

Shez

If I zoom out, it renders the whole world instantly.

Kurumi

Because the map isn't stored as a picture. It's stored as a **Fractal**.

Shez

A fractal?

Kurumi

Drive. We're late. I'll explain **S2 Geometry**.

Kurumi

Computers hate spheres. The math is messy. There's singularities at the poles.

Kurumi

So Google projects the Earth onto a Cube.

Kurumi

Each face is a Quad-tree. This way you can recursively divide it into smaller and smaller cells.

Kurumi

Level 0 is massive. Level 30 is the size of a coin.

Kurumi

Now, the genius part. How do you store a 2D map in a 1D database?

Shez

You can't? It's 2D.

Kurumi

You can. Check out **Hilbert Curve**.

Kurumi

It's a space-filling curve. It visits every cell exactly once.

Kurumi

It turns a coordinate (Latitude, Longitude) into a single long Integer.

Shez

Why does turning it into a line help?

Kurumi

Because computers are great at sorting numbers.

Kurumi

If two numbers are close on the curve, they are close on the map.

Kurumi

To find 'coffee shops near me', the database doesn't scan the whole world. It just scans a tiny range of numbers on the curve.

Shez

Okay, so S2 cells organize the map. GNNs predict the traffic.

Shez

But how does it find the *best* path? There must be a million ways to get to my office.

Kurumi

More than a million. If you used brute force, your phone would melt.

Kurumi

They use **Contraction Hierarchies**.

Kurumi

Imagine calculating every turn on every tiny street between here and Tokyo.

Kurumi

Useless. You don't need to know the residential streets in Osaka.

Kurumi

They pre-calculate 'Shortcuts'. They know that to leave this neighborhood, you *must* pass through one of three exits.

Kurumi

They 'contract' the graph. They ignore the small roads in the middle and only look at the entry/exit points.

Kurumi

It turns a graph of 1 billion nodes into a few thousand important ones.

Shez

It's amazing how it does all this in milliseconds.

Kurumi

It has to. Google Maps handle **millions of requests per minute**.

Kurumi

But there's a flaw.

Shez

A flaw?

Kurumi

The system assumes rational actors.

Kurumi

It assumes people follow the speed limit, or the flow of traffic.

Kurumi

It also assumes the data is real.

Shez

What do you mean?

Kurumi

Have you heard of the '99 Phone Hack'?

Kurumi

An artist put 99 phones in a wagon and walked slowly down an empty street.

Kurumi

Google saw 99 'cars' moving at walking speed. It thought there was a massive traffic jam.

Kurumi

It rerouted real drivers away from a completely empty street.

Shez

So a wagon could trick the algorithm.

Kurumi

It proves the system doesn't know *reality*. It only knows *data*.

Kurumi

To the algorithm, data is truth. Even when it's a lie.

Shez

You know, the probing, the tracking, the prediction. How's that different from getting watched by CIA?

Kurumi

Do you want to be tracked or be late?

Kurumi

Don't ask stupid questions and hurry up.