Inferensys

Glossary

Conflict-Based Search (CBS)

Conflict-Based Search (CBS) is a two-level optimal search algorithm for Multi-Agent Path Finding that resolves conflicts between agents by imposing constraints and replanning individual paths.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
MULTI-AGENT PATH PLANNING

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.

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*.

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.

ALGORITHM MECHANICS

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.

01

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.
02

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.
03

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.
04

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.
05

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.
06

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.
ALGORITHM COMPARISON

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 / MetricConflict-Based Search (CBS)Centralized Joint Search (e.g., MAA*)Decoupled / Prioritized PlanningReactive 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)

MULTI-AGENT PATH PLANNING

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.

01

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.
02

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.
03

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.
04

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.
05

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.
06

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.
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 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.

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.