Weighted interval scheduling for a lazy man

Slides:



Advertisements
Similar presentations
1 Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Advertisements

COLORING WITH NUMBERS. NumbersNumbers NumbersNumbers
Dependent Events Objective: Find the probability of dependent events. Standard Addressed: : D Use theoretical probability distributions to make judgments.
© red ©
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.
1. 2 Weighted interval scheduling for a lazy man Input: the same as weighted interval scheduling. Goal: find a set of compatible jobs such that for any.
1 More On Dynamic programming Algorithms Shortest path with edge constraint: Let G=(V, E) be a directed graph with weighted edges. Let s and v be two vertices.
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 36 CSE 331 Dec 2, Graded HW 8 END of the lecture.
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%) .
Week 2: Greedy Algorithms
Lecture 24 CSE 331 Oct 27, Online office hours tonight 9:00pm.
P Fig. 6-1, p. 193 Fig. 6-2, p. 193 Fig. 6-3, p. 195.
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%
9/3/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Guest lecturer: Martin Furer Algorithm Design and Analysis L ECTURE.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 8.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 17.
Lectures on Greedy Algorithms and Dynamic Programming
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 14.
12.5 – Probability of Compound Events
Dynamic Programming.  Decomposes a problem into a series of sub- problems  Builds up correct solutions to larger and larger sub- problems  Examples.
GRAPHING RELATIONSHIPS For each graph, determine the graphing relationship and record it on a white board.
Lecture 9 CSE 331 June 18, The “real” end of Semester blues MondayTuesdayWednesdayThursdayFriday Project 331 HW Exam study Party! Write up a term.
Linear program Separation Oracle. Rounding We consider a single-machine scheduling problem, and see another way of rounding fractional solutions to integer.
Greedy Algorithms – Chapter 5
Lecture 32 CSE 331 Nov 16, 2016.
Weighted Interval Scheduling
Lesson 111: Three Statements of Equality
CS38 Introduction to Algorithms
Prepared by Chen & Po-Chuan 2016/03/29
Lecture 21 CSE 331 Oct 21, 2016.
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 34 CSE 331 Nov 20, 2017.
Lecture 20 CSE 331 Oct 14, 2016.
Lecture 33 CSE 331 Nov 18, 2016.
Lecture 33 CSE 331 Nov 17, 2017.
Chapter 6 Dynamic Programming
Colours.
Lecture 35 CSE 331 Nov 28, 2016.
Chapter 6 Dynamic Programming
Lecture 19 CSE 331 Oct 12, 2016.
MCA 301: Design and Analysis of Algorithms
Richard Anderson Lecture 16a Dynamic Programming
Greedy Algorithms.
Weighted Interval Scheduling
Assignment 2: Due Week 11, Friday
Compound Probability.
Lecture 19 CSE 331 Oct 8, 2014.
Lecture 32 CSE 331 Nov 15, 2017.
Lecture 33 CSE 331 Nov 14, 2014.
Lecture 34 CSE 331 Nov 21, 2016.
WARM-UP: Describe each of the intervals. How does the percentage of garbage recycled change? Ex. Between 1990 and 1995, the percentage of garbage recycled.
What Color is it?.
Lecture 18 CSE 331 Oct 9, 2017.
Which One Doesn’t Belong?
Instructor Neelima Gupta
Lecture 20 CSE 331 Oct 13, 2017.
Lecture 36 CSE 331 Nov 28, 2011.
Lecture 36 CSE 331 Nov 30, 2012.
Weighted Interval Scheduling
Midterm: week 7 in the lecture for 2 hours
Analysis of Algorithms CS 477/677
Week 2: Greedy Algorithms
Lecture 19 CSE 331 Oct 10, 2016.
Greedy algorithms.
Week 8 - Friday CS322.
Presentation transcript:

Weighted interval scheduling for a lazy man Input: the same as weighted interval scheduling. Goal: find a set of compatible jobs such that for any two consecutive jobs in the subset either there is some idle time or the total length of the two consecutive jobs is at most k. If k=4, we can choose black, blue, yellow as a subset. But we cannot choose black, blue and green as the subset.

Solution: Still the same equation, but use different p(). OPT(j) be the weight of the optimal solution containing at most the first j jobs. OPT(j)=max {OPT(j-1), vj+ OPT(p(j))} Initial Value: OPT(0)=0. P(j) is redefined as: the largest i<j such that job i is compatible with j and either there is some idle time between i and j or fj-si k.

K=4 p(b)=0; p( c )=0; p(a)=0; p(e)=0; p(d)=0; p(f)=b; p(g)=c; p(h)=e;

k=6 p(b)=0; p( c )=0; p(a)=0; p(e)=b; p(d)=0; p(f)=c; p(g)=c; p(h)=e;