Lecture 21 CSE 331 Oct 20, 2017.

Slides:



Advertisements
Similar presentations
Instructor Neelima Gupta Table of Contents Greedy Algorithms.
Advertisements

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%) .
Lecture 23 CSE 331 Oct 24, Temp letter grades assigned See the blog post for more details.
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 36 CSE 331 Dec 2, Graded HW 8 END of the lecture.
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 20 CSE 331 Oct 21, Algorithm for Interval Scheduling R: set of requests Set A to be the empty set While R is not empty Choose i in R with.
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 9 CSE 331 June 18, The “real” end of Semester blues MondayTuesdayWednesdayThursdayFriday Project 331 HW Exam study Party! Write up a term.
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.
Richard Anderson Autumn 2015 Lecture 8 – Greedy Algorithms II
Lecture 36 CSE 331 Nov 29, 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 33 CSE 331 Nov 18, 2016.
Lecture 35 CSE 331 Nov 28, 2016.
Autumn 2015 Lecture 9 Dijkstra’s algorithm
Lecture 13 CSE 331 Oct 1, 2012.
Lecture 24 CSE 331 Oct 25, 2013.
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.
Lecture 19 CSE 331 Oct 12, 2016.
Lecture 26 CSE 331 Nov 2, 2012.
Lecture 22 CSE 331 Oct 24, 2016.
Greedy Algorithms: Homework Scheduling and Optimal Caching
Richard Anderson Lecture 6 Greedy Algorithms
Lecture 37 CSE 331 Nov 30, 2011.
Lecture 19 CSE 331 Oct 8, 2014.
Lecture 20 CSE 331 Oct 17, 2011.
Lecture 25 CSE 331 Oct 28, 2013.
Richard Anderson Autumn 2016 Lecture 7
Lecture 25 CSE 331 Oct 27, 2014.
Lecture 22 CSE 331 Oct 15, 2014.
Lecture 18 CSE 331 Oct 9, 2017.
Richard Anderson Lecture 7 Greedy Algorithms
Richard Anderson Winter 2019 Lecture 8 – Greedy Algorithms II
Lecture 20 CSE 331 Oct 13, 2017.
Lecture 21 CSE 331 Oct 19, 2011.
Lecture 21 CSE 331 Oct 22, 2012.
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.
Richard Anderson Autumn 2016 Lecture 8 – Greedy Algorithms II
Lecture 23 CSE 331 Oct 24, 2011.
Winter 2019 Lecture 9 Dijkstra’s algorithm
Lecture 26 CSE 331 Nov 1, 2010.
Richard Anderson Winter 2019 Lecture 7
Lecture 25 CSE 331 Oct 28, 2011.
Lecture 19 CSE 331 Oct 10, 2016.
Richard Anderson Autumn 2015 Lecture 7
Lecture 15 CSE 331 Oct 4, 2010.
Richard Anderson Autumn 2019 Lecture 7
Richard Anderson Autumn 2019 Lecture 8 – Greedy Algorithms II
Lecture 24 CSE 331 Oct 29, 2018.
Autumn 2019 Lecture 9 Dijkstra’s algorithm
Presentation transcript:

Lecture 21 CSE 331 Oct 20, 2017

Grading Mid-term-1 hopefully by tomorrow Mini project pitch hopefully by the weekend

Scheduling to minimize lateness n jobs: ith job (ti,di) start time: s Schedule the n jobs: ith job gets interval [s(i),f(i)=s(i)+ti) Algo picks s(i) GOAL: Minimize MAXIMUM lateness Lateness of job i, li = max(0,f(i)-di)

The Greedy Algorithm f=s For every i in 1..n do (Assume jobs sorted by deadline: d1≤ d2≤ ….. ≤ dn) f=s For every i in 1..n do Schedule job i from s(i)=f to f(i)=f+ti f=f+ti

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)