Hugo Simoes
simple living, careful thinking, collective fun


Blog

Category: Maze

Pledge algorithm

The Pledge algorithm can help you walk around obstacles and escape 2D mazes where the exit is located at the outer edges.

Escape using the Pledge algorithm

You can now find the Pledge algorithm implemented in Prequel and use it to help Theseus escape the labirinth.

July 31, 2020
Maze, Prequel

Without Ariadne

How about you? How would you escape the labirinth without Ariadne's string?

Would you walk around randomly, risking to run out of energy before making your way out?
Or do you have a better strategy?

Unlike labirinths found in the puzzles section of newspapers and magazines, Theseus did not have a map to provide him with a bird's-eye view of the problem.
This is the setting for my most recent challenge: the information required to find the exit is not immediately available...
Instead, it must be gathered as you move step by step through the maze, touching the walls to determine whether the path continues forward or to the left or to the right.

Maze - bird's-eye view Maze - Prequel bot view

Once you play enough times, consider coding your way of solving it in Prequel, creating a Prequel bot.

The generated mazes cannot be solved by a simple wall follower strategy.
However, since the exit is always located at the outer edge of these 2D mazes, the Pledge Algorithm is suitable to solve them efficiently.

Currently, there are two Prequel bots on the GitHub repository, both are variants of a random walk.
Pull requests for Prequel bots with different strategies are welcome.

Test your maze solving skills here.

April 8, 2020
Maze, Prequel


Categories:
Archives: