Dynamic Programming for Path Finding in Grid Terrain - Prof. Michael R. Kowalczyk, Study notes of Algorithms and Programming

A path finding problem where jeff's robot needs to traverse an n by n grid of positive numbers representing the cost to travel through each square. The robot can move forward, diagonal left, or diagonal right, and the goal is to reach the top of the grid with the lowest possible cost. The limitations of brute force and greedy algorithms, and considers the possibility of using dynamic programming to find a polynomial time algorithm for this problem.

Typology: Study notes

Pre 2010

Uploaded on 08/01/2009

koofers-user-qa9
koofers-user-qa9 🇺🇸

1

(1)

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Algorithm Design and Analysis 3/18/2008
Lecture 24: More Dynamic Programming
Instructor: Mike Kowalczyk
1 Path Finding
Suppose that we have a terrain represented by an nby ngrid 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 n2n1and n3n1possibilities; 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)
1 3 77 17
1003 5000 4 1
0 1007 1080 2
1 2 60000 99
1

Partial preview of the text

Download Dynamic Programming for Path Finding in Grid Terrain - Prof. Michael R. Kowalczyk and more Study notes Algorithms and Programming in PDF only on Docsity!

Algorithm Design and Analysis 3/18/

Lecture 24: More Dynamic Programming

Instructor: Mike Kowalczyk

1 Path Finding

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)