Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 1

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

3 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), v j + 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 f j -s i  k.

4 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;

5 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;


Download ppt "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."

Similar presentations


Ads by Google