
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Algorithm Design and Analysis 3/18/
Instructor: Mike Kowalczyk
Suppose that we have a terrain represented by an n by n grid of positive numbers, each of which represents the cost for Jeffâs robot to travel through that square. Jeffâs robot can choose to start at any square on the bottom of the grid, and can move forward, diagonal left, or diagonal right. The grid doesnât âwrap aroundâ, and the goal is for the robot to reach the top of the grid with the lowest possible cost of movement. We could try this by brute force, but how many possibilities would we need to consider? Brute force gets us somewhere between n 2 nâ^1 and n 3 nâ^1 possibilities; way too time consuming. Greedy algorithms probably wonât apply becuase there might be a âwallâ of numbers to get through, and something that doesnât look too good at first may turn out to be a better global choice. Is this problem in P? Can we use dynamic programing to find a polynomial time algorithm that outputs such a path? For example, given the grid below, the progam should output something like this:
Total cost 108 Path is (3,3)->(2,3)->(1,2)->(0,1)