338. Dynamic Programming

A method for solving multi-stage decision problems by breaking them into overlapping sub-problems, each solved once and reused.

338.1. When DP applies

Required ingredients:

  1. Stages — the problem decomposes into a sequence of decisions 𝑡=0,1,,𝑇1
  2. State — a summary of the past sufficient for future decisions (Markov property)
  3. Additive cost — total cost = sum of per-stage costs 𝑐𝑡(𝑠𝑡,𝑎𝑡)
  4. Known transition𝑠𝑡+1=𝑓𝑡(𝑠𝑡,𝑎𝑡) deterministic, or 𝑃𝑡(𝑠|𝑠,𝑎) stochastic
  5. Tractable state set — table fits in memory (or use approximation)

If any breaks, plain DP doesn’t apply.

338.2. Problem class

At stage 𝑡 in state 𝑠𝑡:

After the last decision: terminal cost 𝑐𝑇(𝑠𝑇).

Total cost of a plan 𝜋=(𝑎0,,𝑎𝑇1):

𝐽𝜋(𝑠0)=𝑡=0𝑇1𝑐𝑡(𝑠𝑡,𝑎𝑡)+𝑐𝑇(𝑠𝑇)

Goal: 𝜋=argmin𝜋𝐽𝜋(𝑠0).

338.3. Why naive enumeration fails

𝐾 actions per stage, 𝑇 stages → 𝐾𝑇 plans. 𝐾=5,𝑇=205201014. DP shrinks this to 𝑂(𝑇|𝒮︀||𝒜︀|) via the Bellman recursion.

338.4. Core ideas

338.5. Curse of dimensionality

State has 𝑑 components with 𝑛 values each → |𝒮︀|=𝑛𝑑. DP cost grows exponentially in dimension, not in 𝑇.

Mitigations: state aggregation, approximate DP, reinforcement learning, function approximation.

338.6. Common applications

338.7. See also