stochastic-search
Planning under probabilistic outcomes: LAO*, iLAO*, CG-iLAO*, RTDP, LRTDP, BRTDP, FRTDP, VPI-RTDP, POMCP, DESPOT, and the multi-objective MOLAO*, iMOLAO* and MOLRTDP.
When actions have uncertain outcomes (a wheel slips, a request times out), a single path is
no longer a plan: the crate solves stochastic shortest
path problems (SSPs) and returns a value function with a greedy policy that says what to do
in every state the plan can reach. Problems are described through a small Mdp trait with
callbacks, so states are generated on demand rather than enumerated up front; dead ends can
be treated as infinitely or finitely expensive. Partially observable problems use a separate
generative POMDP model with the online planners POMCP and DESPOT, and problems with several
cost dimensions get the multi-objective algorithms of Chen, Trevizan and Thiébaux. The crate
is no_std with alloc, and value iteration serves as the reference that the other
algorithms are tested against.
Part of the planning and search crates; see also this crate's overview page.
Who this is for
- Robotics and autonomy work where actions have uncertain outcomes and the planner needs a policy with a convergence guarantee (LRTDP, iLAO*) or with bounds on how far it is from optimal (BRTDP, FRTDP, VPI-RTDP).
- Online decision making under partial observability, e.g. a robot or game agent acting on noisy sensor readings, where POMCP or DESPOT plan from a particle belief and reuse their search tree between decisions.
- Planning with several competing costs (time against risk, energy against wear), where the multi-objective algorithms return the convex coverage set of policies instead of one weighted compromise.
- Researchers and students comparing MDP heuristic search algorithms on the same model and test oracle.
- If every action has exactly one outcome, use
heuristic-search (or
multiobjective-search for several
costs); it is simpler and much faster. Goal tests written against
search-core work in both, and heuristics carry
over once their cost type is
f64.
Installation
Or in Cargo.toml:
[]
= "0.1"
Scope
-
Value iteration, RTDP, labeled RTDP (LRTDP), classic LAO*, iLAO* and CG-iLAO* for stochastic shortest path problems, with infinite or finite-penalty dead ends
-
Bounded RTDP (BRTDP), focused RTDP (FRTDP) and VPI-RTDP with lower and upper bounds and an upper-greedy policy; upper bounds must be finite, so infinite dead ends need a lower bound that proves them (or use a penalty)
-
A generative POMDP model with online planners POMCP and anytime regularized DESPOT (Ye et al. 2017) over particle beliefs, with tree reuse between decisions, a particle filter with reinvigoration, POMCP exploration calibration, progress events and dedicated tree counters
-
Multi-objective SSPs (
MoMdp<N>, cost vectors) with the algorithms of Chen, Trevizan and Thiébaux (2023): MOLAO*, iMOLAO* and MOLRTDP, with multi-objective value iteration as the reference. They return the convex coverage set of deterministic proper policies under the weak improper policy assumption (boundb). Heuristics: blind, ideal point of single-objective heuristics, and MOVI on an abstraction or on the all-outcomes determinisation. The paper's factored heuristics (h^max, comax, PDBs) are not implemented, because the crate has no factored model -
Shared traits:
Goal,Heuristic,heuristic_fnandBudgetcome fromsearch-coreand are re-exported here;Budgetbounds areBudget<Stats>.Zeroissearch-core's as well (it coversf64); the multi-objective algorithms use the localZeroVector.
See docs/design.md for the model and its guarantees.
Example
An SSP is an Mdp (actions with costs, outcomes with probabilities), a goal test and a
heuristic; every algorithm returns a value function and a greedy policy:
use ;
/// A die roll: action `roll` (cost 1) ends on a six; action `pay` (cost 4) ends always.
;
let heuristic = heuristic_fn;
let solution = lrtdp?;
// Rolling takes 6 attempts in expectation, so paying 4 is cheaper.
assert_eq!;
assert!;
# Ok::
The crate is no_std and needs only alloc.
Minimum supported Rust version
Rust 1.85 (edition 2024). The MSRV applies to the library; tests and benchmarks may need a newer toolchain. It may be raised in a minor release when a dependency or a language feature calls for it.
Contributing
See CONTRIBUTING.md.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.