MAZES - University of Vermont

download report

Transcript MAZES - University of Vermont

Jessica Pearlman, Melissa Ackley, and
Kate Stansfield
What is a maze?
• A maze is an intricate network of
paths, usually designed as a puzzle.
Thus, a maze has branches.
• In order to learn how to solve a maze
we need to learn how to graph a
• A junction is where two or more paths
meet. When graphing mazes you label
all junctions and dead ends with
Transforming a Maze into a Graph
The Wall Follower Algorithm
• If a maze is simple it can be solved using the wall
follower algorithm.
• The goal may be achieved by following a wall
• As you enter the maze, place your left hand on the left
wall and march forward. When you reach a junction
follow the most leftward path. (Left Hand Rule)
• The Right Hand Rule can also be used. Simply use your
right hand to follow the right wall.
The Wall Follow Algorithm
• The wall follower algorithm cannot be used in
a cyclic maze.
- You will arrive back at your original position
and continue to walk in a circle
• The algorithm will always work in a acyclic
Tarry’s Algorithm
Proving Tarry’s Algorithm
Rule 1: Send the token towards any neighbor exactly once.
Rule 2: If Rule 1 cannot be used to send the token, then send the
token to its parent.
When the token returns to the root, the entire graph has been traversed.
Proving Tarry’s Algorithm
Lemma: The token has a valid move until it returns to the root.
Proof (by induction):
(Basis) When the token is at the root, Rule 1 is applicable.
(Inductive case) Assume that the token is at a node i that is not
the root. If Rule 1 does not apply, then Rule 2 must be
applicable since the path from i to its parent remains to be
traversed. It is not feasible for the token to stay at i if that
path is already traversed. So, the token has a valid move.
Conclusion of Proof
• If you follow these rules, you’re
guaranteed to walk each path once in
each direction and never twice in the
same direction
• That guarantees that you’ve visited
every place in the maze and therefore
must have reached the destination
Biggs, Norman L., E. Keith Lloyd, and Robin J. Wilson. Graph
Theory 1736 - 1936. Walton Street: Oxford UP, 1976. Print.
Robert R. Snapp. 5. Threading Mazes. Department of Computer
Science, University of Vermont. 19 September, 2011.
Graphs and Mazes. Durham Gifted and Talented Summer School,
Durham University, August 2009.
Graph Algorithms. Ghosh: Distributed Systems. University of
And thanks to Professor Archdeacon for being a great mentor!
The End
Any Questions?