Maze-solving algorithm: Difference between revisions

Content deleted Content added
Bender the Bot (talk | contribs)
m clean up; http→https for YouTube using AWB
m Wall follower: Tweaked thumbnails to remove bizarre moire effect
Line 8:
== Wall follower ==
[[File:maze01-02.png|left|frame|Traversal using ''Right-hand rule'']]
[[File:MAZE.png|right|thumb|upright=1.5|Maze with two solutions]]
[[File:MAZE solution.png|right|thumb|upright=1.5|Solution to above maze. Notice the solution is the boundary between the connected components of the wall of the maze, each represented by a different colour.]]
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 space|''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.