Conflict-Based Search (CBS) is a two-level, optimal search algorithm for Multi-Agent Path Finding (MAPF) that resolves conflicts between agents by imposing constraints and replanning individual paths. At the high level, it searches a constraint tree (CT) where each node contains a set of constraints and a solution. When a conflict (e.g., a vertex or edge conflict) is found in a solution, the algorithm generates child nodes by adding constraints that forbid that conflict for each involved agent, then replans their paths using a low-level single-agent path planner like A*.
Glossary
Conflict-Based Search (CBS)

What is Conflict-Based Search (CBS)?
Conflict-Based Search (CBS) is a foundational, optimal algorithm for the Multi-Agent Path Finding (MAPF) problem, designed to coordinate multiple agents in a shared workspace.
The algorithm's power lies in its decoupled nature; it avoids searching the prohibitively large joint state space directly. Instead, it explores combinations of constraints, guaranteeing an optimal solution that minimizes the sum of costs (SOC) or makespan. CBS is a cornerstone for heterogeneous fleet orchestration, providing a structured framework for scalable, collision-free coordination of autonomous mobile robots and vehicles in logistics and warehousing.
Key Features of CBS
Conflict-Based Search (CBS) is a two-level, optimal algorithm for Multi-Agent Path Finding. Its architecture separates high-level constraint management from low-level single-agent planning, enabling systematic conflict resolution.
Two-Level Search Architecture
CBS operates on two distinct levels:
- High-Level (Constraint Tree): A binary search tree where each node contains a set of constraints and a solution. The algorithm detects conflicts between agent paths in the current solution and branches by adding constraints to resolve them.
- Low-Level (Single-Agent Planner): For each node in the constraint tree, a fast single-agent pathfinder (like A*) replans paths for individual agents, respecting all constraints imposed from above. This separation is fundamental, allowing CBS to avoid searching the prohibitively large joint state space directly.
Constraint-Based Conflict Resolution
Conflicts are the core driver of CBS's search. When two agents conflict (e.g., a vertex conflict at the same location/time), CBS does not replan arbitrarily. Instead, it generates child nodes with new constraints:
- One child node gets a constraint preventing Agent A from being at the conflicting vertex at that time.
- The other child gets a symmetric constraint for Agent B. The low-level planner is then invoked for the affected agent to find a new path that obeys the new constraint, often by waiting or taking a detour. This methodical branching ensures completeness and optimality.
Optimality Guarantee
CBS is provably optimal for minimizing the Sum of Costs (SOC). Optimality is achieved through the systematic exploration of the constraint tree:
- The high-level search uses a priority queue (typically sorted by the SOC of the node's solution).
- It always expands the node with the lowest current total cost.
- Because constraints can only increase path costs (or leave them the same), the first node expanded that contains a conflict-free solution is guaranteed to have the minimum possible SOC. This makes CBS a best-first search over the space of possible constraint sets.
Multi-Value Decision Diagrams (MDDs)
Advanced CBS implementations use Multi-Value Decision Diagrams to enhance conflict detection and resolution. An MDD for an agent is a compact graph showing all possible optimal paths from start to goal within the current cost bound.
- Efficient Cardinal Conflict Identification: By comparing MDDs, CBS can quickly identify cardinal conflicts—conflicts where resolving them must increase the SOC. This allows for more informed pruning of the constraint tree.
- Bypass Detection: MDDs help identify bypasses, where an agent can take a different optimal path to avoid a conflict without increasing its cost, preventing unnecessary branching.
Focus on Sum of Costs (SOC)
CBS is fundamentally designed to optimize the Sum of Costs, the sum of each agent's individual path length or time. This differs from optimizing makespan (the time until the last agent finishes).
- The low-level planner minimizes cost for a single agent.
- The high-level tree's sorting and expansion strategy minimizes the sum of these individual costs.
- This objective is standard in logistics and warehousing, as it correlates with total fleet energy use, wear-and-tear, and cumulative task completion time.
Completeness for Well-Formed Instances
CBS is complete, meaning it will find a solution if one exists, given sufficient time and memory, for standard MAPF formulations on graphs. Its completeness derives from the fact that the constraint tree represents all possible ways of resolving conflicts through prohibitions.
- If a solution exists, there is a set of constraints (e.g., "Agent 1 avoids vertex v at time t") that describes it.
- CBS's systematic search over the space of constraint sets will eventually generate that set or an equivalent one.
- Note: For lifelong MAPF (LMAPF) or problems with dynamic tasks, standard CBS is not directly applicable and requires online variants.
CBS vs. Other MAPF Algorithms
A feature and performance comparison of Conflict-Based Search (CBS) against other major algorithmic families for Multi-Agent Path Finding (MAPF).
| Algorithmic Feature / Metric | Conflict-Based Search (CBS) | Centralized Joint Search (e.g., MAA*) | Decoupled / Prioritized Planning | Reactive Navigation (e.g., ORCA) |
|---|---|---|---|---|
Core Search Paradigm | Two-level (High-level constraint tree, low-level path planner) | Monolithic joint state space search | Sequential planning with fixed priorities | Distributed velocity selection |
Solution Guarantee | Optimal (for sum-of-costs or makespan) | Optimal | Suboptimal (completeness not guaranteed) | Suboptimal (local minima possible) |
Primary Use Case | Offline, optimal planning for known environments | Offline, optimal planning for small fleets | Online planning with strict computational limits | Online, real-time collision avoidance |
Scalability (Agent Count) | Medium (tens to low hundreds) | Low (typically < 10 agents) | High (hundreds of agents) | Very High (large, dense crowds) |
Handles Kinematic Constraints | ||||
Conflict Resolution Method | Explicit constraint imposition & replanning | Implicit via joint state avoidance | Treats higher-priority agents as moving obstacles | Reciprocal velocity adjustment |
Planning Horizon | Full path to goal | Full path to goal | Full path to goal | Short time window (typically < 5 sec) |
Theoretical Worst-Case Complexity | Exponential in number of conflicts | Exponential in number of agents | Linear in number of agents | Polynomial in number of neighboring agents |
Memory Overhead | Medium (stores constraint tree & individual MDDs) | Very High (stores full joint state frontier) | Low (stores only current agent paths) | Low (stores only current velocities & positions) |
Integration with Task Assignment | ||||
Standard Performance Metric (Sum-of-Costs) | Optimal | Optimal | 10-50% above optimal | Not applicable (metric differs) |
Real-World Applications
Conflict-Based Search (CBS) is a foundational algorithm for optimal Multi-Agent Path Finding. Its two-level architecture—resolving conflicts at a high level and replanning individual paths at a low level—makes it a critical component in systems where collision-free coordination is non-negotiable.
Automated Warehouse Robotics
CBS is deployed in modern fulfillment centers to coordinate fleets of Autonomous Mobile Robots (AMRs). It ensures robots transporting shelves to human pickers or moving packages between stations follow optimal, collision-free paths.
- Key Function: Resolves vertex conflicts (two robots aiming for the same cell) and edge conflicts (head-on collisions in narrow aisles).
- Integration: Often works alongside a Conflict Avoidance Table (CAT) for real-time reservation tracking and real-time replanning engines to handle dynamic obstacles like fallen items or human workers.
Autonomous Vehicle Coordination in Ports & Yards
In container terminals and logistics yards, CBS plans paths for Automated Guided Vehicles (AGVs) and terminal tractors. The environment is highly structured but dynamic, with containers being constantly loaded and unloaded.
- Challenge: Must respect kinodynamic constraints of large vehicles (turning radius, acceleration) and integrate with spatial-temporal scheduling for crane operations.
- Outcome: Minimizes makespan—the total time to clear a batch of transportation jobs—directly impacting port throughput. Solutions are often k-robust to account for minor execution delays.
Multi-Drone Surveillance & Delivery
For drone swarms performing area coverage, light-show choreography, or last-mile delivery, CBS finds optimal trajectories in 3D airspace. The state space includes altitude, requiring adaptations of the standard 2D grid model.
- Application: Avoids cardinal conflicts where drones' paths are mutually exclusive, ensuring no mid-air collisions.
- Technique: Often uses bounded suboptimal search variants of CBS to generate safe paths in milliseconds, a necessity for real-time flight control. Integrates with reactive collision avoidance systems like Optimal Reciprocal Collision Avoidance (ORCA) for last-moment adjustments.
Video Game & Simulation AI
CBS is used in game engines and military simulations to generate believable, collision-free movement for large groups of non-player characters (NPCs) or units. It provides optimal or bounded-suboptimal group paths that are more coherent than individual agent planning.
- Advantage: Produces solutions that minimize the overall sum of costs (SOC), creating efficient group maneuvers.
- Method: Game engines may use a windowed approach, running CBS over a short planning horizon and replanning frequently to handle player interactions, aligning with Lifelong MAPF (LMAPF) concepts.
Factory Floor Automation
In smart manufacturing, CBS coordinates the movement of heterogeneous fleets—such as assembly robots, transport carts, and mobile manipulators—across shared work cells. This is a core component of Software-Defined Manufacturing Automation.
- Requirement: Must interface with zone management protocols (e.g., speed limits in human areas) and priority-based routing for urgent tasks.
- Process: The high-level search tree in CBS efficiently manages deadlock detection and recovery by imposing constraints that prevent cyclical waiting scenarios, a critical failure mode in dense layouts.
Algorithmic Benchmark & Research
Beyond direct deployment, CBS serves as a gold-standard benchmark in academic and industrial research for optimal MAPF. Its clear separation of conflict resolution (high-level) and path planning (low-level) provides a modular framework for innovation.
- Extensions: Foundational for advanced algorithms like ICTS (Increasing Cost Tree Search), which uses Multi-Valued Decision Diagrams (MDDs), and CBS with bypasses, which attempts local path modifications before imposing constraints.
- Role: Used to evaluate new MAPF techniques against a proven optimal solver, driving progress in the entire field of multi-agent orchestration.
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 planning approaches.
Conflict-Based Search (CBS) is a two-level optimal search algorithm for Multi-Agent Path Finding (MAPF) that resolves conflicts between agents by imposing constraints and replanning individual paths. It operates via a high-level constraint tree (CT) and low-level path planners. The algorithm begins by finding an initial, possibly conflicting, path for each agent using a low-level planner like A*. It then detects the first conflict (e.g., two agents occupying the same vertex at the same time). For this conflict, the high-level search generates two new nodes in the CT: one with a constraint preventing the first agent from being at that location at that time, and another with the complementary constraint for the second agent. The low-level planner replans for the affected agent in each node, respecting the new constraint. This process repeats, branching on conflicts, until a node is found where all agent paths are conflict-free. The solution is optimal with respect to the sum of costs (SOC) metric if the low-level planner is optimal.
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) operates within a rich ecosystem of algorithms and data structures designed for Multi-Agent Path Finding. These related concepts define the problem space, alternative solution strategies, and key performance metrics.
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 from their start positions to their goal positions in a shared, typically discretized, environment. The core challenge is the combinatorial explosion of the joint state space.
- Objectives: Common objectives include minimizing Makespan (total completion time) or Sum of Costs (SOC) (total travel distance/time).
- Constraints: Solutions must avoid Vertex Conflicts (two agents in the same location at the same time) and Edge Conflicts (two agents crossing the same edge in opposite directions).
- Applications: Warehouse robotics, video game character navigation, and autonomous vehicle coordination in structured spaces.
Increasing Cost Tree Search (ICTS)
Increasing Cost Tree Search (ICTS) is another optimal MAPF algorithm that takes a different approach from CBS. Instead of resolving conflicts via constraints, ICTS searches a tree of possible cost combinations.
- Mechanism: It first finds the optimal cost for each agent individually. It then searches a tree where each node represents a vector of costs for all agents. For each cost vector, it uses a low-level solver to check if feasible, non-conflicting paths exist for all agents at those exact costs.
- Efficiency: Prunes branches where any agent's individual cost exceeds its allocated budget from the vector.
- Comparison to CBS: While both are optimal, CBS is often more memory-efficient for problems with many conflicts, as it explores constraint trees rather than cost trees.
Multi-Agent A* (MAA*)
Multi-Agent A (MAA)** is a centralized, brute-force optimal algorithm that serves as a conceptual baseline. It applies the A* search algorithm directly to the joint state space of all agents.
- Joint State Space: A state is defined as the combined locations of all agents (e.g., (pos_agent1, pos_agent2, ..., pos_agent_n)).
- Scalability Limitation: The state space grows exponentially with the number of agents (O(branching_factor^#agents)), making it impractical for more than a handful of agents.
- Role in MAPF: MAA* provides a gold-standard optimal solution for benchmarking but highlights the need for more sophisticated algorithms like CBS or ICTS that avoid searching the full joint space.
Conflict Avoidance Table (CAT)
A Conflict Avoidance Table (CAT) is a core data structure used by CBS and many other MAPF algorithms for efficient conflict detection. It stores the space-time reservations of all planned agent paths.
- Function: For a given location
(x, y)and time stept, the CAT can instantly return which agent (if any) is planned to be there. This allows the low-level planner in CBS to check for conflicts in constant time. - Implementation: Often implemented as a hash map where the key is a tuple
(x, y, t)and the value is an agent ID. - Extension: Advanced versions may also store direction of movement or velocity to detect more complex conflict types like Edge Conflicts.
Multi-Valued Decision Diagram (MDD)
A Multi-Valued Decision Diagram (MDD) is a compact, graph-based representation of all possible optimal paths for a single agent within a specific cost bound (e.g., its shortest path length). It is a key component in advanced CBS variants.
- Structure: An MDD is a directed acyclic graph. Nodes represent the agent being at a specific location at a specific time depth. Edges connect nodes from time
ttot+1if the agent can move between those locations. - Use in CBS: MDDs allow for high-level reasoning. A Cardinal Conflict can be identified by checking if the MDDs of two agents intersect at only one node, meaning any resolution will increase the sum of costs.
- Efficiency: Enables more informed conflict selection and resolution strategies, improving algorithm performance.
Bounded-Suboptimal Search
Bounded-Suboptimal Search refers to a class of algorithms, including variants of CBS, that sacrifice guaranteed optimality for dramatic gains in speed and scalability, with a provable cost bound.
- Principle: The algorithm is given a suboptimality factor
w(e.g., 1.1). It is allowed to return a solution whose cost is no worse thanw * optimal_cost. - CBS Application: In Weighted CBS (WCBS), the high-level search uses a focal list or an inflated heuristic (like
w * h(n)) to guide the search, exploring promising but potentially suboptimal constraint trees first. - Practical Value: Essential for real-time applications like video games or large-scale robot fleets where a near-optimal solution found quickly is preferable to an optimal solution found too late.

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