<P> Mazes containing no loops are known as "simply connected", or "perfect" mazes, and are equivalent to a tree in graph theory . Thus many maze solving algorithms are closely related to graph theory . Intuitively, if one pulled and stretched out the paths in the maze in the proper way, the result could be made to resemble a tree . </P> <P> This is a trivial method that can be implemented by a very unintelligent robot or perhaps a mouse . It is simply to proceed following the current passage until a junction is reached, and then to make a random decision about the next direction to follow . Although such a method would always eventually find the right solution, this algorithm can be extremely slow . </P> <P> The wall follower, the best - known rule for traversing mazes, is also known as either the left - hand rule or the right - hand rule . If the maze is simply connected, that is, all its walls are connected together or to the maze's outer boundary, then by keeping one hand in contact with one wall of the maze the solver is guaranteed not to get lost and will reach a different exit if there is one; otherwise, he or she will return to the entrance having traversed every corridor next to that connected section of walls at least once . </P> <P> Another perspective into why wall following works is topological . If the walls are connected, then they may be deformed into a loop or circle . Then wall following reduces to walking around a circle from start to finish . To further this idea, notice that by grouping together connected components of the maze walls, the boundaries between these are precisely the solutions, even if there is more than one solution (see figures on the right). </P>

Can you solve a maze by always turning right
find me the text answering this question