Operations research, mathematical programming Definition
Dynamic programming
Definition
A dynamic programming algorithm for a function consists of:
- a finite set of subproblems with a strict partial order on and a target subproblem ;
- a recurrence that gives the value of each as an explicit function of and of the values of finitely many ;
- a guarantee that .
The algorithm computes the values in an order compatible with , bottom-up in a table or top-down with memoization. It stores each value once and returns . Its running time is at most the sum over of the cost of evaluating the recurrence at .
Remarks
The method pays off when subproblems overlap, that is, when the same is needed for many . For optimization problems, the correctness of the recurrence in clause 2 rests on the principle of optimality: an optimal solution restricted to a subproblem is optimal for that subproblem.
Example: the longest common subsequence of strings and . Take with when , and , and target . Then , if , and otherwise. The table has entries, each computed in constant time, so the algorithm runs in time , while trying all subsequences of would take time exponential in .
Non-example: a recurrence in which some depends on itself through a cycle of dependencies, such as , fails clause 2. It would need , which a strict partial order forbids, so no evaluation order makes all the inputs of such a available first.
Reading path
To understand this page from the ground up, read these 4 pages in order. The foundations come first.
Show the path as a graph
- no evidence level
- Algorithm concept
- Partial order concept
- Recurrence relation concept
- Dynamic programming definition
Further reading
About this page
| Tag | 8E1CJZXC6X |
|---|---|
| URI | m2://8E1CJZXC6X |
| Kind | definition |
| Writing | W0 stub |
| MSC | 90C39, 68W40 |
| Defines | Dynamic programming |
| Uses | Algorithm, Recurrence relation, Partial order |
| Changed | 3 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- a source with a locator (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.
What links here
No page links to this page yet.