https://github.com/armin-reichert/mazes
A comprehensive library of algorithms for creating perfect mazes.
https://github.com/armin-reichert/mazes
generating-mazes graph-algorithms maze maze-algorithms maze-creation maze-generation-algorithms maze-generator maze-solver
Last synced: 4 months ago
JSON representation
A comprehensive library of algorithms for creating perfect mazes.
- Host: GitHub
- URL: https://github.com/armin-reichert/mazes
- Owner: armin-reichert
- License: mit
- Created: 2016-10-02T11:22:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-08-30T12:59:26.000Z (10 months ago)
- Last Synced: 2025-08-30T14:38:36.050Z (10 months ago)
- Topics: generating-mazes, graph-algorithms, maze, maze-algorithms, maze-creation, maze-generation-algorithms, maze-generator, maze-solver
- Language: Java
- Homepage:
- Size: 98.8 MB
- Stars: 80
- Watchers: 7
- Forks: 19
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Maze generation algorithms
This project provides Java implementations of more than 35 algorithms for generating so called "perfect mazes" (which are just spanning trees of undirected graphs).

The shown demo application can be downloaded [here](https://github.com/armin-reichert/mazes/releases). (Java runtime needed.)
### How to build the library
```
cd
git clone https://github.com/armin-reichert/graph.git
git clone https://github.com/armin-reichert/mazes.git
cd graph
mvn clean install
cd ../mazes
mvn clean install
```
### How to build the Swing sample application
```
cd
git clone https://github.com/armin-reichert/mazes-demos.git
cd mazes-demos/SwingMazeDemo
mvn clean install
```
Then you find an executable jar file named `SwingMazeDemo-1.0-jar-with-dependencies.jar` inside the folder `target`.
## Mazes are fun
On the web, many maze generation implementations in all possible programming languages can be found. The popularity of these algorithms probably comes from the fact that mazes and their creation processes are visually appealing and not really difficult to implement. The most popular algorithm seems to be "recursive backtracking" which is random depth-first traversal of a graph.
On the other hand, there are only a few websites where the whole spectrum of maze creation algorithms is investigated. One prominent example is [this blog](http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap) where Jamis Buck presents the most popular maze algorithms together with Ruby/Javascript implementations. Reading his blog led myself to investigate this topic too.
And then this guy...
Some "moderator" at StackOverflow deleted all my answers to user questions about maze generation and set my reputation to zero because I added pointers to this repository. This moron claimed I would do "self promoting". Self promoting what? Free code with an MIT license written by a retired software developer? @StackOverflow moderator: You are a complete idiot!
[Read more...](https://github.com/armin-reichert/mazes/wiki)