cover

Smart Flood Navigator

How do GPS apps find the shortest route?
You tap "navigate" and instantly your phone tells you: turn left in 400 feet, arrive in 23 minutes. ~~But how does it kn

You tap "navigate" and instantly your phone tells you: turn left in 400 feet, arrive in 23 minutes. But how does it know? You're asking it to solve a puzzle with thousands of possible paths โ€” every street, every turn, every route through the whole city. If your phone tried them all one by one, you'd be waiting until next Tuesday. Instead, it has a trick.

First, your GPS app sees the world as a **giant connect-the-dots game**. Every intersection is a dot. Every street is a

First, your GPS app sees the world as a giant connect-the-dots game. Every intersection is a dot. Every street is a line connecting two dots, with a number written on it โ€” how many seconds it takes to drive that block. Your starting point is one dot. Your destination is another dot. The app's job: find the cheapest path from dot to dot, adding up all those seconds.

Now here's the trick. The app doesn't try every possible route. It uses an algorithm called ++Dijkstra's++, which explor

Now here's the trick. The app doesn't try every possible route. It uses an algorithm called Dijkstra's, which explores routes like ripples spreading in a pond. It starts at your location and asks: "Which dots can I reach in the next step?" It checks those, picks the fastest one, then asks again from there. It only looks at promising paths โ€” the ones getting cheaper, getting closer.

~~Imagine you're hunting for treasure~~ on an island with a hundred trails. You wouldn't walk every trail to the end and

Imagine you're hunting for treasure on an island with a hundred trails. You wouldn't walk every trail to the end and then compare. You'd start walking, and anytime a trail got steep and slow, you'd backtrack and try a faster one. Dijkstra's does the same thing, but with math instead of feet. It always expands the cheapest route it's found so far, building outward like a smart flood.

But your app does something even cleverer. It doesn't explore everywhere equally. It uses ++A**++ (pronounced "A-star"),

But your app does something even cleverer. It doesn't explore everywhere equally. It uses ++A++ (pronounced "A-star"), which is Dijkstra's with a compass. A knows where your destination is and guesses how far each dot is from the goal โ€” as the crow flies. It prioritizes paths that are both cheap so far and pointing the right direction. It's like the treasure hunt, but you also have a metal detector beeping louder as you get close.

++The app++ also knows secrets about the streets that you don't. It tracks live traffic data from *millions of phones*.

The app also knows secrets about the streets that you don't. It tracks live traffic data from millions of phones. A street that normally takes 30 seconds might take 300 today because of a fender-bender. The app rewrites the numbers on the lines โ€” the weights โ€” in real time, and the algorithm automatically routes you around the jam. The math doesn't care why a street is slow; it just picks a cheaper dot.

~~Here's the wildest part:~~ your phone does all of this โ€” checking thousands of dots, comparing tens of thousands of pa

Here's the wildest part: your phone does all of this โ€” checking thousands of dots, comparing tens of thousands of paths, updating weights from traffic servers โ€” in under a second. The algorithm is so efficient that even a city with 100,000 intersections feels like a small puzzle. It's not magic. It's just that when you explore smart instead of exhaustively, impossible problems become easy.

So the next time your app says ~~"turn right,"~~ remember: it didn't try every route. It didn't guess randomly. It sent

So the next time your app says "turn right," remember: it didn't try every route. It didn't guess randomly. It sent out a clever ripple, followed the cheapest promising paths, and found the answer faster than you could say "recalculating." You're holding a flood that thinks, a treasure hunter that never gets tired, a mathematician that works for free. All so you can get to the taco place three minutes sooner.

How was this book?

A Wonderleaf Book

Smart Flood Navigator

โ€” How do GPS apps find the shortest route? โ€”

Wonderleaf Editions
โ€” ex libris โ€”
A Wonderleaf Book

Smart Flood Navigator

How do GPS apps find the shortest route?

Wonderleaf Editions ยท MMXXVI
Scene 1
You tap "navigate" and instantly your phone tells you: turn left in 400 feet, arrive in 23 minutes. ~~But how does it kn
Smart Flood Navigator2
Scene 1

