pub enum Splitting {
Standard,
Disjoint,
}Expand description
How CBS splits a conflict between agents a and b (CbsConfig::splitting).
Both keep every solution in exactly one child or in both, so both are optimal.
§Examples
use mapf_search::{Agent, CbsConfig, Grid, Instance, Limits, Objective, Splitting, 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 = |splitting| {
let config = CbsConfig { splitting, ..CbsConfig::improved(Objective::SumOfCosts) };
cbs_with(&instance, config, Limits::expansions(100_000))
};
let (standard, disjoint) = (run(Splitting::Standard), run(Splitting::Disjoint));
assert_eq!(standard.solution().map(|s| s.sum_of_costs), Some(19));
assert_eq!(disjoint.solution().map(|s| s.sum_of_costs), Some(19));
assert!(disjoint.stats.expanded < standard.stats.expanded);Variants§
Standard
One child forbids the conflict to a, the other to b (Sharon et al. 2015). A
solution that avoids the conflict both ways lies below both children.
Disjoint
Disjoint splitting (Li et al. 2019): one child forbids the conflict to one agent, the other requires it of that agent with a positive constraint, which forbids it to every other agent. The two subtrees share no solution.
The split agent is the one for whom the conflict is forced (every cheapest path takes part in it) if only one is and its MDD is known, else the smaller id. Forcing it keeps its cost in the positive child and raises it in the negative one.