Value iteration algorithm

Policy iteration algorithm

Truncated policy iteration algorithm