- Introduced by
- Richard E. Bellman
- Year
- 1957
- Type
- Exact sequential optimization algorithm
- Family
- Simulation / optimization
What does it do?
Deterministic Dynamic Programming (DDP) is an exact optimization method that breaks a multi-stage decision problem into a sequence of smaller subproblems, solved backwards from the final stage.
It applies when the transition functions, costs and rewards are known with certainty. Under Bellman's principle of optimality, and for a finite state and action space that satisfies the assumptions listed under When to use, it yields a globally optimal policy. Discretizing a continuous problem gives only an approximation of its true optimum.
The intuition behind the method
Consider planning the cheapest route through a network in which every road cost is known in advance. Instead of enumerating every complete path, the method works backwards: at each node it records the lowest total cost of reaching the destination from there (equivalently, the highest total reward when rewards are maximized). Once every node is labelled, the optimal path is read off by moving forward from the start, always choosing the move that leads to the best recorded value. The reasoning rests on Bellman's principle of optimality: any remainder of an optimal path must itself be optimal from the point it starts. This is why the value of each state can be computed once and reused.
History
Richard E. Bellman set out dynamic programming and the principle of optimality in his 1957 monograph, Dynamic Programming, published by Princeton University Press. The deterministic case, in which transitions and rewards are known, is the setting of the method described here. Bertsekas's Dynamic Programming and Optimal Control, cited above, presents the theory in detail.
When to use it
Use Deterministic Dynamic Programming when the problem has clearly defined sequential stages, every transition and outcome is known with certainty, and the optimal substructure holds, so that sub-paths of an optimal solution are themselves optimal. The method is valid under the following assumptions: (1) the transition function f(s, a) and the reward or cost r(s, a) are known and deterministic; (2) the state contains all information needed for future decisions, so that the decision depends only on the current state (the Markov property); (3) the principle of optimality holds; (4) the state and action spaces are finite, or have been discretized to a finite set; (5) the horizon is finite, or, for an infinite horizon, the convergence conditions described under the Bellman recursion are met. It is suited to problems such as inventory replenishment with known demand, resource allocation over time, shortest-path routing and production scheduling with fixed parameters. Do not use it when any parameter is uncertain or random; a stochastic formulation is needed then. Avoid it when the state space is very large or continuous without analytical structure, because the number of states grows too quickly for exact computation. It is also inappropriate when the problem has no sequential or recursive structure.
Limitations and considerations
- The number of states grows exponentially with the number of state variables (the curse of dimensionality), so computation and memory become infeasible for high-dimensional problems.
- The method needs the exact transition function and reward structure. Any parameter uncertainty makes the deterministic model's optimal plan unreliable.
- Discretizing continuous states or actions introduces approximation error, and the discrete optimum may differ from the true continuous optimum.
- The recursion assumes the decision at each stage depends only on the current state, not on the path by which that state was reached.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- When the principle of optimality holds and the parameters are known, the backward recursion returns a globally optimal solution rather than a local approximation, provided the assumptions listed under When to use are met.
- A multi-stage decision problem is solved through a chain of small per-state comparisons, which would otherwise be a very large single optimization problem.
- After the value function is computed, the optimal action is available for every state, not only for the chosen starting state, which supports analysis of how the plan changes with the starting conditions.
- The recursion can be checked stage by stage: each recorded value and action can be inspected against the Bellman equation.
Applications
- Optimal inventory replenishment policies with known demand over a finite planning horizon.
- Shortest-path routing in networks with known arc costs; Dijkstra's algorithm is a related label-setting method and is not a direct instance of this recursion.
- Production scheduling and lot-sizing with deterministic demand and capacity constraints.
- Resource extraction and capital investment planning under certainty.
- Sequence alignment in bioinformatics, such as the Needleman-Wunsch algorithm.
- Equipment replacement and maintenance planning with known cost and degradation functions.
How it works
How it works
Define the objective, the planning horizon (finite or infinite) and the sequence of decisions. Identify the stages, the states, the actions, the immediate reward or cost r(s, a), and the deterministic transition function s' = f(s, a) that gives the next state with certainty.
Enumerate or parameterize the feasible states S and the admissible actions A(s) for each state. For discrete problems this gives a finite table of state-action pairs; for continuous problems, the space is discretized or an analytical solution form is used. The size of this space determines memory and computation, and is the main computational bottleneck.
Apply the Bellman optimality equation V_t(s) = max over a in A(s) of [r(s, a) + V_{t+1}(f(s, a))]. For a finite horizon, set the terminal values V_T(s) and recurse backwards from stage T-1 to stage 0. For an infinite horizon, value updates are repeated until they converge (value iteration). Convergence to a finite optimal value, and hence a valid policy, is guaranteed only under conditions such as discounting with a discount factor below one and bounded rewards, or a zero-cost absorbing goal state with no negative-cost cycles. Without such conditions the updates may diverge, or cycles may leave the optimal policy undefined. The reward-maximization form above is used throughout. For a cost-to-go formulation, the same recursion is written with the minimum over actions of [c(s, a) + V_{t+1}(f(s, a))], and the minimizing action replaces the maximizing action in policy extraction.
Formula
V_t(s) = \max_{a \in A(s)} \bigl[ r(s, a) + V_{t+1}(f(s, a)) \bigr]Solve the recursion stage by stage from the final period to the first. At each stage, every state receives its optimal value and the action that attains it is recorded. Because each stage uses the already-solved values of the following stage, the subproblem solutions are consistent with one another under the deterministic transition model.
Recover the plan by a forward pass from the initial state s_0. At each stage, select the action that attains the maximum in the recorded recursion (the minimum in the cost-to-go form), using the value function stored for the following stage, and move to the state given by f. The resulting sequence of decisions is the optimal plan for the known, fixed parameters.
Formula
\pi^*(s) = \arg\max_{a \in A(s)} \bigl[ r(s, a) + V^*(f(s, a)) \bigr]Common pitfalls
- Using a deterministic model when some parameters are uncertain will tend to give overly optimistic plans; the results should not be presented as robust to that uncertainty.
- A state representation that is too coarse can lose the information needed for optimal decisions, while one that is too fine makes the state space unmanageable.
- Wrong terminal values V_T(s) propagate through every stage of the backward recursion, so boundary conditions must be checked first.
- Applying the recursion to a problem without optimal substructure: a locally best choice at one stage may not lead to a globally best plan.
- DDP is also used as an acronym for differential dynamic programming in control theory. Check which method is meant before comparing results across literature.
Frequently asked questions
How does Deterministic DP differ from Stochastic Dynamic Programming?
In Deterministic DP the next state s' = f(s, a) is a known function, so no randomness is involved. Stochastic DP replaces f with a probability distribution P(s'|s, a) and maximizes expected value. Deterministic DP is simpler and exact; Stochastic DP is needed when outcomes are uncertain.
What is the curse of dimensionality and why does it matter?
The curse of dimensionality describes how the state space grows exponentially with the number of state variables. For example, 10 state variables each with 100 discrete levels yield 10^20 states, far beyond the memory of any computer. This makes exact DP infeasible for high-dimensional problems and motivates approximation methods such as Approximate DP or reinforcement learning.
When should I use linear programming instead of DP?
Use linear programming when the problem can be expressed as a single-period optimization with linear constraints and objectives. DP is preferred when the decision unfolds over multiple stages and the best action at each stage depends on the state of the system at that time.
Is Deterministic DP the same as backward induction in game theory?
They share the same recursive logic of solving from the end backwards, but game-theoretic backward induction involves several players making strategic choices. Deterministic DP is a single-agent optimization problem with no strategic opponents.
Can Deterministic DP handle continuous state and action spaces?
Yes, when analytical solutions exist, for example for linear-quadratic problems, or when the value function has a known functional form. Otherwise, continuous spaces must be discretized, which introduces approximation error and greatly increases the computational burden.
Related methods
Sources
Bellman, R. E. (1957). Dynamic Programming. Princeton University Press, Princeton, NJ.
ISBN: 9780691079516Bertsekas, D. P. (2017). Dynamic Programming and Optimal Control (4th ed., Vol. 1). Athena Scientific, Belmont, MA.
Open publication reference