Java implementation of two maze generation algorithms:
Produces mazes of arbitrary sizes: larger mazes will take increasingly longer to generate.
- Tends to produce long corridors
- Is not a true uniformly random sample over all mazes.
- Substantially faster than Wilson's algorithm.
- Relies on loop-erased random walks.
- Produces a uniform sample over all possible mazes.
- Tends to produce complex, difficult to solve mazes.
Included below are examples in ascending order of size, the maze entrance is at the top left pixel and the exit is at the bottom right in all cases. Try them out!
Depth first search | Wilson's algorithm |
---|---|
![]() |
![]() |
16x16 | 16x16 |
![]() |
![]() |
64x64 | 64x64 |
![]() |
![]() |
256x256 | 256x256 |
Included in the release page is the project JAR file. Run with Java Runtime Environment (JRE) >=14.0. The user interface should appear as follows: