AI & ML Atlas
Reinforcement LearningalgorithmInteractive simulation
Policy Iteration
Alternates between evaluating a policy and improving it greedily.
The idea
Evaluate the current policy completely (find V^π), then make the policy greedy with respect to those values. Each improvement is at least as good as before, and for a finite MDP the process reaches the optimal policy in a small number of rounds, typically fewer than value iteration needs sweeps.
Watch it run
This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.
- positive value
- negative value
- best action
Start with a poor policy (always go up) and every value at zero.
- sweep:
- 0
1/13
Each cell shows its estimated value; arrows show the action the policy would take.
Step by step
- 1Start with any policy.
- 2Policy evaluation: compute V^π by solving or iterating the Bellman equation.
- 3Policy improvement: in each state pick the action that maximises the one-step lookahead.
- 4If the policy did not change, stop; otherwise repeat.
Where it is used
Planning on small MDPs.
Watch out for
Each evaluation can itself be expensive.