Click4Ai

406.

Hard

Value Iteration

===============

Value iteration is a method for finding the optimal value function in a Markov decision process. It involves iterating between value function updates until convergence.

**Example:** We have a simple grid world with four states (A, B, C, D) and two actions (left, right). The reward function is as follows:

| State | Reward |

| --- | --- |

| A | 0 |

| B | 0 |

| C | 10 |

| D | 0 |

The goal is to find the optimal value function using value iteration.

**Constraints:** The policy is stationary, and the reward function is deterministic.

Test Cases

Test Case 1
Input: [[0, 1], [1, 0], [2, 3], [3, 2]]
Expected: [0.0, 0.0, 10.0, 0.0]
+ 4 hidden test cases