Accelerated Genetic Programming Hyper-Heuristics for Simulation-Based Scheduling via Agentic AI

Heyang Thomas Li, Alexander Pletzer, Yuan Tian, Yi Mei, Mengjie ZhangarXiv 2026 · arXiv

TL;DR

This paper demonstrates a semi-automated, human-in-the-loop workflow using an AI coding agent (Claude) to optimize a computationally heavy Python simulation framework for project scheduling. By systematically targeting bottlenecks through baseline cleanup, static caching, incremental state tracking, and Numba JIT compilation, the workflow achieved an 85% reduction in runtime. This optimization saved over 4 million core-hours (NZ$320,000) annually without altering the simulation's scientific outputs.

What Problem Does This Paper Address?

Python is the darling of scientific research due to its accessibility and rich ecosystem, but its interpreted nature makes it notoriously slow for heavy discrete-event simulations. This performance bottleneck is particularly brutal in Genetic Programming Hyper-Heuristics (GPHH), where an outer machine learning loop must evaluate thousands of mathematically evolved scheduling rules across millions of simulated scenarios to find the most efficient ones.

The authors focus on a real-world case: the Dynamic Multi-mode Resource-constrained Project Scheduling Problem (DMRCPSP). In this domain, complex control flows, nested loops, and sequential state updates prevent standard vectorization libraries (like NumPy or PyTorch) from providing easy speedups. Before this intervention, the research team's code was consuming five times its allocated high-performance computing (HPC) cluster quota on a network managed by REANNZ, threatening to halt the research entirely due to severe resource exhaustion.

Fig. 1. Overview of the Dynamic Multi-mode Resource-constrained Project Scheduling Problem (DMRCPSP): a capacity-limited resource pool, a project breakdown structure with precedence and resource constraints, and stochastic activity durations.

Methods

Instead of relying on a blind, "black-box" code generation prompt, the authors designed a disciplined, iterative human-in-the-loop workflow. The AI agent (Claude) acted as the "driver"—profiling code, identifying hotspots, and proposing scoped changes—while the human researcher acted as the "navigator," reviewing diffs, verifying correctness via strict checksums, and approving pull requests.

The optimization unfolded across four progressive layers:

  1. Environmental Runtime Cleansing: Disabling verbose debug logging and running Python in optimized mode (python -O) to strip out assertions and interpreter-level validation overhead.
  2. Low-Complexity Restructuring (Static Caching): Replacing slow, dynamic NetworkX graph queries with pre-computed native Python dictionary lookups for static project topologies during the Critical Path Method (CPM) calculations.
  3. Algorithmic Restructuring (Incremental Tracking): Modifying a branch-and-bound search tree to propagate resource consumption states incrementally rather than recomputing the total resource sum from scratch at every single node expansion.
  4. Medium-Complexity Compilation (Numba JIT): Rewriting the primary numerical bottleneck (earliestStart) into a lightweight kernel compiled directly to LLVM machine code using Numba, eliminating temporary array allocations and enabling early-termination loops.
Fig. 2. DMRCPSP simulation workflow and summary of the Agentic-AI-assisted code optimization. The decision-making procedure is mapped to its Python implementation, the performance issues identified in the legacy code, and the corresponding optimized solutions. Solid arrows show simulation control flow; dashed arrows link related implementation, issue, and solution components.

Datasets

The framework was evaluated using real-world production datasets and benchmarks for the DMRCPSP deployed on the REANNZ high-performance computing cluster. While no new public datasets were introduced, a trusted local benchmark with strict solution checksums was established to act as a correctness guard during the optimization process.

Key Insights and Ideas

  • The "Vibe Coding" Reality Check: Purely automated AI code generation can easily break scientific correctness or optimize micro-benchmarks without improving end-to-end runtime. Success requires a strict loop of profiling, scoped diff generation, independent verification, and human veto power.
  • Don't Query Graphs in Inner Loops: General-purpose graph libraries like NetworkX are fantastic for building models, but their dynamic views and attribute lookups introduce massive overhead when trapped inside deeply nested simulation loops. Mapping static topologies to native dictionaries yields massive wins.
  • State Propagation > Recomputation: In combinatorial search trees (like branch-and-bound), treating the current resource vector as part of the search state and updating it incrementally changes the computational complexity from linear to constant time per node.

Key Results

  • Massive Speedup: Total simulation runtime plummeted from 1,298 seconds to 195 seconds—an 85% execution time savings.
  • Financial and Resource Impact: Annual compute unit consumption dropped from ~5.17 million to 1.05 million, fitting comfortably back within the project's cluster quota. This saved over 4 million core-hours and NZ$320,000 (~US$188,000) annually.
  • Perfect Fidelity: All optimized code variants maintained 100% computational equivalence, producing identical scheduling decisions and checksums as the legacy code.

Limitations and Future Work

This approach heavily relies on having a reliable, fast-running benchmark with robust correctness checks (checksums) to prevent the AI agent from introducing subtle logical bugs. The authors note that future work will focus on expanding this semi-automated human-AI optimization workflow to a broader variety of research projects where software performance bottlenecks restrict experimental scale and productivity.

Summary updated

Abstract

Python is widely used in scientific research because it enables rapid development and provides rich ecosystems for data analysis, artificial intelligence (AI), and machine learning. However, customized research code can become prohibitively slow as experiments scale. This challenge is particularly acute in discrete-event project-scheduling simulations, where sequential state updates, nested loops, conditional evaluations, and object-oriented structures limit the benefits of compiled numerical and GPU-accelerated libraries. Addressing these bottlenecks typically requires iterative profiling, refactoring, testing, and validation, yet researchers may lack the time or specialized software-engineering expertise for low-level optimization. This paper presents a systematic refactoring approach using Claude agentic AI on real-world project-scheduling workloads in a high-performance computing (HPC) environment. Guided by representative benchmarks and correctness checks, the agent identifies bottlenecks, implements targeted optimizations, and evaluates their effects, while the researcher retains final control. Testing runtime reduced from 1,298 seconds to under 200 seconds without changing outputs, saving four million core-hours (NZ\$320,000) annually.
BibTeX
@misc{li2026accelerated,
  author = {Heyang Thomas Li and Alexander Pletzer and Yuan Tian and Yi Mei and Mengjie Zhang},
  title = {{Accelerated Genetic Programming Hyper-Heuristics for Simulation-Based Scheduling via Agentic AI}},
  year = {2026},
  eprint = {2608.19487},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.19487},
}
Figure