SoDeep IconSoDeep
·
The logic of 'pathfinding algorithms' for navigating digital maps

The logic of 'pathfinding algorithms' for navigating digital maps

@Nan_Binary · June 22, 2026

Google Maps isn't a psychic; it’s just a very obsessive clerk doing a lot of invisible chores. When you ask for directions, the algorithm behaves like a person testing every floor tile for dampness before stepping. It looks at every intersection and assigns a cost based on distance or traffic.

Instead of seeing the whole route at once, it cautiously explores outward in ripples. It constantly updates its little notebook, ditching slow paths for faster ones until it stumbles upon your destination. It’s a lot of digital faff just to save you two minutes on the way to the seaside.

Wait, how does this clerk actually turn a traffic jam into a 'cost'?

It’s just a simple penalty system, dear. Imagine every street has a price tag. A clear, sunny road is a bargain at one pound, but a nasty traffic jam makes that same street cost fifty.

The clerk adds up the 'price' of every turn. If a route is too expensive because of a crash or roadworks, he simply stops looking that way and hunts for a cheaper shortcut. It’s all about finding the most frugal path for your time.

Goodness, does the poor clerk have to check every single road in England?

He’s not that dim, darling. If you’re heading to Brighton, he isn’t going to waste time checking the price of roads in Manchester. He has a sense of direction.

It’s called a 'heuristic.' Think of it like a compass in his pocket. He only bothers adding up the costs for streets that generally point toward your destination.

If a path starts wandering off the wrong way, he simply crosses it out of his notebook. It keeps the digital faff to a minimum so your phone doesn't overheat while you're packing the sandwiches.

What if that 'wrong' direction is actually the only way across a river?

Oh, you’ve caught him out! If our clerk is too stubborn about his compass, he might lead you straight into a dead-end. This is the risk of being too 'greedy' for a shortcut.

He doesn't actually burn the map for those 'wrong' roads. He just puts them at the very bottom of his 'to-do' list, like those emergency crackers you keep in the back of the pantry.

If his favorite path hits a river with no bridge, he sighs, grumbles about the damp, and starts checking those rejected roads. It’s a bit of a backtrack, but it beats swimming to Brighton.

But how does he decide which rejected road to try first?

He doesn’t just rummage blindly through the pantry, dear. Every road he sets aside gets a little sticky note with a 'misery score'—a combination of how far he’s already trudged and how far his compass says is left to go.

He keeps these notes strictly in order, from the least annoying to the most exhausting. When his bridge is out, he simply looks at the very top of his rejected pile and picks the one that looks the least like a total disaster.

It’s a constant game of sorting and re-sorting his notebook. He’s always chasing the smallest score available, ensuring that even when he's backtracking, he’s doing it with a bit of dignity.

Explore in card mode →

Related topics

How a computer uses 'queues' to handle information in orderThe logic of 'database indexing' for finding information quicklyThe way a computer screen uses pixels to display imagesThe way 'responsive design' makes a website fit any screen sizeThe way a computer uses 'encryption' to keep messages privateThe way 'inheritance' works in object-oriented programming