mapf-search
Multi-agent pathfinding: CBS, ECBS, ICTS, PBS, M* and multi-objective MO-CBS on grids and general graphs.
Given a graph and a set of agents with start and goal vertices, the solvers find one path per
agent so that no two agents ever share a vertex or swap along an edge. CBS, ICTS and M*
minimize the sum of costs or the makespan, ECBS stays within a given factor of the optimum,
and PBS trades optimality for speed. The optimal solvers are checked against a joint-space oracle by
property tests, and M* also proves when an instance has no solution. The crate is
no_std with alloc, uses the A* of
heuristic-search as its single-agent low
level, and reads the Moving AI .map and .scen benchmark formats.
Who this is for
- Robotics and warehouse automation: fleets of mobile robots or AGVs on a grid or a roadmap graph that must reach their goals without collisions.
- Game developers moving groups of units through tight corridors, where independent A* per unit deadlocks or collides.
- Researchers who want CBS and its improvements (prioritized conflicts, bypass, CG/DG/WDG heuristics, disjoint splitting) switchable one by one, next to ECBS, ICTS, PBS and M* on the same instance type.
- Planners that trade off several costs per agent (time, energy, risk): MO-CBS returns every Pareto-optimal joint plan, using multiobjective-search as its low level.
- For a single agent, use heuristic-search directly; for many connectors on a diagram that may cross at a cost rather than never meet, connector-routing is the better fit.
Installation
Or in Cargo.toml:
[]
= "0.1"
Algorithms
- CBS, optimal for sum of costs or makespan, with prioritized (cardinal) conflicts,
bypass, the CG, DG and WDG heuristics, a conflict avoidance table and disjoint
splitting (with positive constraints), each switchable (
cbs,cbs_with,CbsConfig) - ECBS, bounded-suboptimal, focal search at both levels (
ecbs) - PBS, priority-based search: fast, neither optimal nor complete (
pbs) - ICTS with pairwise pruning, optimal (
icts) - M*, basic and recursive (rM*), each with or without operator decomposition (OD-M*,
ODrM*), optimal, proves unsolvability (
mstar,mstar_with,MStarConfig) - MO-CBS, multi-objective CBS: every Pareto-optimal plan when moves and waits cost
vectors, shared or per agent; plain or tree-by-tree (MO-CBS-t), over BOA* or NAMOA*dr
from
multiobjective-search, with an opt-in feasibility check (proves unsolvability), conflict prioritization, bypass and disjoint splitting (mo_cbs,mo_cbs_with,mo_cbs_per_agent,MoCbsConfig; optional featuremulti-objective) - Every single-objective solver takes an
Objective: sum of costs or makespan - Shared parts: conflict detection, constraints, space-time A* low level, MDDs, Moving AI
.map/.scenparsers
Not yet implemented: CBS-TA (conflict-based search with task assignment), MAPF-LNS2 (large neighborhood search repair) and EPEA* (enhanced partial expansion).
Usage
use ;
// Two agents swap the ends of a corridor that has one side pocket.
let grid = parse;
let agents = vec!;
let instance = new?;
let result = cbs;
let solution = result.solution.expect;
assert_eq!;
assert_eq!;
# Ok::
The crate is no_std and needs only alloc. The feature multi-objective adds MO-CBS
over multiobjective-search.
MSRV
Rust 1.86 (rust-version in Cargo.toml), for every feature. The MSRV is a signal, not a
contract: it may rise in a minor release.
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. See CONTRIBUTING.md.