The anatomy of mazes

What kinds of mazes there are, how they are built and how they are solved. Every drawing here is generated by code, and every maze can be walked.

Mazes and labyrinths in their pure form. No monsters, no treasure: only walls, passages and the way out.

Enter a random maze
Maze of the day, November 25, difficulty 13.9

Basics

  1. 01
    Labyrinth vs maze

    Two words that look like synonyms but name two different kinds of puzzle.

Maze types

  1. 01
    Maze types

    Eight kinds of maze, sorted by the shape of their cells and by the way their passages connect.

Math

  1. 01
    The perfect maze

    Why a maze without loops is a tree, and what that tells you about solving it.

  2. 02
    Measuring a maze

    Dead ends, junctions, the length of the path and McClendon's complexity and difficulty, computed from the mazes drawn on the page.

Maze generation

  1. 01
    Depth-first search

    The recursive backtracker, one of the simplest ways to carve a perfect maze and the one behind every maze you can walk on mazeness.