pub enum CbsHeuristic {
None,
Cg,
Dg,
Wdg,
}Expand description
An admissible estimate of how much the sum of costs of a constraint-tree node must still
rise (CbsConfig::heuristic).
Each one needs the MDDs of the node’s conflicting agents. A stronger heuristic means fewer expansions; WDG pays for that with a small search per dependent pair.
§Examples
use mapf_search::{Agent, CbsConfig, CbsHeuristic, Grid, Instance, Limits, Objective, cbs_with};
let grid = Grid::parse(&["@.@", "...", ".@."]);
let agents = vec![
Agent { start: 1, goal: 3 },
Agent { start: 6, goal: 5 },
Agent { start: 4, goal: 1 },
];
let instance = Instance::new(grid, agents)?;
let run = |heuristic| {
let config = CbsConfig { heuristic, ..CbsConfig::improved(Objective::SumOfCosts) };
cbs_with(&instance, config, Limits::expansions(100_000))
};
let (cg, wdg) = (run(CbsHeuristic::Cg), run(CbsHeuristic::Wdg));
assert_eq!(cg.solution().map(|s| s.sum_of_costs), Some(19));
assert_eq!(wdg.solution().map(|s| s.sum_of_costs), Some(19));
assert!(wdg.stats.expanded < cg.stats.expanded);Variants§
None
No heuristic: nodes are ordered by their sum of costs.
Cg
CG (Felner et al. 2018): a lower bound on the minimum vertex cover of the graph of agents with cardinal conflicts.
Dg
DG (Li et al. 2019): the same over the graph of dependent agents, whose MDDs have no conflict-free combination. At least CG.
Wdg
WDG (Li et al. 2019): the DG graph with each edge weighted by how much the pair’s sum of costs must rise, found by a small CBS over the pair (capped at 64 expansions, then a lower bound), and an edge-weighted vertex cover. At least DG.