Lecture 21 CSE 331 Oct 23, 2009 Mid term and such like At the END of the lecture, graded HW4+mid term and HW 6 IMPORTANT: Read blog post on mid term before coming to me (sticky post till Monday) Scheduling to minimize lateness n jobs: ith job (ti,di) At most one job at any time Schedule the n jobs: ith job gets interval [si,fi=si+ti] Not the sum Algo picks si GOAL: Minimize MAXIMUM lateness Lateness of job i, li = max(0,fi-di) The Greedy Algorithm (Assume jobs sorted by deadline: d1≤ d2≤ ….. ≤ dn) f=1 For every i in 1..n do Schedule job i from si=f to fi=f+ti f=f+ti Solving end of Semester blues Term paper Exam study Party! 331 HW Max lateness =2 Project 0 0 Exam study Party! Monday Tuesday 0 331 HW Wednesday 2 0 P Term paper Thursday Friday Today’s agenda Prove that the schedule output minimizes the maximum lateness Two definitions for schedules Idle time Max “gap” between two consecutively scheduled tasks Idle time =0 =1 Inversion (i,j) is an inversion if i is scheduled before j but di > dj i j f=1 i j For every i in 1..n do Schedule job i from si=f to fi=f+ti f=f+ti What is the idle time and max # inversion for greedy schedule?