Lecture 22 CSE 331 Oct 15, 2014.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Lecture 27 CSE 331 Nov 3, Combining groups Groups can unofficially combine in the lectures.
Lecture 25 CSE 331 Oct 29, HW 6 due today All questions in one pile I will not take any HW after 1:15pm.
Lecture 24 CSE 331 Oct 27, Online office hours tonight 9:00pm.
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 22 CSE 331 Oct 26, Blog posts Please sign up if you have not If I have a pick a blogger I will only pick ONE/lecture Will lose out on 5%
Using Dijkstra’s Algorithm to Find a Shortest Path from a to z 1.
CSE 331: Review. Main Steps in Algorithm Design Problem Statement Algorithm Real world problem Problem Definition Precise mathematical def “Implementation”
Lecture 23 CSE 331 Oct 24, Reminder 2 points for Piazza participation 3 points for mini-project.
Lecture 38 CSE 331 Dec 5, OHs today (only online 9:30-11)
CSE 331: Review.
CSE 421 Algorithms Richard Anderson Lecture 8 Optimal Caching Dijkstra’s algorithm.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 10.
Lecture 9 CSE 331 June 18, The “real” end of Semester blues MondayTuesdayWednesdayThursdayFriday Project 331 HW Exam study Party! Write up a term.
CSE 331: Review August 1, Main Steps in Algorithm Design Problem Statement Algorithm Real world problem Problem Definition Precise mathematical.
Graph Algorithms BFS, DFS, Dijkstra’s.
Lecture 23 CSE 331 Oct 26, 2016.
Chapter 4 Greedy Algorithms
Lecture 21 CSE 331 Oct 21, 2016.
Lecture 24 CSE 331 Oct 28, 2016.
Lecture 24 CSE 331 Oct 27, 2017.
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 20 CSE 331 Oct 14, 2016.
Autumn 2016 Lecture 9 Dijkstra’s algorithm
Lecture 35 CSE 331 Nov 28, 2016.
Autumn 2015 Lecture 9 Dijkstra’s algorithm
Lecture 37 CSE 331 Dec 1, 2017.
Lecture 13 CSE 331 Oct 1, 2012.
Lecture 24 CSE 331 Oct 25, 2013.
Richard Anderson Lecture 9 Dijkstra’s algorithm
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 9 Dijkstra’s algorithm
Lecture 26 CSE 331 Nov 2, 2012.
Lecture 22 CSE 331 Oct 24, 2016.
Lecture 37 CSE 331 Nov 30, 2011.
Lecture 19 CSE 331 Oct 8, 2014.
Lecture 27 CSE 331 Oct 31, 2014.
Lecture 14 CSE 331 Oct 3, 2012.
Lecture 12 CSE 331 Sep 26, 2011.
Lecture 25 CSE 331 Oct 27, 2014.
Lecture 28 CSE 331 Nov 7, 2012.
Lecture 18 CSE 331 Oct 9, 2017.
Lecture 20 CSE 331 Oct 13, 2017.
Lecture 21 CSE 331 Oct 19, 2011.
Lecture 24 CSE 331 Oct 24, 2014.
Lecture 36 CSE 331 Nov 28, 2011.
Lecture 36 CSE 331 Nov 30, 2012.
Lecture 23 CSE 331 Oct 28, 2009.
Lecture 37 CSE 331 Dec 2, 2016.
Autumn 2016 Lecture 10 Minimum Spanning Trees
Lecture 23 CSE 331 Oct 24, 2011.
Winter 2019 Lecture 9 Dijkstra’s algorithm
Lecture 26 CSE 331 Nov 1, 2010.
CSE 417: Algorithms and Computational Complexity
Lecture 25 CSE 331 Oct 28, 2011.
Lecture 19 CSE 331 Oct 10, 2016.
Richard Anderson Autumn 2015 Lecture 7
Winter 2019 Lecture 10 Minimum Spanning Trees
Lecture 15 CSE 331 Oct 4, 2010.
Data Structures and Algorithm Analysis Lecture 8
Lecture 36 CSE 331 Nov 22, 2013.
Lecture 37 CSE 331 Dec 3, 2018.
Lecture 24 CSE 331 Oct 29, 2018.
Autumn 2019 Lecture 9 Dijkstra’s algorithm
Presentation transcript:

Lecture 22 CSE 331 Oct 15, 2014

Graded Quiz 1 Will hand them out at the END of the lecture

Online OH tonight @9pm

Two definitions for schedules Idle time Max “gap” between two consecutively scheduled tasks Idle time =0 Idle time =1 Inversion (i,j) is an inversion if i is scheduled before j but di > dj i j f=1 For every i in 1..n do Schedule job i from si=f to fi=f+ti f=f+ti i j 0 idle time and 0 inversions for greedy schedule

Proof structure Any two schedules with 0 idle time and 0 inversions have the same max lateness Greedy schedule has 0 idle time and 0 inversions There is an optimal schedule with 0 idle time and 0 inversions

Today’s agenda “Exchange” argument to convert an optimal solution into a 0 inversion one

Rest of Today Shortest Path Problem http://xkcd.com/85/

Reading Assignment Sec 2.5 of [KT]

Shortest Path problem s 100 Input: Directed graph G=(V,E) w 15 5 s u w 100 Input: Directed graph G=(V,E) Edge lengths, le for e in E “start” vertex s in V 15 5 s u w 5 s u Output: All shortest paths from s to all nodes in V

Naïve Algorithm Ω(n!) time

Dijkstra’s shortest path algorithm E. W. Dijkstra (1930-2002)

Dijkstra’s shortest path algorithm 1 d’(w) = min e=(u,w) in E, u in R d(u)+le 1 2 4 3 y 4 3 u d(s) = 0 d(u) = 1 s x 2 4 d(w) = 2 d(x) = 2 d(y) = 3 d(z) = 4 w z 5 4 2 s w Input: Directed G=(V,E), le ≥ 0, s in V u R = {s}, d(s) =0 Shortest paths x While there is a x not in R with (u,x) in E, u in R z y Pick w that minimizes d’(w) Add w to R d(w) = d’(w)

Couple of remarks The Dijkstra’s algo does not explicitly compute the shortest paths Can maintain “shortest path tree” separately Dijkstra’s algorithm does not work with negative weights Left as an exercise