Solving the MDP
We wish to find an optimal policy () for the problem that is:
- complete: covers all states
- optional: gives the best action for state
- stationary: actions dependent only on current state
- proper: guaranteed to reach terminal state
Our policy should yield an expected utility for a given state following a policy
Consider for the problem as : it is the expected sum of discounted rewards if the agent is running the optimal policy.
Hence we now have two ways of acknowledging rewards in the problem space:
- : the short-term reward when reaching a given state
- : the long-term reward of passing through on the way to the goal
Meaning that our optimal solution is selecting the action with best expected utility:
![]() | ![]() |
Calculating Optimal Policy
We need to calculate the utility of each state so we can derive the optimal action. Utility calculation considers all discounted rewards over time, but future rewards are derived from states with other utility values. Hence we can calculate a utility as the immediate reward plus the expected utility of the successor, assuming optimal action selection.
Bellman Equation
The Bellman equation:
Link to original
For the example given prior, take for example we want to know the value of :
Value Iteration Algorithm
To create the value iteration algorithm, we use the Bellman update equation:
We initialise then update for all states in the problem. As time , the utility values will reach an equilibrium and stabilise.

Value Iteration Psuedocode


