Maze-solving algorithm: Difference between revisions

Content deleted Content added
Trémaux's algorithm: rewrite case to work correctly for the start config
Line 35:
* Mark each path once, when you follow it. The marks need to be visible at both ends of the path. Therefore, if they are being made as physical marks, rather than stored as part of a computer algorithm, the same mark should be made at both ends of the path.
* Never enter a path which has two marks on it.
* If you arrive at a junction that has no marks (otherexcept thanpossibly for the one on the edgepath by which you entered), choose an arbitrary unmarked path, follow it, and mark it.
* Otherwise:
** If the path you came in on has only one mark, turn around and return along that path, marking it again. In particular this case should occur whenever you reach a dead end.