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.
Glossary
Conflict-Based Search (CBS)

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.
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.
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.
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.
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.
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.
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.
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.
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.
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 / Metric | Conflict-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 |
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Conflict-Based Search operates within a broader ecosystem of multi-agent planning, collision avoidance, and real-time control. These related concepts define the problems CBS solves and the techniques with which it integrates.
Constraint Tree
The constraint tree is the core data structure of the CBS algorithm. It is a binary tree where:
- Each node contains a set of constraints (e.g., "agent A cannot be at cell (5,7) at timestep 10") and a set of individual agent paths that respect those constraints.
- The root has no constraints.
- Child nodes are created by resolving a conflict from the parent node, branching to impose the conflict-resolving constraint on one agent or the other.
- CBS performs a best-first search over this tree to find a node where all paths are conflict-free.
Low-Level Planner
In CBS's two-level architecture, the low-level planner is responsible for finding an optimal path for a single agent, subject to the constraints passed down from the high-level search. Typically, this is a variant of A* search (like Space-Time A*) that operates in a space-time domain, ensuring the agent avoids specific cells at specific times as dictated by the constraints. The efficiency of this low-level planner is critical to CBS's overall performance.
Cardinal vs. Semi-Cardinal vs. Non-Cardinal Conflicts
CBS performance is heavily influenced by how it classifies and prioritizes conflicts:
- Cardinal Conflict: A conflict where resolving it forces at least one of the involved agents to incur a longer path. These are the most important to resolve first.
- Semi-Cardinal Conflict: A conflict where resolving it forces exactly one agent to take a longer path.
- Non-Cardinal Conflict: A conflict where both agents can avoid it without increasing their path cost. Advanced CBS variants (ICBS) use this classification in a conflict prioritization strategy to dramatically reduce the size of the constraint tree searched.
Space-Time A*
Space-Time A* is the most common low-level planner used within CBS. It extends the classic A* algorithm by adding time as an explicit dimension in its search space. The state is defined as (x, y, t). This allows the planner to:
- Enforce vertex constraints (avoid a specific cell at a specific time).
- Enforce edge constraints (avoid moving from cell A to cell B during a specific time interval).
- Find paths that are optimal in a space-time continuum, which is necessary for CBS to guarantee optimality in terms of sum-of-costs.
Optimality (Sum-of-Costs / Makespan)
A key value proposition of CBS is its guarantee of optimality. In MAPF, this is defined by two primary objective functions:
- Sum-of-Costs: The sum of the path lengths (or travel times) for all agents. CBS is optimal with respect to this metric.
- Makespan: The total time until the last agent reaches its goal. While CBS can be adapted for this, its standard form optimizes for sum-of-costs. The algorithm's best-first search over the constraint tree ensures the first conflict-free solution found has the lowest possible sum-of-costs, given the constraints propagated from the high-level search.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us