Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: finite maze solving algorithm
Replies: 9   Last Post: Dec 3, 2004 7:09 AM

 Messages: [ Previous | Next ]
 Steven Fuerst Posts: 2 Registered: 12/13/04
Re: finite maze solving algorithm
Posted: Dec 3, 2004 7:09 AM

michalchik@aol.com (Michael Michalchik) wrote in message news:&lt;20f4bb84.0411291905.29b97a1b@posting.google.com&gt;...
&gt; I was wondering if anyone knows if all possible topologies of finite
&gt; 2d mazes can be solved by a finite algorithm.

Yes, they can.

&gt; For example, we know
&gt; that all fully connected mazes can be solved by picking a wall and
&gt; exhaustively following it. Can a general solution work for all mazes
&gt; including the ones that are piecewise disconnected? If this is
&gt; possible, is the general solution a solved problem?

Yes it is. Look for the "Pledge Algorithm". It is well-described in
the book "Turtle Geometry", including a proof for how it solves every
finite maze.

The algorithm works by keeping track of the total amount of turning
you do as you move throughout the maze. Using this purely local
information (you don't need breadcrumbs, or to mark walls etc.) it is
possible to escape.

It is rather simple:

1. Initialize a counter to zero, and define an arbitrary direction to
be 'north'.

2. Move straight north until an obstacle is met.

3. Turn left and follow the obstacle. Keep track of 'total turning'
and increment the counter by +1 for every full 360 degree turn
clockwise, and -1 for every full 360 turn anti-clockwise.

4. Leave the obstacle when it is possible to move straight north and
the counter reads zero. Goto step 2.

Steven

Date Subject Author
11/29/04 Michael Michalchik
11/30/04 Kevin Saff
11/30/04 Keith A. Lewis
11/30/04 Kevin Saff
11/30/04 Michael Michalchik
12/1/04 Kevin Saff