Cooperative Reward Shaping for Multi-Agent Pathfinding

Zhenyu Song, Ronghao Zheng, Senlin Zhang, Meiqin Liu · DOI

Abstract

Multi-Agent Pathfinding (MAPF) is a critical challenge in automated warehouses and robotic swarms, where dozens or hundreds of agents must navigate to destinations without collisions or gridlock. While centralized algorithms offer optimal paths, they struggle with computational scalability. Conversely, decentralized reinforcement learning (MARL) scales well but often leads to "selfish" behavior where agents inadvertently block others. This paper introduces Cooperative Reward Shaping (CoRS), a technique that modifies an agent's reward function to include the potential success of its neighbors. By maximizing a blend of individual rewards and the maximum possible rewards of nearby agents, CoRS achieves higher success rates and faster pathfinding in dense scenarios without the computational overhead of centralized coordination.

Introduction

Pathfinding for a single robot is a solved problem, but pathfinding for 100 robots in a shared space is a complex coordination task. Current solutions typically fall into two categories: centralized algorithms, which possess a global view but suffer from exponential complexity, and decentralized MARL, where agents learn individual policies. In decentralized systems, agents often become selfish, prioritizing their own immediate goals and causing traffic jams in narrow passages. The challenge lies in creating a decentralized system where agents cooperate naturally without requiring a complex, global communication network that hampers training efficiency.

Methodology

The proposed approach builds upon Independent Q-Learning (IQL) by integrating a novel reward shaping layer termed CoRS. This layer encourages agents to be "considerate" of their immediate neighbors.

The "Considerate" Reward Function

Standard reinforcement learning typically rewards an agent ($r^i$) for progress toward its goal. CoRS transforms this into a shaped reward ($\tilde{r}^i$):

$$\tilde{r}^i = (1 - \alpha)r^i + \alpha I_c^i$$

Where $\alpha$ is a "cooperation coefficient" and $I_c^i$ represents the cooperation metric.

The CoRS architecture integrates reward shaping with a Distributed Heuristic Coordination (DHC) framework, utilizing observation encoders and communication blocks to stabilize multi-agent learning.

Stability through Maximum Potential

A significant innovation in CoRS is the use of the maximum reward a neighbor could achieve given the agent's current action, rather than the neighbor's actual reward. Previous reward-sharing methods were often unstable because an agent’s reward depended on the immediate (and potentially erroneous) actions of its neighbors. By looking at potential maximums, CoRS decouples the learning processes, leading to smoother and more stable training.

This diagram illustrates how an agent's move (e.g., $A^1$ moving Right vs. Up) affects the potential reward values of its neighbor, $A^2$, encouraging the agent to choose paths that minimize negative impact on others.

Computational Efficiency

To maintain scalability, the authors limit the "cooperation zone" to a Manhattan distance of 2. This local focus is sufficient to prevent immediate collisions and deadlocks while keeping the computational requirements low, avoiding the "curse of dimensionality."

Experimental Setup

The authors evaluated CoRS using standard MAPF benchmarks, including 40x40 and 80x80 grid maps with high obstacle densities (0.3). Scalability was tested with scenarios ranging from 4 to 128 agents. CoRS was compared against several state-of-the-art baselines, including DHC (Distributed Heuristic Coordination), DCC (Decision Causal Communication), PRIMAL, and the centralized ODrM*.

Key Results and Insights

The experimental results demonstrate that "considerate" behavior significantly improves system-wide performance:

  • Higher Success Rates: In dense 40x40 maps with 64 agents, CoRS-DHC improved the success rate by over 20% compared to the standard DHC algorithm.
  • Reduced Makespan: In nearly every scenario, the "makespan" (the time required for the final agent to reach its goal) was significantly lower. For 32 agents on an 80x80 map, CoRS reduced the average steps from approximately 158 to 137.
  • Optimized Altruism: Using zero-order optimization, the researchers found that a cooperation coefficient ($\alpha$) of approximately 0.1675 provided the optimal balance between individual progress and group harmony.

Conclusion and Future Work

CoRS represents a significant advancement in decentralized MAPF by stabilizing cooperative rewards. However, several areas for future research remain. Currently, the cooperation coefficient $\alpha$ is a fixed value; future iterations could explore dynamic coefficients that adjust based on agent state (e.g., battery levels) or environmental traffic density. Additionally, while the current model is optimized for discrete grid spaces, extending CoRS to continuous 3D environments for aerial robotics remains a promising direction for further study.

Summary updated

BibTeX
@misc{song2024cooperative,
  author = {Zhenyu Song and Ronghao Zheng and Senlin Zhang and Meiqin Liu},
  title = {{Cooperative Reward Shaping for Multi-Agent Pathfinding}},
  year = {2024},
  eprint = {2407.10403},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.10403},
}
Figure