decoupled-search
Decoupled (star-topology) search for factored planning tasks in sas-plus's SAS+ representation, after Gnad and Hoffmann (ICAPS 2015, AIJ 2018). A factoring splits the variables into a center and several leaves; the search then follows paths of global actions only and keeps, per leaf, the cheapest price of every leaf state reachable along the current path. On tasks with loosely coupled components (logistics-style packages around a shared vehicle, independent machines around a common resource), that removes the interleavings of leaf moves which blow up an explicit state space, and the search still returns an ordinary sequential plan for the original task.
The crate covers the factoring strategies, cost-optimal (uniform-cost, A*, anytime A*) and satisficing (GBFS)
search, the dominance pruning of Torralba, Gnad, Dubbert and Hoffmann (2016) and decoupled heuristics, with plan reconstruction and
an independent plan validator. It is no_std with alloc, with and without the optional features
except symbolic-leaves, which needs std.
Who this is for
- Planning researchers working on star-topology decoupling, factoring selection or dominance pruning who want a readable implementation, cross-checked against explicit search, to build on or compare against.
- Planner authors whose tasks fall apart into a center and many weakly interacting leaves (transport, multi-robot delivery, manufacturing cells), where explicit search spends most of its effort on interleavings of leaf moves.
- Embedded and robotics teams that plan onboard: the crate builds for
no_stdtargets. - Tasks without a useful star factoring gain nothing from decoupling;
Factoring::autothen falls back to explicit search, and for explicit-state search on its own heuristic-search is the better fit. - For the heuristics themselves on ordinary states, use planning-heuristics; for symbolic search over the same tasks, symbolic-search.
Installation
[]
= "0.1"
Scope
More detail, including how each rule maps to the papers, is in docs/design.md.
- Factorings: fork, inverted fork, X-shape, and the incident-arcs and
independent-set (maximum leaves) strict-star strategies of Gnad, Poser
and Hoffmann (IJCAI 2017), the generalized factorings of Gnad, Torralba
and Fišer (ICAPS 2022) with directly interacting leaves and a possibly
empty center, explicit partitions, and a strict-star check.
Factoring::scorereports leaves, mobile leaves, the leaf-action share and leaf sizes;Factoring::autopicks the best-scored strategy with at least two mobile leaves and otherwise falls back to explicit search;Factoring::auto_by_samplepicks by short sample searches instead (the paper's selection, with an expansion budget instead of a clock). - Leaf reachability with prices (cheapest cost per leaf state along the
center path); stored states keep only reached leaf states, as
u16ranks withu64prices (no prices at all when all are 0). - Uniform-cost search, A* and anytime A* (Gnad and Hoffmann's Anytime
Fork-Root A*, cost-optimal), and GBFS (satisficing), with
Configchoosing the dominance criterion: basic, frontier, effective prices, leaf simulation, or effective prices over simulation (Torralba, Gnad, Dubbert and Hoffmann 2016, generalised to global actions that touch leaves), optionally with onegbudget shared by all leaves; the default switches to simulation only once the search has spent its cost. Optional simulation-based leaf reduction (Config::reduce_leaves, the superfluous-transition rule of the paper's technical report with a removal order that keeps it sound), andConfig::reduced_taskwithout the operators it makes useless, for heuristics. Search statistics come with everyOutcome. - Optional partial-order reduction (
Config::stubborn_sets): the decoupled strong stubborn sets of Gnad, Hoffmann and Wehrle (JAIR 2019) for general star factorings. The paper proves they keep optimality and completeness under duplicate detection; the combinations with dominance pruning and leaf reduction that its proof does not cover are listed in thestubborn_setsdocumentation. - Optional symbolic leaves (
Config::symbolic_leaves, featuresymbolic-leaves): leaf pricing functions as BDDs (Gnad, Torralba and Hoffmann, SoCS 2017) for leaves too large to enumerate, with small leaves kept enumerated next to them. Same state space and results as explicit leaves, under basic dominance. Optionally a symbolic center (Config::symbolic_center): one search node per set of center states that share their leaf pricing and cost. - Reachability-only leaves (no prices) for GBFS.
- Conditional effects on a leaf conditioned on the center and that leaf, on the center conditioned on the center; derived variables that depend on the center and at most one leaf. Everything else is rejected with a precise error.
- Heuristics on decoupled states:
h^max(admissible) andh^FF, both seeded with per-fact leaf prices (FactPrices, constructible for tests), with themerge-and-shrinkfeature an admissible merge-and-shrink adapter (MasHeuristic), and with thelm-cutfeature an admissible LM-cut adapter (LmCutHeuristic, fromplanning-heuristics). - Reconstruction of a sequential plan for the original task, and
Plan::validate.
Usage
use ;
use ;
// Two binary variables: `go` sets `c = 1`, then `set` needs `c = 1` and
// sets the goal `x = 1`.
let op = ;
let task = Task ;
let factoring = auto;
let plan = search?.expect;
assert_eq!;
assert_eq!;
let plan = astar?;
assert_eq!;
let outcome = Config .search?;
println!;
# Ok::
Features
-
merge-and-shrink:MasHeuristic, an admissible merge-and-shrink heuristic on decoupled states, from merge-and-shrink. -
lm-cut:LmCutHeuristic, an admissible LM-cut heuristic on decoupled states, from planning-heuristics. -
symbolic-leaves:Config::symbolic_leaves, leaf pricing functions as BDDs, andConfig::symbolic_center, search nodes that hold sets of center states, both on symbolic-search. Needsstd.
The crate is no_std with alloc, with and without the features, except symbolic-leaves.
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.
Contributing
See CONTRIBUTING.md.