Lecture 38 CSE 331 Dec 7, 2009

advertisement
Lecture 38
CSE 331
Dec 7, 2009
The last few days
Today: Solutions to HW 9 (end of lecture)
Wednesday: Graded HW 9 (?), Sample final, Blog post on the final exam
Friday: HW 10 due, solutions to HW 10 out, last lecture
Monday (Dec 14): Review session, solutions to sample final
Wednesday (Dec 16): Final exam
Friday (Dec 18): Graded Finals and HW 10
When to use Dynamic Programming
There are polynomially many sub-problems
Richard Bellman
Optimal solution can be computed from solutions to sub-problems
There is an ordering among sub-problem that allows for iterative solution
Shortest Path Problem
Input: (Directed) Graph G=(V,E) and for every edge e has a cost ce (can be <0)
t in V
Output: Shortest path from every s to t
1
1
899
100
s
Shortest path has
cost negative
infinity
-1000
t
Assume that G
has no negative
cycle
Today’s agenda
Dynamic Program for shortest path
Group talk time:
Come up with a
recursion
May the Bellman force be with you
Download