Inferensys

Glossary

Conflict-Based Search (CBS)

Conflict-Based Search (CBS) is an optimal, two-level algorithm for Multi-Agent Path Finding that resolves collisions by imposing constraints and recursively searching a constraint tree.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
REAL-TIME REPLANNING ENGINES

What is Conflict-Based Search (CBS)?

Conflict-Based Search is a foundational, optimal algorithm for Multi-Agent Path Finding (MAPF) that systematically resolves collisions between agents.

Conflict-Based Search (CBS) is a two-level, optimal search algorithm for Multi-Agent Path Finding (MAPF) that resolves conflicts between individual agent paths by imposing constraints and recursively searching a binary constraint tree. At the high level, the algorithm detects the first conflict (e.g., two agents occupying the same vertex at the same time) and creates child nodes with new constraints that forbid that specific conflict for each involved agent. At the low level, a fast single-agent path planner (like A*) replans paths for the constrained agents, ensuring optimality for each agent given the current set of constraints.

The algorithm's power lies in its decoupled search, which avoids the exponential state-space explosion of joint-state searches. It guarantees finding a conflict-free, optimal solution (minimizing sum-of-costs or makespan) if one exists. CBS is a cornerstone for heterogeneous fleet orchestration, providing a structured framework for real-time replanning engines to resolve deadlocks and dynamic conflicts in warehouses and logistics centers by iteratively repairing agent plans.

ALGORITHM MECHANICS

Key Features of Conflict-Based Search

Conflict-Based Search is a two-level, optimal algorithm for Multi-Agent Path Finding. Its architecture is defined by a recursive constraint tree that systematically resolves conflicts between individual agent paths.

01

Two-Level Search Architecture

CBS operates on two distinct levels. The high-level search explores a Constraint Tree (CT), where each node contains a set of constraints and a solution. The low-level search is a single-agent path planner (like A*) that finds optimal paths for each agent, respecting the constraints passed down from the high level. This separation of concerns allows CBS to be agent-independent at the low level, meaning any single-agent planner can be used as a subroutine.

02

Constraint Tree (CT) and Conflict Resolution

The core data structure is a binary Constraint Tree. Each node contains:

  • A set of constraints (agent, vertex, timestep).
  • A solution: a set of individual agent paths satisfying those constraints.
  • A total cost (e.g., sum of path lengths).

When the high-level search finds a conflict (e.g., two agents occupying the same vertex at the same timestep), it generates two child nodes. Each child inherits the parent's constraints plus one new constraint forbidding one agent from being at the conflict location at that timestep. This recursively splits the search space to resolve the conflict.

03

Optimality Guarantee

CBS is provably optimal for common MAPF objectives like Sum of Costs (total timesteps) or Makespan (maximum finish time), provided the low-level planner is optimal for individual agents. The high-level search explores the CT in a best-first order (typically using a priority queue sorted by solution cost). Because it expands the lowest-cost node first, the first conflict-free solution found is guaranteed to be optimal. This makes it a complete algorithm.

04

Vertex and Edge Conflicts

CBS explicitly identifies and resolves two primary conflict types:

  • Vertex Conflict: Two agents occupy the same location (vertex) at the same timestep.
  • Edge Conflict: Two agents traverse the same edge in opposite directions simultaneously.

Some implementations also handle following conflicts (one agent occupies a vertex the previous agent just left) and swap conflicts. Each conflict type generates specific spatial-temporal constraints (e.g., agent 1 != vertex (x,y) at time t) that are added to the child nodes in the CT.

05

Bypassing Conflicts & Meta-Agent Reasoning

Advanced CBS variants improve efficiency through sophisticated conflict analysis:

  • Bypassing: If replanning for one agent in a conflict yields a path with the same cost that avoids the conflict, the solution is updated without branching the CT, reducing search depth.
  • Meta-Agent (CBS-MA): When agents are in prolonged conflict, they can be merged into a meta-agent. The low-level planner then finds a joint path for the meta-agent, which is optimal for the subgroup, preventing an exponential blow-up of the CT from repeated pairwise constraints.
06

Limitations and Computational Complexity

While optimal, CBS has significant limitations:

  • High-Level Search Space: The CT can grow exponentially with the number of agents and conflicts (O(2^n) in worst case).
  • Low-Level Replanning: Each CT node triggers a full replan for at least one agent, which is computationally expensive.
  • Dense Environments: Performance degrades in highly congested spaces with many interdependent conflicts.

These limitations led to the development of bounded-suboptimal variants like Enhanced CBS (ECBS) and CBS with Prioritized Planning (CBS-PP), which sacrifice guaranteed optimality for orders-of-magnitude faster planning.

ALGORITHM COMPARISON

CBS vs. Other MAPF Approaches

A technical comparison of Conflict-Based Search against other major algorithmic families for solving the Multi-Agent Path Finding problem, highlighting trade-offs in optimality, scalability, and real-time applicability.

Algorithmic Feature / MetricConflict-Based Search (CBS)Decentralized / Reactive (e.g., ORCA)Coupled / Centralized (e.g., Space-Time A*)

Core Paradigm

Two-level optimal search (high-level constraint tree, low-level pathfinding)

Local velocity selection based on reciprocal assumptions

Monolithic search in a joint state-space (agents x time)

Solution Guarantee

Optimal (for given cost function)

Local collision avoidance; no global path or optimality guarantee

Optimal (within the discretized search space)

Scalability (Number of Agents)

Moderate (dozens in practice; struggles with high density)

High (hundreds in real-time simulation)

Very Low (exponential state-space explosion)

Handles Dynamic Environments

Replanning Efficiency

Moderate (incremental via constraint tree)

High (reactive, per-time-step computation)

Low (requires full re-search from scratch)

Inter-Agent Coordination

Implicit via constraint propagation

Explicit via velocity reciprocity

Explicit via centralized joint search

Typical Use Case

Warehouse AMR fleet orchestration with known tasks

Crowd simulation, drone swarms in open space

Theoretical analysis, small-scale puzzle solving

Computational Bottleneck

High-level constraint tree expansion

Solving local convex optimization per agent

Joint state-space dimensionality

Integration with Task Allocation

CONFLICT-BASED SEARCH (CBS)

Frequently Asked Questions

Conflict-Based Search (CBS) is a foundational, optimal algorithm for Multi-Agent Path Finding (MAPF). These questions address its core mechanisms, applications, and how it compares to other planning approaches.

Conflict-Based Search (CBS) is a two-level, optimal algorithm for Multi-Agent Path Finding (MAPF) that resolves conflicts between individual agent paths by imposing constraints and recursively searching a constraint tree. It operates on two distinct layers: a high-level constraint tree (CT) and low-level path planners. The high-level search detects the first conflict (e.g., two agents occupying the same vertex at the same timestep) in the current set of paths. It then branches by imposing a new constraint on one of the involved agents to avoid that conflict (e.g., 'Agent A cannot be at vertex V at time T') and replans that agent's path using the low-level A* search, subject to all constraints accumulated along the branch. The algorithm explores this binary constraint tree, continually resolving conflicts, until it finds a node where all agent paths are conflict-free, guaranteeing an optimal solution that minimizes a global cost function like sum-of-costs or makespan.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.