Pairwise is Not Enough: Hypergraph Neural Networks for Multi-Agent Pathfinding

Rishabh Jain, Keisuke Okumura, Michael Amir, Pietro Lio, Amanda Prorok

TL;DR

Multi-Agent Path Finding (MAPF) models typically rely on Graph Neural Networks (GNNs) that only evaluate interactions between pairs of agents, leading to poor performance in crowded environments. This paper introduces HMAGAT, a Hypergraph Neural Network that explicitly models group interactions. The authors demonstrate a powerful principle: a 1M-parameter model with the right inductive biases can outperform an 85M-parameter Transformer-based model trained on 100x more data.

The Problem: The Limits of Pairwise Message Passing

Multi-Agent Path Finding (MAPF) is the challenge of navigating a team of agents—such as warehouse robots or autonomous cars—to their respective goals without colliding. Because finding the optimal solution is mathematically NP-hard, researchers increasingly use machine learning (specifically imitation learning) to create fast, online solvers.

The current standard for these ML solvers is to use Graph Neural Networks (GNNs) or Transformers. However, these architectures are fundamentally constrained to pairwise message passing (e.g., Agent A looks at Agent B). The authors identify two major flaws with this constraint:

  1. Attention Dilution: In dense environments, an agent is surrounded by many neighbors. Because standard attention mechanisms normalize scores across all neighbors, the presence of many irrelevant agents "dilutes" the attention paid to the few agents that actually matter.
  2. Missing Group Dynamics: MAPF is inherently a group problem. Sometimes Agent A needs to yield not just because of Agent B, but because of a complex chain reaction involving Agents B, C, and D. Pairwise models struggle to capture these higher-order entanglements.
Overview of HMAGAT's approach and performance compared to baselines.

The Solution: HMAGAT and Hypergraphs

To fix this representational bottleneck, the authors propose HMAGAT (Hypergraph Multi-Agent Attention Network).

Instead of standard graphs where an edge connects exactly two nodes, HMAGAT uses directed hypergraphs, where a single "hyperedge" can connect multiple nodes. In this setup, a hyperedge has a multi-node "tail" (a group of agents) and a singleton "head" (the agent making a decision based on that group).

Key methodological steps include:

  • Hypergraph Generation: The team needed a way to dynamically group agents. They tested three strategies: a Voronoi-style spatial partitioning (Lloyd's algorithm), a faster spatial clustering method (k-means), and a Shortest Distance-based method. The k-means approach offered the best balance of speed and performance.
  • HGNN Architecture: They replaced the standard GNN layers in a baseline model (MAGAT) with Hypergraph Neural Network layers. Messages pass from tail nodes $\rightarrow$ hyperedges $\rightarrow$ head nodes.
  • Training Pipeline: The model is trained via imitation learning using an expert algorithmic solver (lacam3). They also use an "online expert" (a DAgger-style dataset aggregation technique to correct the model when it drifts) and an RL-trained temperature sampling module to fix the overconfidence/miscalibration common in GNNs.

Datasets and Evaluation

The model was trained on 21,000 instances generated via the POGEMA toolkit (grids ranging from 17x17 to 21x21, with 16 to 32 agents, featuring random obstacles and mazes). Notably, this is roughly 1% of the data used by competing state-of-the-art models.

Evaluation was conducted on standard MAPF benchmark maps from the MovingAI repository, including small/dense maps (Sparse/Dense Maze, Room, Warehouse) and large maps (City and Game maps like ost003d).

Key Insights and Results

  • Inductive Bias Beats Sheer Scale: The most striking takeaway is that architecture matters more than parameter count. By explicitly structuring the network to understand groups (hypergraphs) rather than just pairs (graphs), HMAGAT (1M parameters) consistently outperforms the previous state-of-the-art, MAPF-GPT (85M parameters), in both solution quality and success rate, while running significantly faster.
  • Dominance in Dense Scenarios: In the highly challenging "Dense Warehouse" scenario with maximum agent density, HMAGAT achieved a 75+% success rate. In contrast, all other baselines (including MAPF-GPT) collapsed to <11%.
  • Curing Attention Dilution: The authors provide mathematical and empirical evidence showing that HGNNs naturally filter out noise. By clustering agents into hyperedges, the model maintains high attention scores for critical agents even when the environment gets incredibly crowded.
  • Capturing True Group Dynamics: Using Shapley value analysis on hand-crafted scenarios, the authors proved that HGNNs correctly identify complex multi-agent dependencies (e.g., recognizing that Agent C's path forces Agent B into Agent A's way), whereas GNNs treat all nearby agents with generic, smeared importance.

Limitations and Future Work

While highly effective, HMAGAT has a few limitations. In the rare cases where it fails (e.g., a 2.7% failure rate in Dense Rooms), the vast majority of failures are due to "livelocks"—agents oscillating endlessly between two locations. The authors suggest that adding a simple heuristic deadlock/livelock detection mechanism could easily patch this in future iterations. Additionally, while the k-means hypergraph generation is fast, more complex shortest-distance based hypergraph generation scales poorly, becoming a computational bottleneck as map sizes and agent counts increase.

Summary updated

BibTeX
@inproceedings{jain2026pairwise,
  author = {Rishabh Jain and Keisuke Okumura and Michael Amir and Pietro Lio and Amanda Prorok},
  title = {{Pairwise is Not Enough: Hypergraph Neural Networks for Multi-Agent Pathfinding}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=KF7sO7S4kG},
}
Figure