1 / 6

Lecture 39

Lecture 39. CSE 331 Dec 9, 2009. Announcements. Please fill in the online feedback form. Sample final has been posted. Graded HW 9 on Friday. Shortest Path Problem. Input: (Directed) Graph G=(V,E) and for every edge e has a cost c e (can be <0 ). t in V.

trixie
Download Presentation

Lecture 39

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 39 CSE 331 Dec 9, 2009

  2. Announcements Please fill in the online feedback form Sample final has been posted Graded HW 9 on Friday

  3. 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 Assume that G has no negative cycle 1 1 t s Shortest path has cost negative infinity 899 100 -1000

  4. Recurrence Relation OPT(i,v) = cost of shortest path from v to t with at most i edges OPT(i,v) = min {OPT(i-1,v), min(v,w) in E{cv,w + OPT(i-1, w)}} Path uses ≤ i-1 edges Best path through all neighbors

  5. Some consequences OPT(i,v) = shortest path from v to t with at most i edges OPT(i,v) = min {OPT(i-1,v), min(v,w) in E{cv,w + OPT(i-1, w)}} OPT(n-1,v) is shortest path cost between v and t Group talk time: How to compute the shortest path between s and t given all OPT(i,v) values

  6. Today’s agenda Finish Bellman-Ford algorithm Look at a related problem: longest path problem

More Related