Conflict-Based Search (CBS) is a two-level, optimal algorithm for Multi-Agent Path Finding (MAPF) that systematically resolves collisions by searching a tree of constraints. At the high level, it detects conflicts—where two agents occupy the same location at the same time—and branches to impose constraints that forbid specific agents from being in that spatio-temporal cell. At the low level, a fast single-agent pathfinder (like A*) is called for each agent to find an optimal path that respects the current set of constraints. This hierarchical decoupling allows CBS to guarantee finding a conflict-free, optimal solution, typically minimizing the sum of costs (e.g., total time steps) for all agents.
Glossary
Conflict-Based Search (CBS)

What is Conflict-Based Search (CBS)?
Conflict-Based Search (CBS) is a leading, optimal algorithm for solving the Multi-Agent Path Finding (MAPF) problem, which is fundamental to coordinating robots, warehouse automation, and video game character movement.
The algorithm's power lies in its constraint tree, where each node represents a set of constraints and the corresponding individual agent paths. CBS expands the tree by resolving the most promising conflict, creating child nodes with new constraints. Its optimality is proven, but its primary limitation is scalability; the search space grows exponentially with the number of agents and conflicts. Variants like CBS with Prioritization (CBS-P) and Enhanced CBS (ECBS) introduce sub-optimality bounds to dramatically improve speed for large-scale problems, making it practical for real-world heterogeneous fleet coordination in logistics and autonomous mobile robot systems.
Key Characteristics of CBS
Conflict-Based Search (CBS) is a two-level, optimal algorithm for Multi-Agent Path Finding (MAPF). Its defining architecture separates high-level conflict resolution from low-level path planning, creating a systematic search for collision-free solutions.
Two-Level Search Architecture
CBS operates on two distinct levels:
- High-Level (Constraint Tree Search): This level searches a binary tree where each node represents a set of constraints imposed on agents to resolve conflicts (e.g., "Agent A cannot be at cell (5,3) at timestep 7"). The algorithm expands nodes by identifying the first conflict in the current solution and creating two child nodes, each adding a constraint to one of the conflicting agents.
- Low-Level (Single-Agent Planner): For each agent, a low-level search (typically A*) finds an optimal path from start to goal that satisfies all constraints currently assigned to that agent from the high-level node. This separation is key to CBS's optimality and modularity.
Optimality Guarantee
CBS is provably optimal for common MAPF cost functions like Sum of Costs (total timesteps for all agents) or Makespan (maximum finish time). It guarantees finding a conflict-free solution with the minimum possible cost because:
- The high-level tree is systematically explored.
- The low-level planner is optimal for the single-agent problem given its constraints.
- The algorithm only prunes branches of the constraint tree when it can prove no better solution exists below them, ensuring no optimal solution is missed.
Constraint-Based Conflict Resolution
Conflicts are the core abstraction. A conflict is a tuple (a_i, a_j, v, t) where agents a_i and a_j occupy the same vertex v at timestep t (vertex conflict) or swap positions along an edge (edge conflict).
- Resolution: CBS resolves a conflict by generating vertex constraints (
a_i, v, t) or edge constraints (a_i, u, v, t). - Propagation: These constraints are passed to the low-level planners, which must replan paths that avoid the specified state at the given time. This method transforms a multi-agent problem into a series of constrained single-agent problems.
Primary Use Cases & Examples
CBS excels in structured, discrete environments where optimality is critical:
- Warehouse Automation: Coordinating fleets of Autonomous Mobile Robots (AMRs) on a grid-based factory floor to move goods from shelves to packing stations without deadlocks.
- Video Game AI: Planning optimal, collision-free paths for multiple non-player characters (NPCs) in strategy or simulation games.
- Aircraft Towing: Scheduling optimal, conflict-free routes for vehicles towing planes on airport aprons.
- Multi-Drone Delivery: Planning precise takeoff, flight, and landing sequences for a swarm of delivery drones in an urban airspace grid.
Advantages Over Alternatives
Compared to other MAPF approaches, CBS offers distinct benefits:
- Optimality: Unlike reactive or prioritized planning, CBS guarantees an optimal solution.
- Completeness: It will find a solution if one exists, unlike some heuristic methods.
- Modularity: The low-level planner can be swapped (e.g., using Dijkstra's for weighted graphs) without altering the high-level logic.
- Conceptual Clarity: The constraint-tree visualization makes the search process and conflict resolution transparent and debuggable.
Limitations and Computational Complexity
CBS's strengths come with trade-offs:
- Scalability: The number of high-level tree nodes can grow exponentially with the number of agents and complexity of the environment. It is typically used for tens of agents, not hundreds.
- Memory Usage: The entire constraint tree must be stored during search, which can be large.
- Runtime: While optimal, it can be slower than suboptimal but fast algorithms like Prioritized Planning or Windowed Hierarchical Cooperative A* (WHCA*).
- Continuous Domains: CBS is designed for discrete, graph-based environments. Applying it to continuous state spaces requires significant discretization.
How Conflict-Based Search (CBS) Works
Conflict-Based Search (CBS) is a leading, two-level algorithm for solving the Multi-Agent Path Finding (MAPF) problem optimally, ensuring collision-free paths for multiple robots or agents in a shared space.
Conflict-Based Search (CBS) is an optimal, two-level algorithm for Multi-Agent Path Finding (MAPF) that resolves collisions by searching a tree of constraints. At the high level, a constraint tree (CT) is built where each node contains a set of constraints (e.g., prohibiting an agent from being at a specific location at a specific time) and a solution where each agent's path satisfies its current constraints. The algorithm expands the tree by identifying the first conflict (e.g., a vertex or edge collision) between any two agents in the current solution and creating child nodes that add a new constraint for each agent involved in that conflict to resolve it.
The low level of CBS is a series of fast, single-agent A searches* that find the shortest path for an individual agent from start to goal, subject to the specific set of constraints passed down from the high-level node. This hierarchical decomposition separates the complexity of multi-agent coordination from efficient single-agent planning. CBS guarantees optimality (minimizing the sum of individual path costs) because the high-level search systematically explores all possible ways of resolving conflicts through constraints until it finds a conflict-free solution with the lowest total cost.
CBS vs. Other MAPF Approaches
A feature and performance comparison of Conflict-Based Search against other major algorithmic families for solving the Multi-Agent Path Finding problem.
| Algorithmic Feature / Metric | Conflict-Based Search (CBS) | Decoupled / Prioritized Planning | Centralized (A* with Joint State) | Reactive / Local (e.g., ORCA) |
|---|---|---|---|---|
Core Paradigm | Two-level optimal search (Constraint Tree) | Sequential path planning with priority ordering | Monolithic joint state-space search | Continuous velocity selection based on local sensing |
Solution Guarantee | Optimal (w.r.t. sum-of-costs or makespan) | Suboptimal (highly priority-dependent) | Optimal (exhaustive) | No guarantee; may deadlock |
Primary Search Space | Constraint space (high-level) & individual graphs (low-level) | Sequence of individual agent graphs | Exponential joint state space (Π |V_i|) | Continuous velocity space |
Scalability (Agent Count) | Medium (tens of agents) | High (hundreds of agents) | Very Low (≤ 4 agents) | Very High (hundreds of agents) |
Handles Complex Agent Kinematics | ||||
Computational Complexity | High (exponential in worst-case conflicts) | Low (linear in number of agents) | Very High (exponential in agents) | Very Low (constant per agent) |
Typical Use Case | Warehouse logistics, structured automation | Video game NPCs, initial feasible plans | Academic benchmarking, small proof-of-concept | Crowd simulation, dynamic drone swarms |
Plan Execution | Pre-computed, time-indexed paths | Pre-computed, time-indexed paths | Pre-computed, time-indexed paths | Online, continuous control |
Requires Global Coordination | ||||
Robust to Agent Failures | ||||
Standard Benchmark Performance (Success Rate) |
| ~70-85% (priority-dependent) | 100% (for solvable instances) | ~60-80% (prone to livelock) |
Memory Overhead | High (stores entire constraint tree) | Low (stores individual paths) | Prohibitively High (stores joint state) | Negligible (local state only) |
Applications and Use Cases
Conflict-Based Search (CBS) is a foundational optimal algorithm for Multi-Agent Path Finding (MAPF). Its primary application is coordinating the collision-free movement of multiple agents in shared spaces, a critical requirement for modern automated systems.
Video Game & Simulation AI
CBS is extensively used in video game engines and crowd simulation software to generate natural-looking, collision-free movement for hundreds of non-player characters (NPCs). It is the preferred method when optimality guarantees are desired for squad-based tactics or complex crowd scenes. Unlike reactive methods, CBS plans full paths from start to goal, preventing oscillatory or deadlock behavior common in local methods.
- Key Problem Solved: Creating believable, purposeful group movement in real-time simulations.
- Performance: Modern adaptations like CBS with Prioritization (CBS-P) are used for real-time performance with dozens of agents.
Robotic Assembly & Kitting Cells
In flexible manufacturing cells, multiple robotic arms collaborate to assemble products. CBS coordinates their motions to avoid arm-to-arm collisions while minimizing the cycle time for the entire workcell. Each robot's path is a sequence of joint-space or Cartesian-space waypoints, and conflicts are defined as simultaneous occupancy of the same physical volume.
- Key Problem Solved: Safe, efficient coordination of manipulators in a shared workspace.
- Engineering Consideration: Must be integrated with real-time Motion Planning and Trajectory Optimization for smooth, dynamically feasible movements.
Advantages Over Alternative Methods
CBS is favored in applications requiring provable optimality (e.g., minimizing total makespan). Its two-level architecture offers distinct engineering advantages:
- Modularity: The low-level pathfinder (e.g., A*) can be swapped for any graph search algorithm, even for continuous spaces.
- Completeness: If a solution exists, CBS will find it.
- Constraint-Based Reasoning: The constraint tree provides an explicit, auditable record of every conflict resolution decision, which is valuable for debugging and validation in safety-critical systems like aviation or healthcare robotics.
Contrast with Reactive Methods: Unlike Optimal Reciprocal Collision Avoidance (ORCA), which computes velocities instantaneously, CBS provides a full planned path, preventing myopic decisions that can lead to deadlocks in complex mazes.
Frequently Asked Questions
Conflict-Based Search (CBS) is a foundational, optimal algorithm for Multi-Agent Path Finding (MAPF). These questions address its core mechanics, applications, and how it compares to other coordination methods.
Conflict-Based Search (CBS) is a two-level, optimal algorithm for solving the Multi-Agent Path Finding (MAPF) problem. It operates by recursively resolving conflicts between agent paths. At the high level, the algorithm searches a constraint tree. Each node in this tree represents a set of constraints (e.g., "agent A cannot be at cell (5,7) at timestep 10") imposed to resolve a detected conflict. When a conflict (like two agents occupying the same location at the same time) is found in a solution, the high level creates child nodes with new constraints forbidding that conflict for each involved agent. At the low level, a single-agent pathfinding algorithm (like A*) is run for each agent, but it must now find a path that respects all constraints generated by the current high-level node. The process continues until a node is found where all individual agent paths are conflict-free, guaranteeing an optimal solution relative to the chosen cost function (e.g., sum-of-costs).
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 (CBS) is a core algorithm within the broader field of Multi-Agent Path Finding (MAPF). The following terms represent key concepts, alternative algorithms, and foundational problems that define this technical domain.
Multi-Agent Path Finding (MAPF)
Multi-Agent Path Finding (MAPF) is the foundational computational problem that CBS solves. It involves finding collision-free paths for multiple agents (e.g., robots, warehouse AMRs) from their start positions to designated goals in a shared environment, typically represented as a graph. The objective is to optimize a global metric, such as:
- Sum of costs: Minimizing the total time or distance traveled by all agents.
- Makespan: Minimizing the time until the last agent reaches its goal.
- Flowtime: The sum of each agent's completion time. MAPF is NP-hard, making optimal solvers like CBS essential for planning in complex, congested spaces like fulfillment centers or factory floors.
Optimal Reciprocal Collision Avoidance (ORCA)
Optimal Reciprocal Collision Avoidance (ORCA) is a decentralized, reactive algorithm for local collision avoidance, contrasting with CBS's centralized, deliberative planning. ORCA operates in continuous space and time, where each agent observes the velocities of nearby agents and computes a new velocity that is guaranteed to be collision-free for a short time horizon, assuming other agents follow the same reciprocal rules. Key characteristics:
- Real-time: Computes velocities every control cycle (e.g., 10-100 Hz).
- Velocity obstacles: Agents consider the set of velocities that would lead to a future collision.
- Reactive vs. Planned: ORCA handles dynamic, unforeseen obstacles but does not provide global optimality or deadlock resolution, which is where CBS excels.
Multi-Robot Task Allocation (MRTA)
Multi-Robot Task Allocation (MRTA) is the problem of assigning a set of tasks to a team of robots to optimize overall performance. It is often a prerequisite to path planning with CBS. MRTA determines which robot does what, while CBS determines how they move without colliding. Common MRTA formulations include:
- Single-Task robots (ST): Each robot can execute at most one task at a time.
- Single-Robot tasks (SR): Each task requires exactly one robot.
- Multi-Robot tasks (MR): Tasks may require simultaneous coordination of multiple robots. Algorithms like auction-based coordination (e.g., using a consensus-based bundle algorithm) are frequently used for decentralized MRTA, after which CBS can plan collision-free paths for the assigned goals.
Spatio-Temporal Planning
Spatio-temporal planning is the general approach of finding plans that specify both where and when an agent should be. CBS is a quintessential spatio-temporal planner. It enforces vertex constraints (agent i cannot be at vertex v at time t) and edge constraints (agent i cannot move from vertex u to vertex v at time t). This is more expressive than purely spatial planning, enabling:
- Deadlock avoidance: Preventing two agents from indefinitely blocking each other in a narrow corridor.
- Synchronization: Coordinating agents to meet at a location for a handoff.
- Temporal optimization: Minimizing total time or ensuring all agents arrive before a deadline. The constraint tree in CBS systematically explores the space of possible spatio-temporal constraints to resolve conflicts.
Decentralized Control
Decentralized control is an architectural paradigm for multi-robot systems where each robot makes decisions based on local sensory information and communication with nearby neighbors, without a central coordinator. This contrasts with CBS's centralized two-level search. Decentralized approaches offer:
- Scalability: Performance degrades gracefully as the number of robots increases.
- Robustness: The system can tolerate the failure of individual robots.
- Flexibility: Robots can dynamically join or leave the team. While CBS is centralized, its principles inform decentralized variants (e.g., CBS with disjoint splitting) and hybrid architectures where a central planner like CBS handles high-congestion zones, and decentralized reactive controllers like ORCA handle local navigation.
Constraint Tree
The constraint tree is the core data structure and search space of the CBS algorithm's high-level search. Each node in this tree represents a set of constraints imposed on the agents (e.g., "Agent 2 must avoid cell (5,3) at time 7"). The root node has an empty constraint set. The algorithm proceeds as follows:
- Low-level search: For each node, a single-agent pathfinder (like A*) finds an optimal path for each agent that respects the node's constraints.
- Conflict detection: The resulting set of paths is checked for collisions (vertex or edge conflicts).
- Branching: If a conflict is found between agents i and j, the node generates two child nodes. One child adds a constraint preventing agent i from being in the conflicted state, and the other adds a symmetric constraint for agent j. The tree is systematically explored (often using best-first search) until a node is found where all agent paths are conflict-free, guaranteeing an optimal solution.

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