lecture 16 · 2020-04-13 · lecture 16 cse 331 mar2, 2020. quiz 1 on friday. midterms next week:...
TRANSCRIPT
![Page 1: Lecture 16 · 2020-04-13 · Lecture 16 CSE 331 Mar2, 2020. Quiz 1 on Friday. Midterms next week: Wed & Fri Will make a detailed post on Piazza this week. Teams finalized; video is](https://reader034.vdocuments.us/reader034/viewer/2022042310/5ed81625cba89e334c673854/html5/thumbnails/1.jpg)
Lecture 16
CSE 331Mar 2, 2020
![Page 2: Lecture 16 · 2020-04-13 · Lecture 16 CSE 331 Mar2, 2020. Quiz 1 on Friday. Midterms next week: Wed & Fri Will make a detailed post on Piazza this week. Teams finalized; video is](https://reader034.vdocuments.us/reader034/viewer/2022042310/5ed81625cba89e334c673854/html5/thumbnails/2.jpg)
Quiz 1 on Friday
![Page 3: Lecture 16 · 2020-04-13 · Lecture 16 CSE 331 Mar2, 2020. Quiz 1 on Friday. Midterms next week: Wed & Fri Will make a detailed post on Piazza this week. Teams finalized; video is](https://reader034.vdocuments.us/reader034/viewer/2022042310/5ed81625cba89e334c673854/html5/thumbnails/3.jpg)
Midterms next week: Wed & Fri
Will make a detailed post on Piazza this week.
![Page 4: Lecture 16 · 2020-04-13 · Lecture 16 CSE 331 Mar2, 2020. Quiz 1 on Friday. Midterms next week: Wed & Fri Will make a detailed post on Piazza this week. Teams finalized; video is](https://reader034.vdocuments.us/reader034/viewer/2022042310/5ed81625cba89e334c673854/html5/thumbnails/4.jpg)
Teams finalized;video is due April 10, 11am
![Page 5: Lecture 16 · 2020-04-13 · Lecture 16 CSE 331 Mar2, 2020. Quiz 1 on Friday. Midterms next week: Wed & Fri Will make a detailed post on Piazza this week. Teams finalized; video is](https://reader034.vdocuments.us/reader034/viewer/2022042310/5ed81625cba89e334c673854/html5/thumbnails/5.jpg)
Interval Scheduling Problem
Input: n intervals [s(i), f(i)) for 1≤ i ≤ n
Output: A schedule S of the n intervals
No two intervals in S conflict
|S| is maximized
![Page 6: Lecture 16 · 2020-04-13 · Lecture 16 CSE 331 Mar2, 2020. Quiz 1 on Friday. Midterms next week: Wed & Fri Will make a detailed post on Piazza this week. Teams finalized; video is](https://reader034.vdocuments.us/reader034/viewer/2022042310/5ed81625cba89e334c673854/html5/thumbnails/6.jpg)
Analyzing the algorithm
R: set of requests
Set S to be the empty set
While R is not empty
Choose i in R with the earliest finish time
Add i to S
Remove all requests that conflict with i from R
Return S* = S
S* has no conflicts
S* is an optimal solution
![Page 7: Lecture 16 · 2020-04-13 · Lecture 16 CSE 331 Mar2, 2020. Quiz 1 on Friday. Midterms next week: Wed & Fri Will make a detailed post on Piazza this week. Teams finalized; video is](https://reader034.vdocuments.us/reader034/viewer/2022042310/5ed81625cba89e334c673854/html5/thumbnails/7.jpg)
Greedy �stays ahead�
Greedy
OPT
![Page 8: Lecture 16 · 2020-04-13 · Lecture 16 CSE 331 Mar2, 2020. Quiz 1 on Friday. Midterms next week: Wed & Fri Will make a detailed post on Piazza this week. Teams finalized; video is](https://reader034.vdocuments.us/reader034/viewer/2022042310/5ed81625cba89e334c673854/html5/thumbnails/8.jpg)
Today’s agenda
Analyze run-time of the greedy algorithm
Prove the correctness