cost-partition
Cost partitioning over any sas_plus::Abstraction (projections, merge-and-shrink, ...): saturated cost partitioning for a given order, and the maximum over several orders.
Splitting each operator's cost among several abstractions, so that the parts sum to at most the original cost, makes the sum of their heuristics admissible.
Usage
Build projections of a task from Fast Downward's translator, partition the costs among them, and evaluate the heuristic:
use ;
use Projection;
use SasFile;
# let output_sas = concat!;
// `output_sas` is the path of a translator output file.
let task = parse?.to_task;
let costs = task.costs;
let projections: =
.map
.collect;
// Saturated cost partitioning in one order.
let order: = .collect;
let scp = saturated_cost_partitioning;
let h = scp.value;
// The maximum over several orders dominates each of them.
let reversed: = order.iter.rev.copied.collect;
let max = new;
assert!;
# Ok::
None from value means a dead end: no plan exists from that state.
Tested
SCP ≤ h*, SCP ≥ its first component, no false dead ends, and cost functions sum to at most the original costs. These hold as proptest properties and a fuzz target on random tasks, and on translator output, both with and without conditional effects and axioms (derived variables).
Features
no_std (needs alloc). The crate has no Cargo features. It depends on sas-plus without its default features.
MSRV
Rust 1.86. Raising it is a minor-version change.
Roadmap
Greedy and diversified orders, general (negative) costs, an optimal LP baseline (good_lp), uniform cost partitioning.
Reference: Seipp, Keller & Helmert, Saturated Cost Partitioning for Optimal Classical Planning, JAIR 2020.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSES/Apache-2.0.txt)
- MIT license (LICENSES/MIT.txt)
at your option. Test fixtures derived from VHPOP are GPL-2.0-or-later and are not part of the published crate; see REUSE.toml.
Contributing
See CONTRIBUTING.md.
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.