Basically “Maze Algorithm” is the brain of a maze game. It randomly generates a “perfect” maze, with only one solution per maze – every stylus press.

http://palib-dev.com/forum/index.php/topic,72.0.html