Planning & Search in Rust
Esc

Loading…

↑↓ move ↵ open Esc close
Colour theme
All algorithms

Value Iteration

Also known as VI

optimization stochastic-search

Value iteration computes the optimal expected cost of every state of a stochastic shortest path problem. It first lists every state that the start can reach. When dead ends have infinite cost, it gives an infinite value to each state from which no policy reaches a goal with probability 1. Then it sweeps the other states again and again, and sets each value to the cheapest expected cost over the actions (Gauss-Seidel: new values count at once). It stops when the largest change in a sweep is below ε; it stores the whole reachable space, so use it as an exact reference on small problems.

Pseudocode

algorithm ValueIteration(s₀, goal, ε)input: initial state s₀, goal test goal, tolerance εoutput: values V and a greedy policy π on every reachable stateS ← every state reachable from s₀, in discovery orderD ← states of S with no policy that reaches a goal with probability 1   ▷ greatest fixed pointfor each s in S doV[s] ← ∞ if s ∈ D, else 0repeatr ← 0for each s in S ∖ D with not goal(s) do      ▷ Gauss-Seidel: new values used at oncev ← min over a ∈ A(s) of c(s, a) + ∑ P(s′ | s, a) · V[s′]π[s] ← the action that attains vr ← max(r, |v − V[s]|)V[s] ← vuntil r < εreturn V, π

In the crates

Lineage

Comes from

Nothing on this site.

Led to

MOVI builds on it