Lecture 33 - University at Buffaloerdem/cse331/spring20/lectures/lect33.pdfLecture 33 CSE 331 Apr22,...
5
Lecture 33 CSE 331 Apr 22, 2020
Transcript of Lecture 33 - University at Buffaloerdem/cse331/spring20/lectures/lect33.pdfLecture 33 CSE 331 Apr22,...
![Page 1: Lecture 33 - University at Buffaloerdem/cse331/spring20/lectures/lect33.pdfLecture 33 CSE 331 Apr22, 2020. Give feedback! Shortest Path Problem Input: (Directed) Graph G=(V,E)and for](https://reader034.fdocuments.us/reader034/viewer/2022052013/602aa1702cf73312b355735a/html5/thumbnails/1.jpg)
Lecture 33
CSE 331Apr 22, 2020
![Page 2: Lecture 33 - University at Buffaloerdem/cse331/spring20/lectures/lect33.pdfLecture 33 CSE 331 Apr22, 2020. Give feedback! Shortest Path Problem Input: (Directed) Graph G=(V,E)and for](https://reader034.fdocuments.us/reader034/viewer/2022052013/602aa1702cf73312b355735a/html5/thumbnails/2.jpg)
Give feedback!
![Page 3: Lecture 33 - University at Buffaloerdem/cse331/spring20/lectures/lect33.pdfLecture 33 CSE 331 Apr22, 2020. Give feedback! Shortest Path Problem Input: (Directed) Graph G=(V,E)and for](https://reader034.fdocuments.us/reader034/viewer/2022052013/602aa1702cf73312b355735a/html5/thumbnails/3.jpg)
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
100
-1000
899
s t
Shortest path has cost negative
infinity
Assume that Ghas no negative
cycle
![Page 4: Lecture 33 - University at Buffaloerdem/cse331/spring20/lectures/lect33.pdfLecture 33 CSE 331 Apr22, 2020. Give feedback! Shortest Path Problem Input: (Directed) Graph G=(V,E)and for](https://reader034.fdocuments.us/reader034/viewer/2022052013/602aa1702cf73312b355735a/html5/thumbnails/4.jpg)
When to use Dynamic Programming
There are polynomially many sub-problems
Optimal solution can be computed from solutions to sub-problems
There is an ordering among sub-problem that allows for iterative solution
Richard Bellman
![Page 5: Lecture 33 - University at Buffaloerdem/cse331/spring20/lectures/lect33.pdfLecture 33 CSE 331 Apr22, 2020. Give feedback! Shortest Path Problem Input: (Directed) Graph G=(V,E)and for](https://reader034.fdocuments.us/reader034/viewer/2022052013/602aa1702cf73312b355735a/html5/thumbnails/5.jpg)
Today’s agenda
Bellman-Ford algorithm