G-LNS: Generative Large Neighborhood Search for LLM-Based Automatic Heuristic Design

Baoyun Zhao1 He Wang2,3 Liang Zeng4
1 Software College, Northeastern University
2 International Centre for Theoretical Physics Asia-Pacific, University of Chinese Academy of Sciences
3 Taiji Laboratory for Gravitational Wave Universe, University of Chinese Academy of Sciences
4 Tsinghua University
Co-evolving "Destroy" and "Repair" operators with LLMs for Structural Algorithmic Innovation in Combinatorial Optimization.

Abstract

While Large Language Models (LLMs) have recently shown promise in Automated Heuristic Design (AHD), existing approaches typically formulate AHD around constructive priority rules or parameterized local search guidance, thereby restricting the search space to fixed heuristic forms. Such designs offer limited capacity for structural exploration, making it difficult to escape deep local optima in complex Combinatorial Optimization Problems (COPs).

In this work, we propose G-LNS, a generative evolutionary framework that extends LLM-based AHD to the automated design of Large Neighborhood Search (LNS) operators. Unlike prior methods that evolve heuristics in isolation, G-LNS leverages LLMs to co-evolve tightly coupled pairs of destroy and repair operators. A cooperative evaluation mechanism explicitly captures their interaction, enabling the discovery of complementary operator logic that jointly performs effective structural disruption and reconstruction. Extensive experiments on challenging COP benchmarks, such as Traveling Salesman Problems (TSP) and Capacitated Vehicle Routing Problems (CVRP), demonstrate that G-LNS significantly outperforms LLM-based AHD methods as well as strong classical solvers. The discovered heuristics not only achieve near-optimal solutions with reduced computational budgets but also exhibit robust generalization across diverse and unseen instance distributions.

Quick Start

Configuration

Create a .env file in the root directory to configure your LLM API.

.env
DEESEEK_API_HOST=https://api.deepseek.com
DEESEEK_API_KEY=your_api_key_here
DEESEEK_API_MODEL=deepseek-chat

Running Experiments

To run G-LNS on the Traveling Salesman Problem (TSP):

bash
python examples/tsp/run_tsp.py

The logs and generated operators will be saved in examples/tsp/logs/.