A Compact Answer Set Programming Encoding of Multi-Agent Pathfinding

Rodrigo N. Gomez, Carlos Hernandez, Jorge A. Baier

Research output: Contribution to journalArticlepeer-review

8 Citations (Scopus)


Multi-agent pathfinding (MAPF) is the problem of finding k non-colliding paths connecting k given initial positions with k given goal positions on a given map. In its sum-of-costs variant, the total number of moves and wait actions performed by agents before they definitely reach the goal is minimized. Not surprisingly, since MAPF is combinatorial, a number of compilations to Boolean Satisfiability (SAT) and Answer Set Programming (ASP) exist. In this article, we describe in detail the first family of compilations to ASP that solve sum-of-costs MAPF over 4-connected grids. Compared to existing ASP compilations, a distinguishing feature of our compilation is that the number of total clauses (after grounding) grow linearly with the number of agents, while existing compilations grow quadratically. In addition, the optimization objective is such that its size after grounding does not depend on the size of the grid. In our experimental evaluation, we show that our approach outperforms search-based sum-of-costs MAPF solvers when grids are congested with agents. We also show that our approach is competitive with a SAT-based approach when follow conflicts are taken into account. We also explore the potential of our solver when finding makespan-optimal solutions, in which makespan is minimized first and then cost is minimized. Our results show that makespan-optimal solutions are slightly suboptimal in most benchmarks. Moreover, our MAPF solver, when run in that mode, is faster and scales better.

Original languageEnglish
Article number9333548
Pages (from-to)26886-26901
Number of pages16
JournalIEEE Access
Publication statusPublished - 2021


  • Answer Set Programming
  • Encoding
  • Grounding
  • Licenses
  • Multi-Agent Pathfinding
  • Optimization
  • Programming
  • Robots
  • Standards

ASJC Scopus subject areas

  • Computer Science(all)
  • Materials Science(all)
  • Engineering(all)


Dive into the research topics of 'A Compact Answer Set Programming Encoding of Multi-Agent Pathfinding'. Together they form a unique fingerprint.

Cite this