1

advertisement
1
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.
2
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.
3
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;
4
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;
5
Download