# Lecture17 - CSE 421 Algorithms Richard Anderson Lecture 17...

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

CSE 421 Algorithms Richard Anderson Lecture 17 Dynamic Programming

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

View Full Document
Optimal linear interpolation Error = Σ (y i –ax i – b) 2
Determine set of K lines to minimize error

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

View Full Document
Opt k [ j ] : Minimum error approximating p 1 …p j with k segments Express Opt k [ j ] in terms of Opt k-1 [1],…,Opt k-1 [ j ] Opt k [ j ] = min i {Opt k-1 [ i ] + E i,j }
Optimal sub-solution property Optimal solution with k segments extends an optimal solution of k-1 segments on a smaller problem

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

View Full Document
Optimal multi-segment interpolation Compute Opt[ k, j ] for 0 < k < j < n for j := 1 to n Opt[ 1, j] = E 1,j ; for k := 2 to n-1 for j := 2 to n t := E 1,j for i := 1 to j -1 t = min (t, Opt[k-1, i ] + E i,j ) Opt[k, j] = t
Determining the solution When Opt[ k ,j ] is computed, record the value of i that minimized the sum Store this value in a auxiliary array Use to reconstruct solution

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

View Full Document
Variable number of segments Segments not specified in advance Penalty function associated with segments Cost = Interpolation error + C x #Segments
Penalty cost measure Opt[ j ] = min(E 1,j , min i (Opt[ i ] + E i,j )) + P

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 / 17

Lecture17 - CSE 421 Algorithms Richard Anderson Lecture 17...

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

View Full Document
Ask a homework question - tutors are online