Grid navigation with Dijkstra (and hamburgers)

Zorb takes the long way around when hamburgers make it faster. Our new tutorial shows how to build that kind of grid navigation with Dijkstra’s algorithm:

Try it here:

Yo, this is super cool! Lowkey, I’ve always seen Dijkstra’s mentioned but never really dug into how it works with actual visuals. The Zorb example makes it click.

Same here — the name always sounded more intimidating than the idea. The bit that finally made it click for me is that Dijkstra isn’t hunting for the shortest path, it’s hunting for the cheapest one.

That’s why the Zorb grid works so well as an example. A short route through mud can lose to a longer detour over free hamburgers, and once you see the costs add up like that, the whole “keep the cheapest route found so far” thing stops feeling abstract. It’s basically just being stubborn about not settling for a route until you’ve checked whether a cheaper one exists.