A Polynomial-Time Algorithm for Non-Optimal Multi-Agent Pathfinding

Mokhtar M. Khorshid, Robert C. Holte, Nathan R. Sturtevant

Introduction

Multi-agent pathfinding (MAPF) is a fundamental challenge in robotics and artificial intelligence, typically classified as NP-complete on general graphs. While previous research established that checking the solvability of a MAPF problem on a tree can be done in linear time, a constructive algorithm to generate these paths efficiently—especially in high-density scenarios—has been lacking. This paper introduces the Tree-based Agent Swapping Strategy (TASS), a polynomial-time algorithm capable of solving MAPF on trees even when nearly every node is occupied by an agent.

The TASS Algorithm

The core innovation of TASS is reducing the global pathfinding problem into a series of local agent swaps. By treating junctions (nodes with three or more neighbors) as "passing lanes," the algorithm allows agents to maneuver around one another without permanently displacing the rest of the population.

The Swapping Lemma

The mathematical foundation of TASS is the Swapping Lemma. It proves that if a junction has a sufficient number of "holes" (empty nodes) in its vicinity, two adjacent agents can swap positions, after which all other agents can return to their original locations. This lemma ensures that any two agents can be reordered as long as the tree topology provides enough maneuvering room.

Figure 2: Illustration of the Swapping Lemma requirements, showing the distribution of holes (H) and nodes (K) around junctions Ju and Jv.

Sequential Solving via Junctions

TASS operates by solving for agents one by one, typically working from the leaves of the tree inward. To move a specific agent to its goal, the algorithm performs a sequence of adjacent swaps to "bubble" the agent through the tree. Junctions act as the critical hubs where these swaps occur.

Figure 4: A visualization of the sequential movement process where agent v is moved to its goal node before agent u is repositioned through a junction.

Performance and Scalability

The authors prove that TASS has a polynomial time complexity of $O(n^4)$, where $n$ is the number of nodes. This theoretical guarantee is backed by impressive experimental results on synthetic binary and ternary trees:

  • High Density: TASS successfully navigated 996 agents on a 1,000-node tree.
  • Speed: Solutions for 1,000-node ternary trees were found in approximately 8 seconds, while binary trees of the same size took about 22 seconds.
  • Path Length Trade-off: As a non-optimal solver, TASS produces significantly longer paths than a shortest-path approach. For a 1,000-node tree, plans often required hundreds of thousands of moves. However, TASS provides a guaranteed solution in cases where optimal solvers would time out.

Conclusion and Future Work

TASS provides a robust, constructive proof for the solvability of MAPF on trees in polynomial time. While the current algorithm is strictly tree-based and produces sub-optimal path lengths, it offers a vital tool for highly crowded environments. Future research will focus on optimizing solution quality and refining "Graph-to-Tree Decomposition" (GTD) techniques to apply TASS logic to more complex general graphs.

Summary updated

BibTeX
@inproceedings{khorshid2011polynomial,
  author = {Mokhtar M. Khorshid and Robert C. Holte and Nathan R. Sturtevant},
  title = {{A Polynomial-Time Algorithm for Non-Optimal Multi-Agent Pathfinding}},
  booktitle = {SOCS},
  year = {2011},
  doi = {10.1609/socs.v2i1.18205},
}
Figure