R. Bellman began the systematic study of dynamic programming in 1955. The word ``programming'', both here and in linear programming, refers to the use of a tabular solution method. Although optimization techniques incorporating elements of dynamic programming were known earlier, Bellman provided the area with a solid mathematical basis. Dynamic programming typically applies to optimization problems in which a set of choices must be made in order to arrive at an optimal solution. As choices are made, subproblems of the same form often arise. Dynamic programming is effective when a given subproblem may arise from more than one partial set of choices; the key technique is to store, or ``memorize'', the solution to each such subproblem in case it should reappear. The development of a dynamic-programming algorithm can be broken into a sequence of four steps:
Steps 1-3 (Forward) form the basis of a dynamic-programming solution to a problem. Step 4 (Traceback) can be omitted if only the value of an optimal solution is required. When we do perform step 4, we sometimes maintain additional information during the computation in step 3 to ease the construction of an optimal solution.
The key ingredients that an optimization problem must have for dynamic programming to be applicable are: optimal substructure and overlapping subproblems.