Lecture 19 CSE 331 Oct 14, 2011.

Slides:



Advertisements
Similar presentations
Lecture 37 CSE 331 Nov 4, Homework stuff (Last!) HW 10 at the end of the lecture Solutions to HW 9 on Monday Graded HW 9 on.
Advertisements

Lecture 13 CSE 331 Oct 2, Announcements Please turn in your HW 3 Graded HW2, solutions to HW 3, HW 4 at the END of the class Maybe extra lectures.
Lecture 21 CSE 331 Oct 20, Announcements Graded mid-term exams at the END of the lecture Sign up for blog posts/group scribe leader No more than.
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.
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
Lecture 36 CSE 331 Dec 2, Graded HW 8 END of the lecture.
Lecture 34 CSE 331 Nov 30, Graded HW 8 On Wednesday.
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 24 CSE 331 Oct 27, Online office hours tonight 9:00pm.
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 13 CSE 331 Oct 2, Announcements Mid term in < 2 weeks Graded HW2 at the END of the class.
Lecture 8 CSE 331 Sep 17, HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm.
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%
Called as the Interval Scheduling Problem. A simpler version of a class of scheduling problems. – Can add weights. – Can add multiple resources – Can ask.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 8.
CSE 331: Review. Main Steps in Algorithm Design Problem Statement Algorithm Real world problem Problem Definition Precise mathematical def “Implementation”
CSCI 256 Data Structures and Algorithm Analysis Lecture 6 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
Lecture 8 CSE 331. Main Steps in Algorithm Design Problem Statement Algorithm Problem Definition “Implementation” Analysis n! Correctness+Runtime Analysis.
Lecture 18 CSE 331 Oct 12, HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.
Lecture 18 CSE 331 Oct 6, Group/Algo registration deadline BOTH DUE WED by 11:59pm!
Greedy algorithms: CSC317
Greedy Algorithms – Chapter 5
Lecture 32 CSE 331 Nov 16, 2016.
Merge Sort 7/29/ :21 PM The Greedy Method The Greedy Method.
Lecture 7 Greedy Algorithms
Lecture 17 CSE 331 Oct 3, 2014.
Chapter 4 Greedy Algorithms
Greedy Algorithms / Interval Scheduling Yin Tat Lee
Presented by Po-Chuan & Chen-Chen 2016/03/08
Lecture 22 CSE 331 Oct 22, 2010.
Lecture 7 CSE 331 Sep 15, 2010.
Lecture 21 CSE 331 Oct 21, 2016.
Lecture 21 CSE 331 Oct 20, 2017.
Merge Sort 11/28/2018 2:18 AM The Greedy Method The Greedy Method.
Merge Sort 11/28/2018 8:16 AM The Greedy Method The Greedy Method.
Lecture 20 CSE 331 Oct 14, 2016.
Lecture 17 CSE 331 Oct 7, 2016.
Lecture 33 CSE 331 Nov 18, 2016.
Lecture 33 CSE 331 Nov 17, 2017.
Lecture 14 CSE 331 Sep 30, 2011.
Lecture 27 CSE 331 Nov 3, 2017.
Lecture 19 CSE 331 Oct 12, 2016.
Merge Sort 1/17/2019 3:11 AM The Greedy Method The Greedy Method.
Richard Anderson Lecture 6 Greedy Algorithms
Lecture 18 CSE 331 Oct 12, 2011.
Lecture 19 CSE 331 Oct 8, 2014.
Lecture 20 CSE 331 Oct 17, 2011.
Lecture 32 CSE 331 Nov 15, 2017.
Lecture 33 CSE 331 Nov 14, 2014.
Richard Anderson Autumn 2016 Lecture 7
Lecture 33 CSE 331 Nov 15, 2013.
Lecture 18 CSE 331 Oct 9, 2017.
Richard Anderson Lecture 7 Greedy Algorithms
Algorithms CSCI 235, Spring 2019 Lecture 29 Greedy Algorithms
Lecture 20 CSE 331 Oct 13, 2017.
Lecture 21 CSE 331 Oct 19, 2011.
Lecture 21 CSE 331 Oct 22, 2012.
Lecture 36 CSE 331 Nov 28, 2011.
Lecture 36 CSE 331 Nov 30, 2012.
Richard Anderson Winter 2019 Lecture 7
Homework Reading Machine Projects Labs
Merge Sort 5/2/2019 7:53 PM The Greedy Method The Greedy Method.
Week 2: Greedy Algorithms
Lecture 19 CSE 331 Oct 10, 2016.
Greedy algorithms.
Richard Anderson Autumn 2015 Lecture 7
Lecture 15 CSE 331 Oct 4, 2010.
Lecture 27 CSE 331 Nov 4, 2016.
Richard Anderson Autumn 2019 Lecture 7
Presentation transcript:

Lecture 19 CSE 331 Oct 14, 2011

Announcements Graded HW 4 next Th onwards HW 5 has been posted

Mid Term stuff Graded mid term at the end of the lecture Mid term post up on the blog Read it before asking for regrade requests A temp grade assigned by next week I’ll ask some of you to meet me in person

Sign up for scribe/blog post

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

Analyzing the algorithm R: set of requests A* has no conflicts Set A to be the empty set While R is not empty Choose i in R with the earliest finish time A* is an optimal solution Add i to A Remove all requests that conflict with i from R Return A* = A

Greedy “stays ahead” Greedy OPT

What can you say about f(i1) and f(j1)? Greedy “stays ahead” A* = i1,…,ik O = j1,…,jm k = m What do we need to prove? What can you say about f(i1) and f(j1)?

A formal claim For every r ≤ k, f(ir) ≤ f(jr) A* = i1,…,ik O = j1,…,jm The greedy algorithm outputs an optimal A Proof by contradiction: A is not optimal A* = i1,…,ik O = j1,…,jm m > k After ik, R was non-empty! ik No conflict! jk jk+1

Today’s agenda Analyze run-time of the greedy algorithm Prove the claim Analyze run-time of the greedy algorithm

The mid-term mixup Proctors allowed early arrivals to read the exam questions Unfair to students who did not come early Proposal: I’ll add 5 points at the end of the semester if it bumps up a letter grade (but not from A- to A) Email me if you have comments

The mid-term story Average: 50.2 Median: 51 Remember, mid term score gets dropped if you better on the final Time pressure issues

Greedy can always pick jr Proof of claim For every r ≤ k, f(ir) ≤ f(jr) Why is r=1 OK? By induction on r Assume true up to r-1 Greedy can always pick jr ? ir-1 ir jr-1 jr