arXiv:2610.25946cs.ROOct 2026

Manuscript Offprint

arXiv:2610.25946

Policy Search in Code Space for Multi-Agent Pathfinding

Matthias Eder, Pantelis Emmanouil, Vivek Farias, Fabian Fischer, Adam Jozefiak, Tianyi Peng, Thomas Ulz, Raphael Watschinger, Fangyu Wu, Andrew Zheng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

ABSTRACT

Developing coordination policies for complex multi-agent systems relies on either labor-intensive algorithm design or opaque task-specific reinforcement learning. With recent advances in autonomous coding agents, we show that policy search directly in code space offers a compelling third path that combines automated optimization with explicit interpretability. We investigate a human-directed workflow in which coding agents iteratively propose, implement, evaluate, diagnose, and eventually refine algorithms guided by simulation feedback and explicit correctness verification. We conducted two case studies and found that this workflow robustly outperformed any manually engineered solutions. On a challenging map in the 2024 League of Robot Runners competition, a two-day search discovered a policy that exceeds the stronger locally reproduced competition entry by 35.0% on the densest instance and generalizes to unseen map instances. In simulated real-world warehouses with irregular lanes, continuous robot geometry, and asynchronous motion, a week-long search discovered an entirely new class of multi-agent pathfinding algorithm that outperforms a calibrated proprietary solution in throughput by 58.9%. Under stated assumptions, we further prove that the new algorithm is collision-free and completes, in finite time, every accepted goal that is not withdrawn or replaced. Together, the studies show that policy search in code space powered by state-of-the-art coding agents offers a highly competitive path to building real engineering solutions that are both effective and analytically tractable.

Figure

Tasked

Completed

Milestone Commit

(a) League of Robot Runners 2024. We exceed the top entry by roughly 35% in a dense map.

Figure

Orders/Hour

Milestone Commit

(b) Industrial warehouse. We complete 58.9% more orders than the proprietary solution.

Figure 1: Throughput of the discovered policies across milestone commits. Human-directed coding agents iteratively refine coordination algorithms, producing policies that outperform strong manually engineered baselines in competitive multi-agent pathfinding problems. Maps above are illustrative.

1 INTRODUCTION

Multi-agent coordination underlies warehouse fulfillment, factory automation, and parcel sorting. In lifelong multi-agent pathfinding (LMAPF), tasks arrive continuously, requiring a fleet of robots to coordinate both task allocation and collision-free navigation through a shared spatial network (Wurman et al., 2008; Ma et al., 2017; Li et al., 2021b). The operational objective is to maximize system throughput subject to collision avoidance and strict real-time compute budgets. Because uncoordinated routing decisions cause severe congestion and deadlocks, effective warehouse operation typi-

Corresponding author: Fangyu Wu (fywu85@gmail.com).

cally requires sophisticated joint optimization of task assignment and trajectory coordination across the fleet.

Existing methods generally fall into two paradigms. First, the standard approach relies on human experts to engineer sophisticated solvers, dispatch rules, and traffic guidance heuristics (Okumura et al., 2022; Jiang et al., 2024; Zhang et al., 2024). Although effective, manual engineering is bottlenecked by human engineering throughput and cannot scale algorithm discovery with available compute. Second, learning-based methods attempt to bypass this manual effort by training neural policies directly through simulated interaction (Damani et al., 2021; Skrynnik et al., 2024; Andreychuk et al., 2025). However, neural policies often lack formal safety guarantees, remain difficult to inspect and verify, and resist modular modification when operational constraints shift.

We study a third approach: policy search in code space (PSCS), driven by coding agents. In this paradigm, human designers specify the system objective, physical constraints, and scaffolding interfaces, while coding agents iteratively refine the implementation of the planner and scheduler directly in source code, which we refer to as code space. Guided by simulation benchmarks, unit tests, and execution traces, the agent discovers procedural algorithms that are computationally efficient, interpretable, and maintainable. Unlike manual design, the search scales directly with compute; unlike black-box learning, the resulting policy remains fully transparent and verifiable.

Automated code generation has demonstrated promise in discovering novel mathematical algorithms and discrete heuristics (Romera-Paredes et al., 2024; Novikov et al., 2025; Liu et al., 2024). However, existing studies focus primarily on idealized theoretical benchmarks or stylized combinatorial problems. It remains an open question whether PSCS can scale to demanding cyber-physical systems such as LMAPF, where task allocation, spatial planning, and low-latency runtime engineering must interact robustly under realistic constraints. Specifically, we investigate whether coding agents can navigate these coupled requirements across both standardized benchmarks and complex industrial environments.

We evaluate PSCS across two distinct domains. The first is the 2024 League of Robot Runners (LoRR) benchmark (Chan et al., 2024), a synchronous grid competition environment operating with 100 to 800 robots. In this domain, PSCS systematically refines existing baselines to discover layout-specific routing heuristics, outperforming the stronger locally reproduced competition entry by up to 35.0% in mean throughput (Figure 1a). The second is a high-fidelity simulation of an operational warehouse from KNAPP characterized by irregular lanes, continuous vehicle geometry, and asynchronous execution. In a challenging production map, our synthesized algorithm outperforms an optimized proprietary baseline by 58.9% (Figure 1b) while preserving provable progress certificates against deadlock under stated assumptions.

The contributions of this work are as follows:

  1. We demonstrate the feasibility and effectiveness of policy search in code space (PSCS) for automated, nontrivial combinatorial algorithm design in LMAPF.

  2. On the LoRR 2024 benchmark, we show that PSCS effectively refines established planners to discover map-specific heuristics, outperforming the stronger locally reproduced competition entry by up to 35.0% in mean throughput.

  3. In high-fidelity industrial warehouse environments, we show that PSCS discovers an entirely new class of algorithms that outperforms an optimized proprietary baseline by 58.9% while maintaining provable progress certification under stated assumptions.