# Lecture18 - Dynamic Programming CSE 421 Algorithms Richard...

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

CSE 421 Algorithms Richard Anderson Lecture 18 Dynamic Programming Dynamic Programming • The most important algorithmic technique covered in CSE 421 • Key ideas – Express solution in terms of a polynomial number of sub problems – Order sub problems to avoid recomputation Today - Examples • Examples – Optimal Billboard Placement • Text, Solved Exercise, Pg 307 – Linebreaking with hyphenation • Compare with HW problem 6, Pg 317 – String approximation • Text, Solved Exercise, Page 309 Billboard Placement • Maximize income in placing billboards –b i = (p i , v i ), v i : value of placing billboard at position p i • Constraint: – At most one billboard every five miles •Examp le – {(6,5), (8,6), (12, 5), (14, 1)} Design a Dynamic Programming Algorithm for Billboard Placement • Compute Opt[1], Opt[2], . . ., Opt[n] • What is Opt[k]? Input b 1 , …, b n , where bi = (p i , v i ), position and value of billboard i Opt[k] = fun(Opt[0],…,Opt[k-1])

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.

## This note was uploaded on 02/25/2012 for the course CSE 421 taught by Professor Richardanderson during the Fall '06 term at University of Washington.

### Page1 / 4

Lecture18 - Dynamic Programming CSE 421 Algorithms Richard...

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

View Full Document
Ask a homework question - tutors are online