Posts about backtracking

Playing Minesweeper graphic
Solving Minesweeper in Python as a Constraint Satisfaction Problem

Let's play Minesweeper in Python. In this post we will treat Minesweeper as a constraint satisfaction problem and use common algorithms like constraint propagation and backtracking search to mimic logic we would use to play the game as humans.

Read More
voronoimazecover.png
Python Maze Generator Part II: Voronoi Diagrams

Voronoi diagrams are used in a variety of fields for a variety of reasons, including the art and design world. This post is Part II in a series on mazes, where I will generate and solve random mazes from Voronoi diagrams using Python and Matplotlib.

Read More
sudoku.png
Generating and solving Sudoku puzzles with Python

You might be familiar with Sudoku - the single-player puzzle that involves inserting the numbers 1-9 into a grid in a certain way. In this post we will generate and solve Sudoku puzzles with Python using a depth-first search backtracking algorithm.

Read More
mazeflattened500.png
Generating and Solving Mazes with Python

We've been into mazes for thousands of years. Some can be tricky to navigate, but we can solve them pretty quickly in a few lines of code, using well-known path-finding algorithms. All visualized in matplotlib.

Read More