Algorithm for maze generation with no dead ends?

Fejuto picture Fejuto · Sep 10, 2011 · Viewed 10.4k times · Source

I'm looking for a maze generation algorithm that can generate mazes with no dead ends but only a start and end. Like this:

maze

Image from http://www.astrolog.org/labyrnth/maze/unicursl.gif

Where do I find or go about constructing such a maze generation algorithm?

Answer

Ian Mercer picture Ian Mercer · Sep 10, 2011

It sounds like you want a pseudo-random space filling curve (for example, see Context-based Space Filling Curves -EUROGRAPHICS ’2000 (PDF format, 1.1 MB))

Take a look a Space-filling curve.

I suspect you could apply some randomness to the construction of one of these to achieve what you want.