Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 36 CSE 331 Dec 2, 2009. Graded HW 8 END of the lecture.

Similar presentations


Presentation on theme: "Lecture 36 CSE 331 Dec 2, 2009. Graded HW 8 END of the lecture."— Presentation transcript:

1 Lecture 36 CSE 331 Dec 2, 2009

2 Graded HW 8 END of the lecture

3 Weighted Interval Scheduling Input: n jobs (s i,t i,v i ) Output: A schedule S s.t. no two jobs in S have a conflict Goal: max Σ i in S v j Assume: jobs are sorted by their finish time

4 Couple more definitions p(j) = largest i s.t. i does not conflict with j = 0 if no such i exists OPT(j) = optimal value on instance 1,..,j

5 Property of OPT OPT(j) = max { v j + OPT( p(j) ), OPT(j-1) } j in OPT(j) j not in OPT(j) Given OPT(1),…., OPT(j-1), how can one figure out if j in optimal solution or not?

6 A recursive algorithm Compute-Opt(j) If j = 0 then return 0 return max { v j + Compute-Opt( p(j) ), Compute-Opt( j-1 ) }


Download ppt "Lecture 36 CSE 331 Dec 2, 2009. Graded HW 8 END of the lecture."

Similar presentations


Ads by Google