Maze solution #1 The Random Approach - Hsanokklis/2023-2024-Tech-journal GitHub Wiki

Approach #1: Random-walk

It may seem like a crazy approach, but a viable algorithm can often include randomness. Consider this algorithm for solving a maze:

Move forward until there is either a left or right turn or a dead end. If there is a left or right turn, choose a random direction. If you are at a dead end turn around The advantage of this approach is:

It is simple to specify and implement There is no “state” to remember. We don’t need to draw or look at drawn lines in the maze The disadvantage of this approach is that it may take a very long time!

image