Lecture Notes for CS 512, Algorithm Design
10 April 2000, Some Dynamic Programming Problems
- longest common substring
- Z a subsequence of X
- Z a common subsequence of X and Y
- find the longest common substring of X and Y
- the brute force algorithm: consider all substrings of X
- what are the subproblems
- arbitrary division doesn't work - optimal problems are not optimal
- nibbling off the ends does work - subproblems are optimal
- a recursive implementation is still exponential - but there are only
|X||Y| subproblems
- from that we can get a dynamic-programming solution
- optimal polygon triangulation
- polygon, side, vertex, chord, triangulation
- a weight function over triangles
- factor the polygon P into triangles so as to minimize the sum of
the triangle weights
- the brute force algorithm: consider all triangulations of P
- optimal triangulation subproblems are optimal in combination
- a recursive implementation is still exponential - but there are only
polynomially many subproblems
- a dynamic-programming solution
- the analogy between triangulation and matrix chains
This page last modified on 5 April 2000.