Lecture17 - Optimal linear interpolation CSE 421 Algorithms...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSE 421 Algorithms Richard Anderson Lecture 17 Dynamic Programming Optimal linear interpolation Error = Σ (y i –ax i –b) 2 Determine set of K lines to minimize error 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 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 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 Variable number of segments • Segments not specified in advance • Penalty function associated with segments • Cost = Interpolation error + C x #Segments
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Lecture17 - Optimal linear interpolation CSE 421 Algorithms...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online