Question: 5 ( 2 0 pts . ) Greedy maze You are in a 2 - dimensional maze, looking for the exit. You know your current

5(20 pts.) Greedy maze
You are in a 2-dimensional maze, looking for the exit. You know your current position in the
maze and the position of the exit in terms of Cartesian coordinates. At each cell of the maze,
you can observe only the neighboring cells. If there is no wall preventing your move, you may
move up, down, left or right by a cell.
See the example above. You are at cell marked 'C' trying to get the exit marked 'E'. Among
the 4 options, the cell to your right is blocked by a wall. Cells marked '?' are un-observable
from your current position. This means any cell with '?' might reveal a wall later on.
Consider the following greedy heuristic for exiting the maze. From your current position, you
always move to an available cell that minimizes the distance from the exit. For the example
above, this implies either moving up or down. Moving left would increase the distance to 'E'.
Assume that when there are multiple permissible moves, one will be picked randomly.
Answer the following for this algorithm.
(a)(7 pts.) Argue that this algorithm indeed is greedy.
(b)(7 pts.) Assuming there is one, does this strategy always yield a solution? Prove mathe-
matically or disprove by with a counter-example.
(c)(6 pts.) Is this strategy optimal? Prove mathematically or disprove by with a counter-
example.
In parts (b) and (c), if you pick to prove with a counter-example, give a full configuration
including to starting position 'C', the exit 'E' and all the walls.
 5(20 pts.) Greedy maze You are in a 2-dimensional maze, looking

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!