Weighted interval scheduling for a lazy man Input: the same as weighted interval scheduling.

5
1

description

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. - PowerPoint PPT Presentation

Transcript of Weighted interval scheduling for a lazy man Input: the same as weighted interval scheduling.

Page 1: Weighted interval scheduling for a lazy man Input:  the same as weighted interval scheduling.

1

Page 2: Weighted interval scheduling for a lazy man Input:  the same as weighted interval scheduling.

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 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.

Page 3: Weighted interval scheduling for a lazy man Input:  the same as weighted interval scheduling.

3

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.

Page 4: Weighted interval scheduling for a lazy man Input:  the same as weighted interval scheduling.

4

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;

Page 5: Weighted interval scheduling for a lazy man Input:  the same as weighted interval scheduling.

5

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;