~ / projects /

Lifelong Multi Agent Planning with Conflict Based Search

Multi-agent path finding is NP-hard: route a team of agents from their starts to their goals without collisions, minimizing makespan or total path length. The one-shot version assumes every agent has a single destination and the problem ends when everyone arrives.

A grid maze with grey obstacle walls, and colored squares for agents and colored circles for their goals scattered through it.
The one-shot formulation: each agent (square) has a fixed start and a single fixed goal (circle).

Warehouses do not work that way. An agent that reaches its goal is immediately given another, so the problem never ends and the plan is never finished: the lifelong variant. We built a solver for it and evaluated it on maps from the League of Robot Runners, an Amazon Robotics competition built around exactly this coordination problem.

Two diagrams: an edge conflict, where agents A and B swap cells across the same edge, labelled (A, B, V1, V2, t); and a vertex conflict, where A and B both move into the same next cell, labelled (A, B, V, t).
The two conflict types the planner resolves: edge conflicts, where two agents swap across the same edge, and vertex conflicts, where two agents claim the same cell at the same time.

Approach

Conflict-based search splits planning across two levels. Each agent is routed independently with A* or Dijkstra, ignoring the others; the resulting paths are checked for conflicts; and where two agents collide, the search branches into child nodes that each forbid one agent from that cell at that time. Each branch is replanned and pushed back onto the open list by cost, and the cheapest conflict-free node wins.

Diagram of a robot that can move forward or rotate 90 degrees clockwise or counterclockwise, or wait, with its state as x, y and heading in N, E, W, S, and its goal as x, y.
The agent model: at each step a robot moves forward, rotates 90° either way, or waits. State is position plus heading; a goal is a position.

Making that lifelong meant deciding when to replan. Replanning every timestep is wasteful, since most steps change nothing. Our version keeps a per-agent flag and reruns the search only when an agent reaches its goal and receives a new one, because that is the only event that invalidates the current solution.

Pseudocode for Algorithm 1, Life Long Multi-agent Conflict Based Search: an outer loop that calls CBS only when a run flag is set, executes the next action of each path, and sets the flag for any agent whose action reaches its goal.
The lifelong outer loop: CBS is called only when some agent has just reached its goal.
Pseudocode for the CBS function: build a root node from low-level plans, then repeatedly pop the best node, check for conflicts, and for each conflicting agent push a child node with an added constraint and a replanned solution.
The CBS high-level search: pop the cheapest node, find a conflict, and branch with one new constraint per agent.

Results

Agents replanning in simulation as new goals arrive.
MapAgentsTasks completedSolve time
32 × 3220341670.8 s
33 × 5725366672.7 s

Takeaway. Replanning only on goal-reached events kept the cost of “lifelong” close to one-shot planning: the larger map completed 7% more tasks for 3% more solve time.

The extra agents did most of that work; the larger search space and higher CBS call count absorbed the rest. Two configurations are not enough to claim the trend holds in general, but they do suggest the replanning trigger keeps the cost of “lifelong” much closer to one-shot than a naive every-timestep solver would.

  • Planning
  • Robotics
  • Simulation