{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

08 - Introduction to dynamic programming; weighted interval scheduling

# 08 - Introduction to dynamic programming; weighted interval scheduling

This preview shows pages 1–2. Sign up to view the full content.

.. Lecture: Introduction to dynamic programming; weighted interval scheduling Reading: Chapter 6.1 Chapter 6: Dynamic Programming First example: Weighted Interval Scheduling Goal: fnd a set o± non-overlapping o± max total weight (value) Intervals 1, 2, 3 . ... , n. Either interval n is in the optimal solution, or it isn't. I± it is: keep interval n, eliminate what it con²icts with Notation: For interval j, p(j) = highest labeled interval < j that doesn't con²ict with it (0 i± all earlier ones con²ict) In n isn't in optimal solution, solve recursively on 1, 2, 3, . .., n-1 Try: n in opt: get answer, n not in opt: get answer take better o± these Compute-Opt(n) I± n = 0 then return 0. Else return max [Vn + Compute-Opt(p(n)), Compute-Opt(n-1)] Can make an exponential number o± calls to Compute-Opt *But most o± these are redundant -- should save each recursive value frst time it's computed. Memoization

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

08 - Introduction to dynamic programming; weighted interval scheduling

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online