Contents · Optimal Control
Part 0 · LQR
Part 1 · Dynamic Programming
- Dynamic Programming and the Bellman Equation
Part 2 · Trajectory Optimization
Part 3 · MPC
Part 4 · Continuous Optimal Control
Part 1 · Dynamic Programming
Dynamic Programming and the Bellman Equation
Optimal control and reinforcement learning look like separate fields, but they optimize the same object: a value function that satisfies the Bellman equation. The gap between them is not the equation, it is the information. Control knows the model (the dynamics and the cost ) and solves the equation offline by dynamic programming. RL does not know the model and estimates the same solution from sampled transitions. This chapter builds that shared object from the control side and points at where RL picks it up.
The principle of optimality
Fix a deterministic system with state , action , dynamics , and nonnegative stage cost . A policy maps states to actions, and its discounted cost-to-go from is
with discount . The optimal value is . Bellman's principle of optimality says an optimal trajectory has optimal tails: whatever the first action does, the remaining decisions must themselves be optimal from the state it lands in.1 That single observation collapses a search over whole action sequences into a search over one action plus the already-solved value of the successor.
The Bellman equation
Written out, the principle is a fixed-point condition that must obey at every state:
The minimizer is the optimal policy, read off greedily once is known:
Reinforcement learning writes the identical statement with rewards instead of costs and a maximization instead of a minimization,2
Setting turns one into the other, since ; the expectation just handles stochastic dynamics, which collapse to in the deterministic control case. It is one equation, one fixed point.
Value iteration
Read the Bellman equation as an operator acting on value functions, , and iterate it: . For this operator is a contraction in the sup norm,
so by the Banach fixed-point theorem is unique and any start converges to it geometrically, . Concretely each sweep carries the correct cost-to-go one graph-step farther from the goal, so the values lock in ring by ring.
A four-state chain by hand
Take four states in a line. The goal is absorbing with cost ; from any interior state a move left or right costs (at the left edge, "left" stays put). Use and initialize everywhere except the goal. The update for an interior state is .
| sweep | ||||
|---|---|---|---|---|
| 0 | ||||
| 1 | ||||
| 2 | ||||
| 3 | ||||
Sweep 1 only (one step from the goal) can improve: . Sweep 2 reaches : . Sweep 3 reaches : , and the next sweep changes nothing, so . The fixed point is exactly the discounted shortest-path cost-to-go: a state steps from the goal has
which gives for . As this tends to , the raw number of steps, so with no discount value iteration recovers the plain shortest-path distance.
Watching the cost-to-go flood a grid
The same sweep on a 2D gridworld shows the ring-by-ring convergence directly. The goal has cost ; every other cell runs over its four neighbours. Slide and watch the accent flood outward from the goal, one ring per sweep, then read off the greedy policy that points down the gradient toward the goal (curving around the wall, because that is the cheaper route).
- cells resolved
- 0 / 54
- residual ‖ΔV‖∞
- -
- status
- flooding…
Green is the goal (cost 0). Stronger accent means lower cost-to-go; blank cells are still at +∞, unreached by sweep 0. Arrows are the greedy policy: step toward the cheaper neighbour.
The same root, two fields
That grid is the bridge. Optimal control (this topic) has the model in hand, so it runs value iteration to convergence and gets and exactly, before ever touching the system. Reinforcement learning (the RL topic) faces the same Bellman fixed point without or : it sees only sampled transitions , so the expectation inside the operator becomes a sample average and the sweep becomes a stochastic, incremental update (Q-learning is value iteration on state-action values driven by samples). Same equation, same solution. The dividing line is whether you can compute the update or only estimate it.
Footnotes
-
Bertsekas, Dynamic Programming and Optimal Control. ↩
-
Sutton & Barto, Reinforcement Learning: An Introduction (2018). ↩