Skip to main content

icts

Function icts 

Source
pub fn icts<G: Graph>(
    instance: &Instance<G>,
    objective: Objective,
    budget: impl Budget<Stats>,
) -> MapfResult
Expand description

Finds a conflict-free plan with the optimal objective value by increasing cost tree search.

budget is asked before evaluating each cost vector; MapfResult::stats counts evaluated vectors in Stats::expanded and queued vectors (the root included) in Stats::generated. ICTS proves unsolvability only when an agent cannot reach its goal even alone; on other unsolvable instances the tree is infinite and the run ends at the budget. For makespan, the m-th vector searches MDDs about m levels deep, so such a run costs roughly the cube of the budget; keep makespan budgets small (a few hundred vectors take seconds).

For Objective::Makespan the plan’s sum of costs is low but not guaranteed minimal among the makespan-optimal plans: the joint MDD search returns the first combination it finds. The search is exponential in the number of agents whose costs must rise, so ICTS suits instances where few agents interact strongly.

§Examples

use mapf_search::{Agent, Grid, Instance, Limits, Objective, icts};

// Two agents swap the ends of a corridor with one side pocket.
let grid = Grid::parse(&["...", "@.@"]);
let agents = vec![
    Agent { start: grid.vertex(0, 0), goal: grid.vertex(2, 0) },
    Agent { start: grid.vertex(2, 0), goal: grid.vertex(0, 0) },
];
let instance = Instance::new(grid, agents)?;

let result = icts(&instance, Objective::SumOfCosts, Limits::expansions(1_000));
assert_eq!(result.solution().expect("solvable").sum_of_costs, 7);