Question: A robot is exploring Mars. Mars is a dangerous place, with many pits and holes. The robot needs to carefully explore Mars while minimizing the
A robot is exploring Mars. Mars is a dangerous place, with many pits and holes. The robot needs to carefully explore Mars while minimizing the risk of falling into a pit. Human experts provided a 2-dimensional matrix representing a map of Mars. The value of each cell in the matrix represent the risk (or cost) of exploring this area of mars. For example, consider the 2D matrix below The goal is for the robot to explore from the bottom left corner to the upper right, corner while minimizing the risk, i.e. the summation of all the costs for all the cells passed from source to destination. The robot is only allowed to move right, up, to upright diagonal. In the above example, the best path is highlighted. 1. You need to design an efficient algorithm (based on dynamic programming) that solves the above problem in general (for any matrix of size mxn). 2. Analyze the complexity of the algorithm, assuming the matrix is of size mxn
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
