O'Reilly logo

Mazes for Programmers by Jamis Buck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Your Turn

So, that’s Dijkstra’s algorithm. As mentioned, it’s not the only way—nor even the fastest way—to solve mazes, but it’s certainly a useful way. We’ve seen how to use it to find a path between two cells. We’ve also seen how it can be used to find a longer (and hopefully more challenging) path through a maze. Finally, we used Dijkstra to color mazes, allowing us to look inside and see their underlying structures.

There’s a lot of room to explore, here. Take some time to fiddle with Dijkstra’s algorithm. Get familiar with it. It’s going to be our faithful companion throughout this book!

If you need some ideas to get started, consider some of these.

Animate Dijkstra’s algorithm.

What if you were to draw the maze at each step of Dijkstra’s ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required