Prim's Algorithm Maze Generation
Prim's AlgorithmThis algorithm creates a new maze from a grid of cells. To begin, choose a random starting cell and add it to the maze (shown in white). Add all adjacent cells to a list of "border cells," shown in light blue in the applet.
- Randomly choose a border cell and add it to the maze.
- Randomly choose a wall between the newly added cell and any cell that's already in the maze to remove.
This applet was last updated July 2019.