mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210spring2012/mazes.pdf · mazes are...

20
Mazes March 2012 Mazes March 2012 1/12

Upload: lelien

Post on 21-Aug-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Mazes

March 2012

Mazes March 2012 1/12

Page 2: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Mazes are often difficult to solve because it is hard to distinguishdead ends. Identifying, and then ignoring, dead ends will result in apath through the maze. Mazes appear to be difficult in part becausethey cause one to make lots of turns, even when you don’t actuallyhave to choose one direction or another.

By representing a maze as a graph, we have a method to be able toignore the turns which only complicate the look of a maze.

Mazes March 2012 2/12

Page 3: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Mazes are often difficult to solve because it is hard to distinguishdead ends. Identifying, and then ignoring, dead ends will result in apath through the maze. Mazes appear to be difficult in part becausethey cause one to make lots of turns, even when you don’t actuallyhave to choose one direction or another.

By representing a maze as a graph, we have a method to be able toignore the turns which only complicate the look of a maze.

Mazes March 2012 2/12

Page 4: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

To represent a maze as a graph, we need to focus on what is theimportant information of a maze. The turns which are forced upon uswithout requiring us to make a decision are not important. What weneed to consider are the junctions where we have a choice of a turn.

We represent a maze as a graph by letting the vertices be thejunctions; those spots where we have a choice of a direction to turn.We also include the start and finish of the maze.

Two vertices are connected with an edge if you can get from one toanother without crossing any other junction. In other words, if you gofrom one junction to another without having the choice of making aturn, then those two junctions are connected with an edge.

Mazes March 2012 3/12

Page 5: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

To represent a maze as a graph, we need to focus on what is theimportant information of a maze. The turns which are forced upon uswithout requiring us to make a decision are not important. What weneed to consider are the junctions where we have a choice of a turn.

We represent a maze as a graph by letting the vertices be thejunctions; those spots where we have a choice of a direction to turn.We also include the start and finish of the maze.

Two vertices are connected with an edge if you can get from one toanother without crossing any other junction. In other words, if you gofrom one junction to another without having the choice of making aturn, then those two junctions are connected with an edge.

Mazes March 2012 3/12

Page 6: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

To represent a maze as a graph, we need to focus on what is theimportant information of a maze. The turns which are forced upon uswithout requiring us to make a decision are not important. What weneed to consider are the junctions where we have a choice of a turn.

We represent a maze as a graph by letting the vertices be thejunctions; those spots where we have a choice of a direction to turn.We also include the start and finish of the maze.

Two vertices are connected with an edge if you can get from one toanother without crossing any other junction. In other words, if you gofrom one junction to another without having the choice of making aturn, then those two junctions are connected with an edge.

Mazes March 2012 3/12

Page 7: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

How to Draw the Graph of a Maze

Mazes March 2012 4/12

Page 8: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

First draw all possible paths. Those are shown in blue in the figurebelow to the right.

Mazes March 2012 5/12

Page 9: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

First draw all possible paths. Those are shown in blue in the figurebelow to the right.

Mazes March 2012 5/12

Page 10: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Next, erase the boundaries, leaving only the paths. This is notnecessary, but can help to do the next step.

Mazes March 2012 6/12

Page 11: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Next, erase the boundaries, leaving only the paths. This is notnecessary, but can help to do the next step.

Mazes March 2012 6/12

Page 12: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Mark all the junctions, including the start and finish. Recall that thejunctions are the vertices of the graph.

Mazes March 2012 7/12

Page 13: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Mark all the junctions, including the start and finish. Recall that thejunctions are the vertices of the graph.

Mazes March 2012 7/12

Page 14: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Draw the edges by connecting two vertices only if you can get fromone to the other without crossing another junction. Drawing theedges as straight lines makes the situation as simple as possible.

Mazes March 2012 8/12

Page 15: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Draw the edges by connecting two vertices only if you can get fromone to the other without crossing another junction. Drawing theedges as straight lines makes the situation as simple as possible.

Mazes March 2012 8/12

Page 16: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Dead ends can be represented as short paths that don’t end at avertex. Alternatively, they can be ignored, especially if it is clear whatare dead ends.

Mazes March 2012 9/12

Page 17: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Dead ends can be represented as short paths that don’t end at avertex. Alternatively, they can be ignored, especially if it is clear whatare dead ends.

Mazes March 2012 9/12

Page 18: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Graph and Solved Maze

Mazes March 2012 10/12

Page 19: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

Once you have the graph, find a path from the start to the finish.Comparing the graph and the original drawing of paths will then giveyou a route through the maze.

Mazes March 2012 11/12

Page 20: Mazes - sierra.nmsu.edusierra.nmsu.edu/morandi/oldwebpages/math210Spring2012/Mazes.pdf · Mazes are often di cult to solve because it is hard to distinguish dead ends. Identifying,

The mazes shown in class today were created at the web sitehereandabove.com/maze

Mazes March 2012 12/12