Article ID: | iaor2006401 |
Country: | Netherlands |
Volume: | 51 |
Issue: | 3 |
Start Page Number: | 215 |
End Page Number: | 263 |
Publication Date: | Jun 2004 |
Journal: | Science of Computer Programming |
Authors: | Giegerich R., Meyer C., Steffen P. |
Keywords: | programming: dynamic |
Dynamic programming is a classical programming technique, applicable in a wide variety of domains such as stochastic systems analysis, operations research, combinatorics of discrete structures, flow problems, parsing of ambiguous languages, and biosequence analysis. Little methodology has hitherto been available to guide the design of such algorithms. The matrix recurrences that typically describe a dynamic programming algorithm are difficult to construct, error-prone to implement, and, in nontrivial applications, almost impossible to debug completely. This article introduces a discipline designed to alleviate this problem. We describe an algebraic style of dynamic programming over sequence data. We define its formal framework, based on a combination of grammars and algebras, and including a formalization of Bellman's Principle. We suggest a language used for algorithm design on a convenient level of abstraction. We outline three ways of implementing this language, including an embedding in a lazy functional language. The workings of the new method are illustrated by a series of examples drawn from diverse areas of computer science.