You tap "navigate" and instantly your phone tells you: turn left in 400 feet, arrive in 23 minutes. But how does it know? You're asking it to solve a puzzle with thousands of possible paths โ€” every street, every turn, every route through the whole city. If your phone tried them all one by one, you'd be waiting until next Tuesday. Instead, it has a trick.

3Smart Flood Navigator
Scene 2
First, your GPS app sees the world as a **giant connect-the-dots game**. Every intersection is a dot. Every street is a
Smart Flood Navigator4
Scene 2

First, your GPS app sees the world as a giant connect-the-dots game. Every intersection is a dot. Every street is a line connecting two dots, with a number written on it โ€” how many seconds it takes to drive that block. Your starting point is one dot. Your destination is another dot. The app's job: find the cheapest path from dot to dot, adding up all those seconds.

5Smart Flood Navigator
Scene 3
Now here's the trick. The app doesn't try every possible route. It uses an algorithm called ++Dijkstra's++, which explor
Smart Flood Navigator6
Scene 3

Now here's the trick. The app doesn't try every possible route. It uses an algorithm called Dijkstra's, which explores routes like ripples spreading in a pond. It starts at your location and asks: "Which dots can I reach in the next step?" It checks those, picks the fastest one, then asks again from there. It only looks at promising paths โ€” the ones getting cheaper, getting closer.

7Smart Flood Navigator
Scene 4
~~Imagine you're hunting for treasure~~ on an island with a hundred trails. You wouldn't walk every trail to the end and
Smart Flood Navigator8
Scene 4

Imagine you're hunting for treasure on an island with a hundred trails. You wouldn't walk every trail to the end and then compare. You'd start walking, and anytime a trail got steep and slow, you'd backtrack and try a faster one. Dijkstra's does the same thing, but with math instead of feet. It always expands the cheapest route it's found so far, building outward like a smart flood.

9Smart Flood Navigator
Scene 5
But your app does something even cleverer. It doesn't explore everywhere equally. It uses ++A**++ (pronounced "A-star"),
Smart Flood Navigator10
Scene 5

But your app does something even cleverer. It doesn't explore everywhere equally. It uses ++A++ (pronounced "A-star"), which is Dijkstra's with a compass. A knows where your destination is and guesses how far each dot is from the goal โ€” as the crow flies. It prioritizes paths that are both cheap so far and pointing the right direction. It's like the treasure hunt, but you also have a metal detector beeping louder as you get close.

11Smart Flood Navigator
Scene 6
++The app++ also knows secrets about the streets that you don't. It tracks live traffic data from *millions of phones*.
Smart Flood Navigator12
Scene 6

The app also knows secrets about the streets that you don't. It tracks live traffic data from millions of phones. A street that normally takes 30 seconds might take 300 today because of a fender-bender. The app rewrites the numbers on the lines โ€” the weights โ€” in real time, and the algorithm automatically routes you around the jam. The math doesn't care why a street is slow; it just picks a cheaper dot.

13Smart Flood Navigator
Scene 7
~~Here's the wildest part:~~ your phone does all of this โ€” checking thousands of dots, comparing tens of thousands of pa
Smart Flood Navigator14
Scene 7

Here's the wildest part: your phone does all of this โ€” checking thousands of dots, comparing tens of thousands of paths, updating weights from traffic servers โ€” in under a second. The algorithm is so efficient that even a city with 100,000 intersections feels like a small puzzle. It's not magic. It's just that when you explore smart instead of exhaustively, impossible problems become easy.

15Smart Flood Navigator
Scene 8
So the next time your app says ~~"turn right,"~~ remember: it didn't try every route. It didn't guess randomly. It sent
Smart Flood Navigator16
Scene 8

So the next time your app says "turn right," remember: it didn't try every route. It didn't guess randomly. It sent out a clever ripple, followed the cheapest promising paths, and found the answer faster than you could say "recalculating." You're holding a flood that thinks, a treasure hunter that never gets tired, a mathematician that works for free. All so you can get to the taco place three minutes sooner.

17Smart Flood Navigator

~ finis ~

Tiny picture books for big little questions.

โ€” a small constellation of questions โ€”
โœฆWonderleaf
Editions