Special Events Next Week Newsletter No. 12 Friday 12th May ...
Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday...
-
Upload
hollie-karen-rich -
Category
Documents
-
view
218 -
download
1
Transcript of Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday...
![Page 1: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/1.jpg)
Lecture 38
CSE 331Dec 2, 2011
![Page 2: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/2.jpg)
Review Sessions etc.
Atri: (at least ½ of) class next Friday
Jiun-Jie: Extra office hour next Friday
Jesse: Review Session on Mon, Dec 12 (pick time slot on blog)
Temp grades hopefully sometime next week
![Page 3: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/3.jpg)
Homework 10
Posted on the blog
![Page 4: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/4.jpg)
Backchannel open today
![Page 5: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/5.jpg)
Need volunteers for today
![Page 6: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/6.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
Shortest path has cost negative
infinity
Assume that G has no negative
cycle
Assume that G has no negative
cycle
![Page 7: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/7.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 8: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/8.jpg)
Recurrence Relation
OPT(i,u) = cost of shortest path from u to t with at most i edges
OPT(i,u) = min { OPT(i-1,u), min(u,w) in E { cu,w + OPT(i-1, w)} }
Path uses ≤ i-1 edgesPath uses ≤ i-1 edges Best path through all neighbors
Best path through all neighbors
![Page 9: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/9.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 10: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/10.jpg)
Today’s agenda
Finish Bellman-Ford algorithm
Analyze the run time
Group talk time:Natural order among OPT(i,u)
values?
Group talk time:Natural order among OPT(i,u)
values?
![Page 11: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/11.jpg)
The recurrence
OPT(i,u) = shortest path from u to t with at most i edges
OPT(i,u) = min { OPT(i-1,u), min(u,w) in E { cu,w + OPT(i-1, w)} }
![Page 12: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/12.jpg)
Some consequencesOPT(i,u) = shortest path from u to t with at most i edges
OPT(i,u) = min { OPT(i-1,u), min(u,w) in E { cu,w + OPT(i-1, w)} }
OPT(n-1,u) is shortest path cost between u and tOPT(n-1,u) is shortest path cost between u and t
Group talk time:How to compute the shortest path between s and t given all
OPT(i,u) values
Group talk time:How to compute the shortest path between s and t given all
OPT(i,u) values
![Page 13: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/13.jpg)
Longest path problem
Given G, does there exist a simple path of length n-1 ?
![Page 14: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/14.jpg)
Longest vs Shortest Paths
![Page 15: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/15.jpg)
Two sides of the “same” coin
Shortest Path problem
Can be solved by a polynomial time algorithm
Is there a longest path of length n-1?
Given a path can verify in polynomial time if the answer is yes
![Page 16: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/16.jpg)
Poly time algo for longest path?
![Page 17: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/17.jpg)
P vs NP question
P: problems that can be solved by poly time algorithms
NP: problems that have polynomial time verifiable witness to optimal solution
Is P=NP?Is P=NP?
Alternate NP definition: Guess witness and verify!Alternate NP definition: Guess witness and verify!
![Page 18: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/18.jpg)
Proving P ≠ NP
Pick any one problem in NP and show it cannot be solved in poly time
Pretty much all known proof techniques
provably will not work
Pretty much all known proof techniques
provably will not work
![Page 19: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/19.jpg)
Proving P = NP
Will make cryptography collapse
Compute the encryption key!
Compute the encryption key!
Prove that all problems in NP can be solved by polynomial time algorithms
NP
NP-complete problems
NP-complete problems
Solving any ONE problem in here in
poly time will prove P=NP!
Solving any ONE problem in here in
poly time will prove P=NP!
![Page 20: Lecture 38 CSE 331 Dec 2, 2011. Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.](https://reader034.fdocuments.in/reader034/viewer/2022052510/56649f495503460f94c6b7a8/html5/thumbnails/20.jpg)
If you are curious for more
CSE431: Algorithms
CSE 396: Theory of Computation