Mazes in Python: Store and Solve

In the first half of the course, you built your maze using an object-oriented approach, and you’ve visualized it using scalable vector graphics (SVG). That’s worth celebrating! But the work isn’t done.

In the second half of this video course, you’ll learn how to:

  • Define a specialized binary file format to store the maze on disk
  • Transform the maze into a traversable weighted graph
  • Use a graph search algorithm in the NetworkX library to find the solution.

00:00 Mazes in Python Part 2: Storing and Solving. If you are up for a little challenge and would like to take your programming skills to the next level, then you’ve come to the right place. In this two-part video course, you’ll practice object-oriented programming, amongst several other good practices, while building a maze solver project in Python.

00:22 In the first part of this course, you learned how to use an object-oriented approach to store the maze and how to visualize it using SVG. In this second part, you’ll complete the project.

00:34 You’ll learn how to define a specialized binary file format to store the maze on disk, transform the maze into a traversable weighted graph, and use a graph search algorithm in the NetworkX library to find the solution.

00:49 To get the most out of this course, you should have completed part one on building and visualizing the maze, as this course will build on the code and project structure created in it.

01:00 Don’t forget to download the course materials and make use of them. There are a number of mazes included, which you’ll be able to use when you’ve completed the maze storage code, and the completed code is always a useful resource. If you get stuck, you can compare your code with the final code to see where an error is.

01:20 Any code you see running in the REPL will be using the bpython interpreter. This is a replacement Python interpreter that offers a number of enhancements, including code highlighting and suggestions.

01:30 But any code you see running on-screen will work in the standard Python REPL, which is typically accessed by typing python or python3 at your terminal or command-line prompt.

01:42 So now you know how you’ll be completing your maze solver project, let’s get started.

Become a Member to join the conversation.