Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Lab Manual For Database Development

Authors: Rachelle Reese

1st Custom Edition

1256741736, 978-1256741732

More Books

Students also viewed these Databases questions

Question

Mark each of the following statements true or false:

Answered: 1 week ago