Skip to content
Infinitesimal Dynamics home
Notebook: 0 XP

Optimization / Algorithms and structure

Dynamic Programming

Solve a big problem by solving every smaller version once and remembering the answers.

3 min read · 1 sections · 1 checks

Contents 2 sections
  1. §1Optimal substructure
  2. ?Check yourself

By the end you can

  • State the principle of optimality
  • Write a Bellman recurrence
  • Solve shortest-path and knapsack instances by tabulation

Helps to know: Recurrence Relations

§1Optimal substructure

V(s)=max⁡a [ r(s,a)+V(next(s,a)) ]V(s) = \max_{a}\,\big[\, r(s, a) + V(\text{next}(s, a)) \,\big]

Example 1Fewest coins for 6 with coins 1, 3, 4

  1. C(0)=0C(0) = 0; C(n)=1+min⁡{C(n−1),C(n−3),C(n−4)}C(n) = 1 + \min\{C(n-1), C(n-3), C(n-4)\}.

Check yourself

  1. Q1
    Dynamic programming is efficient when subproblems…