Lecture 39 CSE 331 Dec 6, 2010. On Friday, Dec 10 hours-a-thon Atri: 2:00-3:30 (Bell 123) Jeff: 4:00-5:00 (Bell 224) Alex: 5:00-6:30 (Bell 242)

Slides:



Advertisements
Similar presentations
Bellman-Ford algorithm
Advertisements

1 Introduction to Algorithms 6.046J/18.401J/SMA5503 Lecture 19 Prof. Erik Demaine.
Single Source Shortest Paths
Advanced Algorithm Design and Analysis (Lecture 7) SW5 fall 2004 Simonas Šaltenis E1-215b
 2004 SDU Lecture11- All-pairs shortest paths. Dynamic programming Comparing to divide-and-conquer 1.Both partition the problem into sub-problems 2.Divide-and-conquer.
All Pairs Shortest Paths and Floyd-Warshall Algorithm CLRS 25.2
Lecture 38 CSE 331 Dec 7, The last few days Today: Solutions to HW 9 (end of lecture) Wednesday: Graded HW 9 (?), Sample final, Blog post on the.
Lecture 26 CSE 331 Nov 4, The week of Nov 16 Jeff will be out of town for a conference Recitations and office hour cancelled for that week Two extra.
Lecture 40 CSE 331 Dec 8, Finals 3:35-6:05pm KNOX 104 Tue, Dec 14 Blog post on the finals up.
Lecture 31 CSE 331 Nov 16, Jeff is out of town this week No regular recitation or Jeff’s normal office hours I’ll hold extra Question sessions Mon,
Design and Analysis of Algorithms - Chapter 81 Dynamic Programming Dynamic Programming is a general algorithm design technique Dynamic Programming is a.
Lecture 38 CSE 331 Dec 3, A new grading proposal Towards your final score in the course MAX ( mid-term as 25%+ finals as 40%, finals as 65%) .
1 Advanced Algorithms All-pairs SPs DP algorithm Floyd-Warshall alg.
Shortest Path Algorithm By Weston Vu CS 146. What is Shortest Paths? Shortest Paths is a part of the graph algorithm. It is used to calculate the shortest.
Lecture 24 CSE 331 Oct 30, Homework stuff Please turn in your HW 6 Graded HW 5 and HW 7 at the END of the lecture.
Lecture 17 CSE 331 Oct 8, HW 4 due today Q1 and Q2 in one pile Q3 in another pile I will not take any HW after 1:15pm.
Lecture 32 CSE 331 Nov 15, Feedback Forms Link for the survey on the blog.
Lecture 27 CSE 331 Nov 3, Combining groups Groups can unofficially combine in the lectures.
All-Pairs Shortest Paths
Lecture 37 CSE 331 Dec 1, A new grading proposal Towards your final score in the course MAX ( mid-term as 25%+ finals as 40%, finals as 65%) .
Lecture 39 CSE 331 Dec 9, Announcements Please fill in the online feedback form Sample final has been posted Graded HW 9 on Friday.
Lecture 33 CSE 331 Nov 17, Online office hours Alex will host the office hours.
Lecture 25 CSE 331 Nov 2, Adding teeth to group talk Form groups of size at most six (6) Pick a group leader I will ask group leader(s) to come.
Lecture 18 CSE 331 Oct 11, Mid term Next Monday in class.
Lecture 28 CSE 331 Nov 5, HW 7 due today Q1 in one pile and Q 2+3 in another I will not take any HW after 1:15pm.
CSE 421 Algorithms Richard Anderson Lecture 21 Shortest Paths.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 22.
Shortest Path Algorithms. Definitions Variants  Single-source shortest-paths problem: Given a graph, finding a shortest path from a given source.
Lecture 38 CSE 331 Dec 2, Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.
Lecture 23 CSE 331 Oct 24, Reminder 2 points for Piazza participation 3 points for mini-project.
Lecture 28 CSE 331 Nov 9, Mini project report due WED.
CS38 Introduction to Algorithms Lecture 10 May 1, 2014.
Lecture 38 CSE 331 Dec 5, OHs today (only online 9:30-11)
CSE 421 Algorithms Richard Anderson Lecture 21 Shortest Paths and Network Flow.
Lecture 33 CSE 331 Nov 20, HW 8 due today Place Q1, Q2 and Q3 in separate piles I will not accept HWs after 1:15pm Submit your HWs to the side of.
Lecture 32 CSE 331 Nov 16, 2016.
Lecture 13 Shortest Path.
Lecture 20 CSE 331 Oct 15, 2010.
Lecture 23 CSE 331 Oct 26, 2016.
Lecture 21 CSE 331 Oct 21, 2016.
Lecture 36 CSE 331 Nov 29, 2017.
Lecture 21 CSE 331 Oct 20, 2017.
Lecture 36 CSE 331 Nov 30, 2016.
Lecture 35 CSE 331 Nov 27, 2017.
Lecture 34 CSE 331 Nov 20, 2017.
Lecture 33 CSE 331 Nov 18, 2016.
Lecture 33 CSE 331 Nov 17, 2017.
Lecture 35 CSE 331 Nov 28, 2016.
Lecture 37 CSE 331 Dec 1, 2017.
Richard Anderson Lecture 20 LCS / Shortest Paths
Lecture 22 CSE 331 Oct 23, 2017.
Lecture 23 CSE 331 Oct 25, 2017.
Lecture 24 CSE 331 Oct 29, 2012.
Lecture 23 CSE 331 Oct 24, 2011.
Richard Anderson Lecture 21 Shortest Paths
Lecture 37 CSE 331 Nov 30, 2011.
Dynamic Programming Longest Path in a DAG, Yin Tat Lee
Lecture 34 CSE 331 Nov 21, 2016.
Lecture 22 CSE 331 Oct 15, 2014.
Lecture 31 CSE 331 Nov 12, 2010.
Lecture 14 Shortest Path (cont’d) Minimum Spanning Tree
Lecture 36 CSE 331 Nov 28, 2011.
Lecture 36 CSE 331 Nov 30, 2012.
Lecture 37 CSE 331 Dec 2, 2016.
Lecture 23 CSE 331 Oct 24, 2011.
Lecture 26 CSE 331 Nov 1, 2010.
Lecture 12 Shortest Path.
Lecture 13 Shortest Path (cont’d) Minimum Spanning Tree
Lecture 36 CSE 331 Nov 22, 2013.
Lecture 37 CSE 331 Dec 3, 2018.
Presentation transcript:

Lecture 39 CSE 331 Dec 6, 2010

On Friday, Dec 10 hours-a-thon Atri: 2:00-3:30 (Bell 123) Jeff: 4:00-5:00 (Bell 224) Alex: 5:00-6:30 (Bell 242)

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 Output: Shortest path from every s to t s t Shortest path has cost negative infinity Assume that G has no negative cycle

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

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 { c v,w + OPT(i-1, w) } } Path uses ≤ i-1 edges Best path through all neighbors

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

Today’s agenda Finish Bellman-Ford algorithm Analyze the run time Group talk time: Natural order among OPT(i,v) values? Group talk time: Natural order among OPT(i,v) values?

The recurrence 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 { c v,w + OPT(i-1, w) } }

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 { c v,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 Group talk time: How to compute the shortest path between s and t given all OPT(i,v) values