~ / projects /

Multi Agent Reinforcement Learning for Warehouses

The multi-agent RL and multi-agent path finding communities are solving the same problem, collision-free routes for a team of agents, from opposite directions, and they cannot easily compare results because they do not share an environment. MAPF has standard benchmark maps and scenario files; RL work tends to use whatever gridworld the authors wrote.

A 4-by-4 grid with two agents, 1 and 2, drawn as solid circles at their start cells and dotted circles at their target cells.
The MAPF problem in miniature: each agent (solid) must reach its target (dotted) without colliding with the others.

The environment

We built a gymnasium-minigrid environment that loads the standard MAPF benchmark map and scenario files directly, so an RL policy can be trained on exactly the layouts MAPF planners are evaluated against.

The same warehouse grid map shown three times with 10, 100 and 800 agents, drawn as green and red squares among grey shelving blocks.
A warehouse layout loaded from a benchmark file, populated with 10, 100 and 800 agents.

Each agent observes a 7 × H × W stack: an egocentric view ahead of it, its goal position, its orientation, and four edge-weight channels, with the view size configurable per run. For N agents the environment returns N × 7 × H × W.

Seven small heat-map panels: egocentric view, goal location, orientation, and edge weights 1 to 4.
The seven observation channels for one agent: egocentric view, goal location, orientation, and four edge-weight maps.

Centralized policy

Most existing work trains a decentralized policy per agent, sometimes with a learned communication channel between them. We went the other way and trained one centralized policy over the whole team: stack every agent’s observation into a single state, extract features with a two-layer CNN into a 128-dimensional vector, and pass that to a policy network that emits an N × 4 action matrix for all agents at once. Training used PPO from stable-baselines3, with a two-layer MLP of width 64 for both the policy and the value function.

CNN diagram: a 7 by 20 by 20 input passes through two convolution layers, the second producing 32 channels at 4 by 4, flattened into a 1 by 128 feature vector.
The CNN feature extractor: two convolutions from the 7-channel observation to a 128-dimensional feature vector.
Block diagram: observation into a features extractor shared by default between actor and critic, then a fully connected network outputting an action or value.
The full network: a shared feature extractor feeding fully connected actor and critic heads.

Results

The environment works, and it is the lasting output of the project: benchmark maps load, the observation space is rich enough to encode goals and orientation alongside local geometry, and training runs end to end.

The policy does not. It fails to route agents to their goals reliably, and no variation we tried across the experiment sweep fixed it.

TensorBoard screenshot of mean episode reward across many training runs, most flattening early, above a table listing each run's settings and final values.
Mean episode reward across the experiment sweep of environment and architecture changes. No configuration learned to route the team reliably.

The centralized formulation is the most likely culprit. A single policy emitting joint actions faces an action space that grows exponentially with the number of agents, and PPO gets a reward signal that says the team did badly without saying which agent was responsible. That credit assignment problem is exactly what decentralized approaches sidestep, which is presumably why most of the field uses them.

Takeaway. A centralized joint-action policy most likely ran into two walls at once: an action space exponential in the number of agents, and no per-agent credit assignment. The reusable contribution is the environment: a Gymnasium-MiniGrid setup that loads standard MAPF benchmarks, so learned policies and classical planners can finally be compared on the same maps.

  • Reinforcement Learning
  • Planning
  • Simulation
  • Robotics