Manuscript Offprint
arXiv:2609.02353LLM-Driven Joint Evolution of Coupled Heuristics Components for Routing Optimization
Abstract
Heuristic design for combinatorial optimization remains heavily reliant on expert knowledge, while existing large language model (LLM)-enhanced evolutionary methods typically evolve isolated algorithmic components, even when one determines the search state on which another operates. This paper proposes LLM-driven Heuristic Components Joint Generation (LLM-HCJG), a population-based framework that jointly generates and co-evolves interdependent heuristic components under a shared design blueprint. Applied to guided local search (GLS), LLM-HCJG couples solution initialization with penalty construction and embeds the generated pair into an enhanced online search mechanism. The resulting form is further transferred from the traveling salesman problem (TSP) to the capacitated vehicle routing problem (CVRP). Theoretical analysis establishes the non-separable state-transition effects between the two components and the advantage in generation consistency. Across synthetic instances and 41 public TSPLIB/CVRPLIB benchmarks, LLM-HCJG attains consistently low optimality gaps, including best or tied-best results on 28 of 29 TSPLIB instances and all 12 CVRPLIB instances. Ablation and structural analyses further indicate that these gains are associated with cross-component compatibility and alignment rather than isolated-component recombination. These results support effective cross-instance transfer within the evaluated routing settings under limited-sample, modest-cost training.
Keywords: Large language models; Automatic algorithm design; Guided local search; Joint co-evolution; Routing optimization.
1 Introduction
Combinatorial optimization problems are ubiquitous in logistics and transportation systems (Song et al., 2025; Cheng et al., 2025). Such problems require repeated generation of high-quality routing or scheduling decisions under stringent operational constraints, often in dynamic and uncertain environments where solution quality directly impacts operational efficiency and service performance.
As problem scale and structural complexity increase, exact algorithms become computationally infeasible (Zhen et al., 2023), rendering heuristic algorithms indispensable in practice (Blum and Roli, 2003). However, achieving strong performance with these methods typically requires extensive domain knowledge and carefully handcrafted rules, which can limit adaptability and lead to premature convergence (Bengio et al., 2021). Meanwhile, many recent learning-based approaches are highly task-specific and often require substantial retraining when problem settings change (Kim et al., 2024). Consequently, a persistent gap remains between the complexity of real-world environments and the practical deployability of existing solution methods, hindering the development of truly adaptive and scalable optimization frameworks.
Recent advances in large language models (LLMs) expand optimization research through improved reasoning, code generation, and knowledge integration (Vaswani et al., 2017; Guo et al., 2025). A potential paradigm is emerging, where LLMs serve not only as problem solvers but also as algorithm designers to address the limits of human intuition and handcrafted engineering (Huang et al., 2024b). In parallel, combining LLMs with evolutionary computation (EC) yields LLM-enhanced EC, in which prompt-based EC drives LLMs to generate and evolve program codes, making for algorithm-level search beyond conventional solution optimization (Wu et al., 2025b).
Currently, the main focus is on embedding highly competitive LLM-based components into fixed heuristics to iteratively improve existing algorithms (Zhang et al., 2024). Following this trend, this paper investigates an LLM-driven guided local search (GLS) framework. GLS alternates between neighborhood-based improvement and penalty-driven perturbation, with the latter enabling escape from local optima and encouraging exploration. Typically, two bottleneck functions jointly determine the overall search direction: (i) solution initialization: constructing the starting route and strongly influencing the subsequent search trajectory; and (ii) penalty construction: defining distance matrix update rules that allow the search to escape local minima while preserving solution structure. These two inherently interdependent components traditionally render substantial domain expertise essential to effective design.
To address these limitations, we propose the LLM-driven Heuristic Components Joint Generation (LLM-HCJG) framework. It advances a distinct dimension of LLM-based heuristic design by explicitly coordinating search-structurally interdependent components (solution-initialization and penalty-construction functions) within a fixed heuristic frame-work through a shared design blueprint and joint evolution. The main contributions of this work are summarized as follows:
• Joint algorithm-level representation for LLM-driven heuristic design. LLM-HCJG represents each individual as a complete heuristic organized around a shared design blueprint and composed of multiple coupled components, rather than as a solution or an isolated rule. This enables algorithm-level search while explicitly modeling the coevolution of interdependent components of search direction.
• Theoretical foundation for coupled component generation. We establish that solution initialization and penalty construction are non-separable in the search-state transition, justifying the complete component pair as the basic unit of the evolution loop. Under the blueprint-consistency condition, the proposed joint-generation mechanism enforces design-principle alignment and reduces mismatch probability.
• Search-direction redesign of GLS from TSP to CVRP. The jointly generated components are embedded into a framework-augmented GLS procedure. This design preserves the interpretable backbone while extending the algorithm from TSP to CVRP.
• Strong empirical performance under modest training cost. On synthetic TSP/CVRP testbeds across the 20-, 50-, and 100-node scales and 41 public TSPLIB (size 51–200) / CVRPLIB (size 32–190) benchmarks, LLM-HCJG confirms the co-evolved structural compatibility via attaining the lowest gaps and best counts of 28/29 and 12/12. These results rely on only five training instances per fitness evaluation, demonstrating that strong heuristics can be generated with limited samples and modest cost.
The remainder of this paper is organized as follows. Section 2 reviews representative paradigms of LLM-based optimization and highlights the bottlenecks of existing LLM-enhanced evolutionary design. Section 3 develops LLM-HCJG as a GLS search-direction redesign framework, where coupled component generation and enhanced online search jointly reshape the guided-search process from TSP to CVRP. Section 4 characterizes the best-evolved heuristics and evaluates performance through synthetic testbeds, TSPLIB/CVR-
PLIB benchmarks, plus ablation analyses of component co-adaptation. Section 5 concludes the paper with a discussion of broader implications and future research directions.

(a)

(b)
Figure 1: (a) LLMs as a solution solver; (b) LLMs as an algorithm designer.
2.1 LLMs as an Automated Solution Solver
This paradigm treats LLMs as black-box optimizers that directly produce one or more candidate solutions from predefined prompts. Early studies explore the iterative refinement of single solutions. Yang et al. (2024) propose Optimization by PROmpting, where meta-prompts encode solution history, corresponding objective values, and guidance for exploration direction. Similarly, Huang et al. (2024c) show that LLMs can directly generate executable vehicle routes via self-reflection mechanisms that improve feasibility and quality. Subsequent work extends to population-level search. Brahmachary et al. (2025) introduce a dual-pool prompting framework that explicitly separates exploration and exploitation, exchanging high-quality candidates via a port-and-filter. Furthermore, Liu et al. (2024c) embed a series of evolutionary operators in the prompts to form an LLM-driven population search with adaptive temperature control. Several studies augment solution generation by incorporating multimodal inputs. By merging visual-spatial information with textual constraints, Huang et al. (2025) and Elhenawy et al. (2024) demonstrate improved performance in CVRP and TSP variants, particularly in capturing geometric structures beyond text-only prompts.
Although this paradigm is attractive, it still suffers from inherent limitations, including high prompt sensitivity, performance degradation due to weak reasoning consistency, and the absence of feedback mechanisms for feasibility or improvement. These limitations indicate that relying solely on LLMs as end-to-end solvers is insufficient.
2.2 LLMs as an Automated Algorithm Designer
These limitations motivate a shift toward guiding LLMs to design innovative heuristic strategies, including partial or complete algorithms. Early studies adopt primarily a single-round approach, in which LLMs generate heuristics in one shot (Sartori and Blum, 2025). However, without performance-driven feedback or iterative refinement, the resulting algorithms function more like conversational than genuine optimization output, and Zhang et al. (2024) show that standalone LLMs generation is insufficient for algorithm design.
Motivated by this issue, the LLM-enhanced EC embeds LLM-generated heuristics into an evolutionary framework for iterative refinement. Automated heuristic design is formulated as an evolutionary program search problem, where heuristics are represented as executable programs, evolutionary mechanisms guide performance-driven variation and selection, and LLMs generate program variants (Zhang et al., 2024). One straightforward realization is single-trajectory refinement, where a candidate heuristic is repeatedly modified. The self-taught optimizer (Zelikman et al., 2024) integrates classical heuristic principles into a recursive refinement process of scaffold programs, producing transferable optimizers for COPs such as Max-Cut. However, the single-trajectory nature inherently restricts exploration of algorithmic diversity.
Recent research has shifted toward population-based evolutionary heuristics. A representative example is FunSearch (Romera-Paredes et al., 2024), which evolves heuristic code fragments through distributed island populations, prompt-based variation, and migration to maintain diversity. Subsequently, LLaMEA (van Stein and Bäck, 2025) enables LLMs to generate complete heuristic algorithms within a predefined interface and builds an automated evolutionary loop for execution, verification, filtering, and repair. Despite promising results, both rely exclusively on code-level evolution to identify effective heuristics, thereby incurring the high computational cost of LLM queries.
To overcome this shortcoming, EoH (Liu et al., 2024a) generates population individuals directly from task-descriptive prompts, pairing a core design idea in natural language with a corresponding executable code implementation and evolving via prompt-based genetic operators. Subsequent extensions further broaden the applicability and efficiency of EoH. Li et al. (2025) integrate EoH into a memetic framework for Lot-Streaming Hybrid Job Shop Scheduling with Variable Sublots, where EoH-designed heuristics function as decomposed subproblem-specific local search operators. Wu et al. (2025a) propose Hercules, which introduces Core Abstraction Prompting to distill essential components from elite heuristics into prompt construction, thereby guiding a more focused search. The variant Hercules-P further incorporates Performance Prediction Prompting to estimate fitness from the semantic similarity of prior individuals, reducing redundant evaluations.
Recent studies suggest that LLM-enhanced evolutionary computation can benefit from richer feedback signals, motivating reflective evolutionary mechanisms. Reflective Evolution (Ye et al., 2024) proposes short- and long-term reflections based on parental analysis and intergenerational comparison, incorporating both into prompts to steer future offspring. Building on this idea, self-evolution reflection (Huang et al., 2024a) is further incorporated to capture the characteristics of individual change induced by evolution. Since ReEvo struggles to maintain population diversity, HSEvo (Dat et al., 2025) adopts a more cost-effective flash reflection and harmony search to fine-tune elite parameters. Similar reflective principles also emerge in the dual-layer self-evolution structure of LLM-driven LNS (Ye et al., 2025), where the evolution of inner-layer destruction–repair heuristic operators informs revisions to outer-layer prompting strategies.
Although these studies demonstrate the promise of LLM-enhanced EC, their main contributions remain largely centered on the generic automated heuristic-design paradigm. More broadly, these methods address the limited treatments of how LLM-designed components should interact with a specific optimization problem and algorithmic framework-level structure. Empirically, this limitation is most evident in EoH, whose GLS-TSP search takes nearly two days. Consequently, simply enriching the generic LLM-for-AHD loop with reflection, prompt refinement, or feedback augmentation may still leave the search direction under-specified when the target algorithm relies on tightly coupled components. More recently, CoEvo-AHD (Kuang et al., 2026) decomposes the problem decision into subproblem evolving populations. The coordination is only introduced through cross-population evaluation and recombination, leaving design-level interdependence among functional components within a single heuristic largely unexplored.
3 Joint-Generation Approach for LLM-Enhanced GLS Design
LLM-HCJG advances a distinct algorithmic dimension by redesigning search direction within the interpretable GLS backbone for both TSP and CVRP. To preserve controllability and verifiability, LLM-driven modifications are confined to two locally critical components that directly shape search bias. Solution initialization determines the starting search state, whereas penalty construction guides subsequent perturbations. Accordingly, the following subsections first introduce the LLM-HCJG framework, then present edge-penalized GLS from TSP to CVRP, and finally describe joint component generation with enhanced guided search.
3.1 LLM-Driven Heuristic Components Joint Generation Framework
Our framework relies on two fundamental mechanisms:
• Evolutionary Representation in Algorithm Space. Each individual is represented as a complete algorithm stored a design blueprint and coupled component functions , rather than as a candidate solution.
• LLM-driven Construction and Refinement of Algorithmic Components. Unlike costly search procedures and domain-specific model retraining, LLMs are integrated into the evolutionary cycle to automatically generate and refine algorithmic components, enabling more efficient exploration.
The LLM-HCJG framework operationalizes a population-based evolutionary process in which multiple pairs of interdependent heuristic component functions interact. The complete procedure is summarized in Algorithm 1. At initialization, a population P consists of N candidate individuals created by LLMs, and each is evaluated in training instances to obtain fitness. The population then evolves over generations via selection, crossover, mutation, and population management, until the best-performing algorithm is identified. Crossover and mutation are activated stochastically with probabilities and , respectively, to adjust the evolutionary intensity. The detailed framework follows in the subsequent subsections.
Algorithm 1 LLM-driven Heuristic Components Joint Generation Framework
Inputs: Number of generations , population size , crossover probability , mutation probability , number of parents for crossover , number of offspring per crossover and a given universal LLM
Outputs: Best algorithm
1: Initialization(LLM, ), Evaluate( )
2: for to do
3:
4: Sample
5: if then // Crossover with probability
6: for to do
7:
8:
9:
10: end for
11: end if
12: Sample
13: if then // Mutation with probability
14: for to do
15:
16:
17:
18: end for
19: end if
20:
21: end for
22:
3.1.1 Individual Representation in Joint coevolution Mechanism
Three layers (see Figure 2) together define what the individual represents, how component functions are organized, and how the evolutionary process is driven within the LLM-HCJG framework.

Figure 2: Illustration of the three-layer framework for heuristic modular composition.
Layer 1: Component-Specific Function Structure (see Appendices A.1 and A.2). Each heuristic component function corresponds to a distinct task and serves as the smallest representational unit. For structural consistency, each component is instantiated from a standardized prompt template with six fields:
• Task Definition (self.prompt_task): objective and background of the task;
• Function Name (self.prompt_func_name): required function designation;
• Inputs (self.prompt_func_inputs): input parameter list;
• Outputs (self.prompt_func_outputs): expected outputs or return variables;
• I/O Specification (self.prompt_inout_inf): input/output types, dimensions, ranges of values, and so on;
• Additional Requirements (self.prompt_other_inf): extra constraints for correctness and robustness.
Layer 2: Individual Composition (as shown in Appendix C.1 and C.2). This layer assembles Layer 1 component functions and shared coordination into one candidate individual:
where
Each contains four elements:
• Shared blueprint : a one-sentence semantic description of the joint principle governing the complementary roles and their intended interaction;
• Thought Thought : the component-level rationale that instantiates for ;
• Code implementation Code : the rogram executable realization of Thought ;
• Fitness evaluation: the performance score obtained by executing on training instances.
Layer 3: Evolutionary Prompt Construction (as shown in A.3-A.8). Building on the first two layers, this layer defines the prompts that control initialization, crossover, and mutation in the evolutionary process. The evolutionary prompts include:
• Task description: a problem statement paragraph that aggregates all task templates;
• Parent algorithm(s): selected parent individuals for recombination;
• Evolution-specific hints: guidance for generating diverse variants;
• Blueprint-guided coordination: instructions that identify structural dependencies and induce a shared design principle across component functions;
• Other hints: constraints encouraging concise and necessary outputs.
3.1.2 Shared Design Blueprint in Joint LLM Generation
To make the intended association between coupled components explicit, we introduce an individual-level shared design blueprint. Rather than referring to the common task prompt itself, the blueprint is a concise joint design principle generated for one algorithmic individual and recorded together with its component functions. Let Z denote a finite blueprint space, and let x collect the task description, function interfaces, input–output constraints, and component-association requirements. The LLM first generates a shared blueprint
and then generates the initialization and penalty-construction components conditionally on the same blueprint:
Let and denote blueprint-label mappings obtained by structured validation of the initialization and penalty components, respectively. We impose the blueprint-consistency condition
Operationally, the shared blueprint is parsed by a structured parser and propagated across initialization, crossover, mutation, evaluation, and selection. Structural check ensures explicit preservation and regenerates outputs with missing fields, while semantic faithfulness remains the condition stated in (5).
Definition 3.1 (Blueprint-consistent component pair). Define the set of blueprint-consistent component pairs as
A pair is design-principle consistent if and only if it belongs to C; otherwise, it is blueprint-mismatched.
3.1.3 Initialization
The initial population of size N is built using prompt i1 (Appendix A.3). It instructs the LLM to act as an expert on the target problem and simultaneously design coupled heuristic component functions under shared blueprints.
3.1.4 Crossover
At each iteration , crossover is activated with probability . When triggered, complete parent records form . Prompts e1 and e2 (Appendices A.4–A.5) receive parents blueprint together with its component records. The offspring first establishes a child blueprint by either departing from or refining the parental principles, and then generates both components conditional on that blueprint. The s offspring are generated per round, yielding sN new individuals.
3.1.5 Mutation
Similarly, mutation is applied with probability . In each of the N rounds, the selected parent's blueprint and component records are supplied to one of prompts m1–m3 (Appendices A.6–A.8), which respectively optimize performance, retune parameters, and prune redundant structure. The offspring inherits the blueprint if the joint principle is preserved and revises it otherwise. Each mutation yields a complete, explicitly recorded individual.
3.1.6 Parents Selection
The selection operator chooses parents for crossover or one parent for mutation from using rank-based roulette, where individuals are sorted by descending fitness with ranks . The unnormalized selection weight is
which assigns larger sampling probabilities to higher-fitness individuals while preserving stochasticity.
3.1.7 Population Management
Given the stochastic activation of crossover and mutation, the number of offspring per generation ranges from 0 to . To maintain a constant population size N and selection pressure, the combined pool is truncated by discarding inferior candidates and retaining the top N individuals.
3.2 Generalizing the Guided Local Search Backbone from TSP to CVRP
Guided local search (GLS) (Voudouris and Tsang, 1999) augments local search with feature penalties, making repeatedly visited structures progressively less attractive. Algorithm 2 presents the canonical edge-based GLS formulation for TSP, which serves as the reference mechanism for transferring the guided-search principle to CVRP.
The TSP solution is initialized with a nearest-neighbor tour and optimized following the same local search with iterative 2-opt and relocate moves in Lines 2 and 19. The search features are undirected tour edges, and each edge has a historical penalty count stored in the symmetric matrix P. At a local optimum, the utility of an edge is
where
This utility favors long edges penalized, while frequently penalizing edges are suppressed to prevent repeated concentration on the same feature. The edge with the largest utility is penalized, and the accumulated penalties define the guided distance matrix
with
where is the incumbent-best tour cost, is the number of customers, and controls the penalty scale. Local search is performed under the augmented matrix , while solution quality is always evaluated under the original matrix . By discouraging recurrent edge structures and biasing the search for alternative solutions, GLS facilitates escape from local optima.
Extending GLS from TSP to CVRP is valuable because it tests whether the guided-search principle remains effective beyond a single unconstrained tour and under coupled routing and resource constraints. Unlike TSP, CVRP requires simultaneous decisions on customer assignment, route sequencing, and load feasibility, while solution must satisfy customer demand, vehicle capacity, and fleet-size constraints. Since no single standard GLS workflow is directly applicable to CVRP, we extend the core principle of edge-based penalization followed by local improvement from a single-tour search state to a capacity-constrained set of vehicle routes (Algorithm 4 in Appendix B). Three feasibility-preserving neighborhoods are act on local search stage: intra-route2-opt (Lines 2 and 18) for route sequencing, inter-route relocate (Lines 2 and 18) for customer reassignment, and inter-route swap (Line 18) for balancing route allocation under capacity constraints.
3.3 Joint Component Coevolution and Enhanced Guided Search
LLM-HCJG modifies the guided-search procedure at two distinct levels: (i) component-design level, where an LLM jointly generates the solution-initialization and penalty-construction components under a shared design blueprint; and (ii) search-framework level, where the generated components are embedded into a fixed online mechanism for influential-edge selection, targeted perturbation and repair, additional local improvement, and periodic restoration to the incumbent-best solution. Figure 3 summarizes this separation between joint component evolution and online algorithm execution.
3.3.1 Joint Generation of Interdependent components
The initialization component implemented by LLM_select_next_node constructs the search starting state, i.e., a TSP tour or a feasible CVRP route set. The penalty-construction component maps this state and accumulated edge-usage information to a guided distance matrix through LLM_update_edge_distance. For CVRP, both components also incorporate demand, capacity, and fleet size information to ensure route feasibility. The two functions are generated and evolved as an ordered pair because determines the edge support on which operates, while determines how that state is subsequently perturbed. Thus, an individual consists of a shared design blueprint and a coupled function pair,
Its fitness is the mean percentage relative deviation from the problem-specific reference objective over K training instances:
Here, is the objective value obtained by the complete generated pair and is the corresponding known reference value.

Figure 3: LLM-HCJG framework: joint generation and enhanced guided search (TSP case).
3.3.2 Theoretical Characterization of Coupled component Generation
Let denote an initialization component and a penalty-construction component. Given a distance matrix , the initialization component constructs a route that is refined by a deterministic local-search operator :
Let be the undirected edge-incidence matrix of search state , where
For the route-supported penalty components considered in this study, the guided distance update can be written in the unified form
where P denotes auxiliary search-state information, including historical edge penalties or usage information, is the elementwise product, and is the edge-adjustment intensity induced by .
Definition 3.2 (component interaction term). For two initialization components and two penalty-construction components , define the mixed finite difference
(17)
If , the two components have a non-separable interaction at the current search state.
Theorem 3.1 (State-transition non-separability of coupled heuristic components). Suppose that the penalty-construction operator satisfies (16). If there exists an edge such that
and
then . Moreover, there do not exist mappings and that depend only on the individual initialization and penalty components, respectively, such that, for every and ,
Theorem 3.1 shows that the state-transition effects between initialization and penalty components cannot be decomposed into two fixed, independently attributable contributions. The complete component pair should therefore be generated, evaluated, and selected jointly. A proof is provided in Appendix G.1.
Theorem 3.2 (Conditional mismatch elimination under shared-blueprint joint generation). Suppose that the joint LLM generation process satisfies (3)–(5). Let be a component pair generated under the same shared blueprint Z. Then
Alternatively, suppose that the initialization and penalty-construction components are generated from independent blueprints,
with
Then
and the blueprint-mismatch probability is
If at least two blueprints have positive probability under , then the mismatch probability in (25) is strictly positive.
Theorem 3.2 characterizes the structural advantage of joint LLM generation in that an explicit shared blueprint guarantees design-principle consistency within a generated pair, whereas independently generated components can be mismatched with positive probability. The proof is provided in Appendix G.2.
3.3.3 Framework-Level Search Enhancement
Relative to the classical TSP GLS in Algorithm 2, the online procedures in Algorithms 3 and 5, all reported in Appendix B, introduce four fixed framework-level mechanisms: (i) influential-edge selection, which identifies the top-5 positive entries of as guided perturbation targets (Lines 7–9); (ii) endpoint-targeted perturbation, which applies local moves around the selected edge endpoints, using 2-opt and relocate for
TSP plus inter-route swap for CVRP (Lines 10–20, Lines 10–24). Here, denotes the objective change of a candidate local move, with indicating accepted improvement; (iii) post-perturbation local improvement, which refines the perturbed solution after guidance from while evaluating quality under (Lines 22–26, Lines 26–30); (iv) periodic incumbent restoration, which resets the current state to the best-so-far solution every 50 outer iterations to control search drift (Lines 27–29, Lines 31–33). These mechanisms are fixed components of the online search framework rather than generated by the LLM.
4 Experiments
In this section, we evaluate the proposed LLM-HCJG framework and the resulting LLM-enhanced GLS algorithm. The entire process is implemented in Python and executed on an Intel Core i9-14900HX (2.20,GHz). To ensure closer alignment with the compared LLM-based methods, we follow ReEvo's final-elite selection protocol: three independent full-evolution runs (with different random seeds) produce three run-specific elites, which are evaluated on the released public TSP/CVRP validation sets. Only the best-validated elite is subsequently tested 10 times on each test instance, with the mean performance reported. All tests are terminated when either the prescribed time budget is exhausted or the maximum number of 1,000 outer iterations is reached, with limits of 100 seconds for TSP and 20 seconds for CVRP. The experimental setup is presented first, followed by an analysis of the training process and the best-performing algorithm discovered by LLM-HCJG. The resulting algorithm is subsequently compared against representative baselines on synthetic instances and public benchmark suites. Finally, ablation studies on joint combinatorial dependency coevolution are performed to assess the role of cross-component co-adaptation in the proposed framework. All results and source codes will be publicly available at github website upon acceptance of this paper.
4.1 Experiments Settings and Evolutionary Outcome
This subsection reports the results of the LLM-HCJG training phase and its complete hyperparameter configuration in Table 1. We adopt the common LLM training budgets used in previous studies (Wu et al., 2025a; Ye et al., 2024): 10 generations of coevolution

(a) TSP
(b) CVRP
Figure 4: Convergence of the Heuristic Gap under the LLM-HCJG Framework
with a population size N of 10. Parameters , , l, and s follow the EoH settings (Liu et al., 2024a,b) to balance activation intensity, generation granularity, and search diversity. Candidate fitness is estimated on K = 5 instances sampled from a pool of 64, providing a trade-off between evaluation reliability and computational overhead. Each instance contains 100 customer nodes uniformly sampled in the unit square , together with LKH reference solutions. CVRP instances additionally include integer customer demands in [1, 9], a fixed vehicle capacity of 50, with an average of 10–11 vehicles.
Under GPT-4o-mini, the LLM-HCJG training phase averagely requires 34 minutes for TSP and 183 minutes for CVRP. For each task, the training records contain 410 candidate-generation attempts. TSP and CVRP produce 361 and 390 valid candidates, corresponding to effective generation rates of 88.0% and 95.12%.
Figure 4 illustrates the behavior of the best-validated elite heuristic gap over generations. The best individuals of TSP and CVRP emerge at generations 4 and 7, respectively, indicating effective convergence within the adopted training budget. The average LLM training time for the TSP-GLS task is much lower than EoH (Wu et al., 2025a; Ye et al., 2025) required nearly two days of search and approximately 2,000 LLM queries across 64 TSP100 training instances (Liu et al., 2024a,b). This highlights that LLM-HCJG can achieve competitive heuristic discovery with a relatively modest training budget.
Figure 5 presents the evolutionary trajectory plots of the final populations. Each node represents a candidate heuristic labeled by its index and fitness value. Orange, blue, and red denote the initial, final-retained, and best-heuristic individuals, respectively. The different-colored directed edges trace the evolution of the parent to the offspring and distinguish the corresponding evolutionary operators. In TSP and CVRP, the best individuals are No. 151 and No. 251, generated via the e1 and m1 operators. Their final performance gaps settle at 2.046% and 0.000%, with both preserved in subsequent generations.
Details on the best-performing TSP and CVRP elite heuristics code with mathematical interpretation are provided in Appendices C.1 and C.2, respectively. For TSP, the two functions follow a stochastic heuristic design that combines deterministic structural information with random factors and . For CVRP, both functions follow a structure-aware penalty-augmented distance shaping principle rather than relying on raw distances.
4.1.1 Structural Alignment of the Best-Evolved component Pairs
To assess structural interaction in the best-performing component pairs, two complementary post-hoc indicators are adopted:
At the -th penalty-update call on instance , measures how strongly the gap signals align with the current search state initialized by and refined by the subsequent search process, whereas measures whether the signals are differentiated across edges rather than uniformly distributed. The final value is averaged over penalty-update calls for each of the evaluated instances:
Appendix C.4 shows complete definitions of these indicators. For the best TSP and CVRP individuals, the measured values are (Focus, Diversity) = (0.980, 0.318) and (0.978, 0.438). These results indicate that the jointly evolved component pairs realize a state-aligned and selective perturbation pattern.
4.2 Baseline Methods
The proposed method is evaluated against representative baselines from three categories:
Discarded / non-final individual
Initial generated individual
Retained in final population
Best final individual
e1
e2
m1
m2
Discarded / non-final individual
Initial generated individual
Retained in final population
Best final individual
e1
e2
m1
m2

(a) TSP
(b) CVRP
Figure 5: Final-population evolutionary trajectories for TSP and CVRP
Table 1: Parameter Settings of LLM-HCJG
| Parameter | Meaning | Value |
|---|---|---|
| Probability for crossover | 1.0 | |
| Probability for mutation | 0.5 | |
| LLM | Chosen large language model | GPT-4o-mini |
| Population size | 10 | |
| Number of generations | 10 | |
| Number of parent individuals | 2 | |
| Number of offspring individuals | 1 | |
| Number of training instances | 5 |
-
Handcrafted heuristic approaches: including local search (LS) (Croes, 1958), guided local search (GLS) (Voudouris and Tsang, 1999), knowledge-GLS (KGLS) (Arnold and Sörensen, 2019) and elite biased GLS (EBGLS) (Shi et al., 2018);
-
Neural network-based approaches: including attention model (AM) (Kool et al., 2018), policy optimization with multiple optima (POMO) (Kwon et al., 2020), large-scale enhanced heavy decoder (LEHD) (Luo et al., 2023), graph neural network GLS
(GNNGLS) (Hudson et al., 2021) and Neural GLS (NeuralGLS) (Sui et al., 2024);
• Prior LLM-EC methods: EoH (Liu et al., 2024a) and ReEvo (Ye et al., 2024).
For TSP, comparisons are conducted across all method categories considered. For CVRP, the lack of directly comparable neural results and canonical CVRP variants of KGLS/EBGLS restricts the comparison only to GLS, EoH, and ReEvo. The results for neural network-based approaches are taken from the original publications, given that the substantial method-specific training protocols and computational resources are beyond the scope of this study. EoH and ReEvo are only generated for the LLM_update_edge_distance function, while LLM_select_next_node is fixed to the default nearest-feasible-customer rule. For TSP, the best release from (Liu et al., 2024a) is adopted directly, as it conforms to the same dynamic edge-distance update interface and avoids unnecessary retraining variability. In contrast, ReEvo's published heuristic specific to classical GLS is incompatible. The best individuals of ReEvo for TSP and EoH/ReEvo for CVRP, listed in Appendix C.3, are re-evolved under the same training setting as LLM-HCJG.
4.3 Performance Comparison on Synthetic Instances
Synthetic benchmarks are generated as random Euclidean instances in , comprising 1,000 TSP instances for each size in and 64 CVRP instances for each customer size in . Extraly for CVRP, the depot is fixed at , customer demands are uniformly sampled from integers in , and the vehicle capacity is set to 50. The optimality gaps compare the objective value obtained on instance i in each independent run against the corresponding LKH3-generated reference value (Helsgaun, 2017). The mean percentage gap is defined as
where for TSP and for CVRP at each problem size.
To distinguish framework-level gains from LLM-designed heuristic gains, Framework-Augmented GLS (FA-GLS) augments the classical GLS core with the search mechanisms of LLM-HCJG, while preserving greedy initialization, edge selection by , and augmented distance construction . The results are reported in Tables 2 and 3.
Table 2: Performance comparison on synthetic TSP instances
| Method | TSP20 | TSP50 | TSP100 | |||
|---|---|---|---|---|---|---|
| Gap (%) | Time (s) | Gap (%) | Time (s) | Gap (%) | Time (s) | |
| AM | 0.069 | 0.038 | 0.494 | 0.124 | 2.368 | 0.356 |
| POMO | 0.120 | / | 0.640 | / | 1.070 | / |
| LEHD | 0.950 | / | 0.485 | / | 0.577 | / |
| GNNGLS | 0.000 | 10.010 | 0.009 | 10.037 | 0.698 | 10.108 |
| NeuralGLS | 0.000 | 10.005 | 0.003 | 10.011 | 0.470 | 10.024 |
| LS | 0.918 | 1.003 | 2.869 | 1.006 | 3.708 | 1.029 |
| GLS | 0.000 | 1.050 | 0.194 | 1.140 | 1.212 | 1.414 |
| FA-GLS | 0.000 | 1.138 | 0.000 | 1.289 | 0.140 | 1.975 |
| KGLS-r | 0.000 | 1.254 | 0.000 | 1.619 | 0.168 | 2.382 |
| KGLS-c | 0.000 | 1.653 | 0.000 | 1.409 | 0.178 | 2.001 |
| EBGLS | 0.000 | 1.053 | 0.007 | 1.164 | 0.246 | 1.484 |
| EoH | 0.000 | 4.654 | 0.000 | 7.865 | 0.147 | 21.228 |
| ReEvo | 0.000 | 2.347 | 0.000 | 3.157 | 0.293 | 7.683 |
| LLM-HCJG | 0.000 | 1.757 | 0.000 | 2.960 | 0.070 | 5.527 |
Table 3: Performance comparison on synthetic CVRP instances
| Method | CVRP20 | CVRP50 | CVRP100 | |||
|---|---|---|---|---|---|---|
| Gap (%) | Time (s) | Gap (%) | Time (s) | Gap (%) | Time (s) | |
| GLS | 1.052 | 1.416 | 5.494 | 5.711 | 8.362 | 17.162 |
| FA-GLS | 0.860 | 3.908 | 4.592 | 17.728 | 4.523 | 18.797 |
| ReEvo | 1.174 | 5.392 | 5.782 | 18.293 | 11.276 | 20.577 |
| EoH | 2.018 | 3.992 | 8.008 | 13.619 | 10.852 | 18.961 |
| LLM-HCJG | 0.799 | 1.305 | 0.927 | 10.315 | 3.526 | 20.687 |
Across both problems, FA-GLS improves upon the original GLS, reducing the large-instance gaps from 1.212% to 0.140% on TSP100 and from 8.362% to 4.523% on CVRP100, thereby confirming the contribution of the added search mechanisms. On top of this strengthened framework, LLM-HCJG achieves the best overall solution quality among the evaluated baselines, attaining gaps of 0.070% on TSP100 and 3.526% on CVRP100. Com-pared with the prior LLM-enhanced baselines, LLM-HCJG reduces the TSP100 gap from 0.147% for EoH and 0.293% for ReEvo to 0.070%, and the CVRP100 gap from 10.852% and 11.276% to 3.526%, respectively. This consistent advantage suggests that jointly adapting the construction and guidance components provides a more effective search bias than optimizing the edge-distance update rule alone.
4.4 Performance Comparison on TSPLIB and CVRPLIB
To further assess cross-instance transfer, experiments are conducted on public benchmark instances from TSPLIB and CVRPLIB. The 29 TSPLIB instances follow the selection from the original EoH study. 12 representative instances are chosen from the A, B, E, P, M, and X series, spanning scales from small to near-200, sparse to dense fleet settings, and both capacity-tight and long-route structures. Results denote the performance gaps (%) to the best-known reference solutions. Number denotes the count of instances achieving the best or tied-best result.
Tables D.1 and D.2 report the detailed benchmark results. On TSPLIB, LLM-HCJG achieves the lowest average gap of 0.017% and the best or tied-best performance on 28 of 29 instances. FA-GLS already reduces the average gap of GLS from 1.119% to 0.140%, but LLM-HCJG further improves it to 0.017%, outperforming EoH (3.407%) and ReEvo (0.030%). The CVRPLIB results show an even clearer separation. LLM-HCJG obtains the best or tied-best result on all 12 instances and reduces the average gap to 1.686%, compared with GLS (6.240%), FA-GLS (6.152%), EoH (3.601%), and ReEvo (9.451%). Unlike TSPLIB, CVRPLIB exhibits stronger constraint-induced sensitivity, where FA-GLS yields less stable gains and may deteriorate on capacity-tight or structurally distinct instances. These results indicate that joint component evolution improves not only the underlying search framework but also the cross-instance generalization of LLM-designed heuristics on heterogeneous structures.
The consistent advantage of LLM-HCJG is particularly useful for constrained multi-route problems. Representative route-level comparisons for E-n76-k10 and P-n55-k15 are shown in Figures 6 and 7, respectively. In several baseline solutions, especially FA-GLS and ReEvo, routes tend to connect customers across spatially separated regions, producing long inter-region arcs and unnecessary returns around the depot, which directly increases the total travel cost. For the LLM-enhanced methods, LLM_update_edge_distance introduces diversification but does not explicitly encode route compactness, cross-region separation, or the coupling between construction quality and feasible route-level perturbation. Moreover, LLM_select_next_node is fixed to the nearest-feasible-customer rule, leaving structural biases in the initial route partition only partially repairable by later penalty-guided search. In contrast, LLM-HCJG jointly evolves two search direction components, aligning initial route formation with subsequent edge penalization. Its advantage thus comes not merely from stronger perturbation, but from more accurate localization of where perturbation should be applied, helping preserve geographically coherent customer clusters and guide endpoint-based search toward edges that better correct route-level structure.



Figure 6: Route-level comparison on E-n76-k10.



Figure 7: Route-level comparison on P-n55-k15.
4.5 Ablation Studies on Joint Combinatorial Dependency coevolution
Ablation studies on joint combinatorial dependency coevolution are conducted on TSP, where publicly available EoH studies provide a reliable reference for recombination (Liu et al., 2023, 2024a). Four component pairings are evaluated under the same algorithmic framework as Appendix B.2, differing only in the sources of the initialization and penalty-construction modules: EoH–EoH, EoH–HCJG, HCJG–EoH, and HCJG–HCJG. Detailed results appear in Appendix E.
Tables 6 and 7, together with Figure 8, show that HCJG–HCJG achieves the strongest overall performance. On synthetic instances, it attains the best or tied-best gap at all scales and reduces the TSP100 gap to 0.070%, compared with 0.082%, 0.152%, and 0.159% for the other combinations. On TSPLIB, it also obtains the lowest mean gap of 0.017%, with EoH–HCJG (0.030%), HCJG–EoH (0.611%), and EoH–EoH (2.788%) yielding larger gaps. The asymmetric degradation of the two hybrid variants indicates that the intact jointly evolved pair benefits from cross-component compatibility rather than simple recombination of independently designed modules. The results above support Theorems 3.1 and 3.2, indicating both the nonzero interaction and a higher probability of falling in the consistency set .
The paired analyses in Appendices F.1 and F.2 cover the public benchmarks and cross-component ablation. All bootstrap 95% confidence intervals lie above zero, supporting stable performance advantages under instance-level resampling, while all two-sided Wilcoxon signed-rank tests satisfy p < 0.05, confirming statistically significant paired differences.
5 Conclusion
This paper develops LLM-HCJG, a joint-generation framework that advances LLM-enhanced evolutionary computation from isolated heuristic construction to coordinated component coevolution. By jointly evolving the solution-initialization and penalty-construction components under a shared design blueprint, LLM-HCJG reshapes the search direction of GLS while preserving its interpretable backbone across both TSP and CVRP. Theoretical and ablation analyses confirm their non-separability and effectiveness in terms of pairwise compatibility. Experiments on TSP/CVRP synthetic instances and public benchmarks demonstrate strong solution quality, efficient training, and robust generalization, consistently surpassing single-component LLM-enhanced baselines. These findings suggest that LLMs can move beyond heuristic rule generation toward shaping the structural search bias of concrete algorithmic frameworks.
Future research will focus on three improvements: (i) scalable deployment on larger and more heterogeneous instances, (ii) tighter integration of joint heuristic evolution with model fine-tuning for higher-quality generation, and (iii) extension of joint interacting-component generation to richer routing environments and other metaheuristic frameworks.
References
Arnold, F. and Sörensen, K. (2019). Knowledge-guided local search for the vehicle routing problem. Computers & Operations Research, 105:32–46.
Bengio, Y., Lodi, A., and Prouvost, A. (2021). Machine learning for combinatorial optimization: a methodological tour d'horizon. European Journal of Operational Research, 290(2):405–421.
Blum, C. and Roli, A. (2003). Metaheuristics in combinatorial optimization: Overview and conceptual comparison. ACM Computing Surveys (CSUR), 35(3):268–308.
Brahmachary, S., Joshi, S. M., Panda, A., Koneripalli, K., Sagotra, A. K., Patel, H., Sharma, A., Jagtap, A. D., and Kalyanaraman, K. (2025). Large language model-based evolutionary optimizer: Reasoning with elitism. Neurocomputing, 622:129272.
Cheng, C., Sim, M., and Zhao, Y. (2025). Robust workforce management with crowdsourced delivery. Operations Research, 73(2):595–612.
Croes, G. A. (1958). A method for solving traveling-salesman problems. Operations Research, 6(6):791–812.
Dat, P. V. T., Doan, L., and Binh, H. T. T. (2025). Hsevo: Elevating automatic heuristic design with diversity-driven harmony search and genetic algorithm using llms. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 26931–26938. AAAI.
Elhenawy, M., Abutahoun, A., Alhadidi, T. I., Jaber, A., Ashqar, H. I., Jaradat, S., Abdelhay, A., Glaser, S., and Rakotonirainy, A. (2024). Visual reasoning and multi-agent approach in multimodal large language models (mllms): Solving tsp and mtsp combinatorial challenges. arXiv preprint arXiv:2407.00092.
Guo, D., Yang, D., Zhang, H., Song, J., Wang, P., Zhu, Q., Xu, R., Zhang, R., Ma, S., Bi, X., et al. (2025). Deepseek-r1 incentivizes reasoning in llms through reinforcement learning. Nature, 645(8081):633–638.
Helsgaun, K. (2017). An extension of the lin-kernighan-helsgaun tsp solver for constrained traveling salesman and vehicle routing problems. Technical report, Roskilde University, Roskilde, Denmark. Available at http://webhotel4.ruc.dk/~keld/research/LKH-3/LKH-3_REPORT.pdf.
Huang, J., Li, X., Gao, L., Liu, Q., and Teng, Y. (2024a). Automatic programming via large language models with population self-evolution for dynamic job shop scheduling problem. arXiv preprint arXiv:2410.22657.
Huang, S., Yang, K., Qi, S., and Wang, R. (2024b). When large language model meets optimization. Swarm and Evolutionary Computation, 90:101663.
Huang, Y., Zhang, W., Feng, L., Wu, X., and Tan, K. C. (2025). How multimodal integration boost the performance of llm for optimization: Case study on capacitated vehicle routing problems. In 2025 IEEE Symposium for Multidisciplinary Computational Intelligence Incubators (MCII), pages 1–7. IEEE.
Huang, Z., Shi, G., and Sukhatme, G. S. (2024c). From words to routes: Applying large language models to vehicle routing. CoRR.
Hudson, B., Li, Q., Malencia, M., and Prorok, A. (2021). Graph neural network guided local search for the traveling salesperson problem. arXiv preprint arXiv:2110.05291.
Kim, B., Kim, J. G., and Lee, S. (2024). A multi-agent reinforcement learning model for inventory transshipments under supply chain disruption. IISE Transactions, 56(7):715–728.
Kool, W., Van Hoof, H., and Welling, M. (2018). Attention, learn to solve routing problems! arXiv preprint arXiv:1803.08475.
Kuang, M., Deng, X., Lin, X., Fan, Y., Sun, J., and Shi, J. (2026). Llm-driven co-evolutionary automated heuristic design for bi-component coupled combinatorial optimization. arXiv preprint arXiv:2606.00718.
Kwon, Y.-D., Choo, J., Kim, B., Yoon, I., Gwon, Y., and Min, S. (2020). Pomo: Policy optimization with multiple optima for reinforcement learning. Advances in Neural Information Processing Systems, 33:21188–21198.
Li, R., Wang, L., Sang, H., Yao, L., and Pan, L. (2025). Llm-assisted automatic memetic algorithm for lot-streaming hybrid job shop scheduling with variable sublots. IEEE Transactions on Evolutionary Computation.
Liu, F., Tong, X., Yuan, M., Lin, X., Luo, F., Wang, Z., Lu, Z., and Zhang, Q. (2024a). Evolution of heuristics: Towards efficient automatic algorithm design using large language models. In Proceedings of the 41st International Conference on Machine Learning, pages 32201–32223. ICML.
Liu, F., Tong, X., Yuan, M., Lin, X., Luo, F., Wang, Z., Lu, Z., and Zhang, Q. (2024b). An example of evolutionary computation+ large language model beating human: Design of efficient guided local search. CoRR.
Liu, F., Tong, X., Yuan, M., and Zhang, Q. (2023). Algorithm evolution using large language model. arXiv preprint arXiv:2311.15249.
Liu, S., Chen, C., Qu, X., Tang, K., and Ong, Y.-S. (2024c). Large language models as evolutionary optimizers. In 2024 IEEE Congress on Evolutionary Computation (CEC), pages 1–8. IEEE.
Luo, F., Lin, X., Liu, F., Zhang, Q., and Wang, Z. (2023). Neural combinatorial optimization with heavy decoder: Toward large scale generalization. Advances in Neural Information Processing Systems, 36:8845–8864.
Romera-Paredes, B., Barekatain, M., Novikov, A., Balog, M., Kumar, M. P., Dupont, E., Ruiz, F. J., Ellenberg, J. S., Wang, P., Fawzi, O., et al. (2024). Mathematical discoveries from program search with large language models. Nature, 625(7995):468–475.
Sartori, C. C. and Blum, C. (2025). Combinatorial optimization for all: Using llms to aid non-experts in improving optimization algorithms. arXiv preprint arXiv:2503.10968.
Shi, J., Zhang, Q., and Tsang, E. (2018). Eb-gls: an improved guided local search based on the big valley structure. Memetic Computing, 10(3):333–350.
Song, J.-S., Xiao, L., and Zhang, H. (2025). Optimal dual-sourcing inventory policies with order tracking: Backlogging and lost sales under uncertain lead times. Operations Research, 73(6):2867–2885.
Sui, J., Ding, S., Xia, B., Liu, R., and Bu, D. (2024). Neuralgls: learning to guide local search with graph convolutional network for the traveling salesman problem. Neural Computing and Applications, 36(17):9687–9706.
van Stein, N. and Bäck, T. (2025). Llamea: A large language model evolutionary algorithm for automatically generating metaheuristics. IEEE Transactions on Evolutionary Computation, 29(2):331–345.
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. (2017). Attention is all you need. Advances in Neural Information Processing Systems, 30:5998–6008.
Voudouris, C. and Tsang, E. (1999). Guided local search and its application to the traveling salesman problem. European Journal of Operational Research, 113(2):469–499.
Wu, X., Wang, D., Wu, C., et al. (2025a). Efficient heuristics generation for solving combinatorial optimization problems using large language models. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Vol. 2, pages 3228–3239. ACM.
Wu, X., Wu, S.-h., Wu, J., Feng, L., and Tan, K. C. (2025b). Evolutionary computation in the era of large language model: Survey and roadmap. IEEE Transactions on Evolutionary Computation, 29(2):534–554.
Yang, C., Wang, X., Lu, Y., Liu, H., Le, Q. V., Zhou, D., and Chen, X. (2024). Large language models as optimizers. In Proceedings of the Twelfth International Conference on Learning Representations. ICLR.
Ye, H., Wang, J., Cao, Z., Berto, F., Hua, C., Kim, H., Park, J., and Song, G. (2024). Reevo: Large language models as hyper-heuristics with reflective evolution. Advances in Neural Information Processing Systems, 37:43571–43608.
Ye, H., Xu, H., Yan, A., and Cheng, Y. (2025). Large language model-driven large neighborhood search for large-scale milp problems. In Proceedings of the 42nd International Conference on Machine Learning. ICML.
Yu, H. and Liu, J. (2024). Deep insights into automated optimization with large language models and evolutionary algorithms. arXiv preprint arXiv:2410.20848.
Zelikman, E., Lorch, E., Mackey, L., et al. (2024). Self-taught optimizer (stop): Recursively self-improving code generation. In Proceedings of the First Conference on Language Modeling. COLM.
Zhang, R., Liu, F., Lin, X., Wang, Z., Lu, Z., and Zhang, Q. (2024). Understanding the importance of evolutionary search in automated heuristic design with large language models. In Parallel Problem Solving from Nature – PPSN XVIII, pages 185–202. Springer.
Zhen, L., Gao, J., Tan, Z., Wang, S., and Baldacci, R. (2023). Branch-price-and-cut for trucks and drones cooperative delivery. IISE Transactions, 55(3):271–287.
A Prompt Blocks Utilized within the LLM-HCJG
A.1 Basic Attribute Description for TSP
Basic Attribute Description For TSP
self.problem_description
Travelling Salesman Problem (TSP): given a set of cities and the pairwise distances between them, find a shortest Hamiltonian cycle that visits each city exactly once and returns to the starting city.
Solution Initialization (select_next_node)
self.prompt_task1
Given a set of nodes with their coordinates, please help me design a strategy to find the shortest route that visits each node once and returns to the starting node. The task can be solved step-by-step by starting from the current node and iteratively choosing the next node. Help me design a novel heuristic that is different from the literature to select the next node in each step.
self.prompt_func_name1
select_next_node
self.prompt_func_inputs1
current_node, destination_node, unvisited_nodes, distance_matrix
self.prompt_func_outputs1
next_node
self.prompt_inout_inf1
The function signature must exactly be def select_next_node.
'current_node', 'destination_node', 'next_node', and
'unvisited_nodes' (one-dimensional array) are node IDs which must
be integers. 'distance_matrix' (two-dimensional array with shape
(100,100)) is the distance matrix of nodes. The function must return
exactly one integer node ID selected from unvisited_nodes, not an
index position, score, array, list, tuple, None, NaN, or infinity.
Penalty Construction (update_edge_distance)
self.prompt_task2
Given an edge distance matrix, a local optimal tour, and edge usage counts, design a signed global edge-guidance strategy for TSP. The returned matrix should express how bad or good it is to include each edge in a solution: Here gap means updated_edge_distance - edge_distance: positive gap means the edge should be selectively penalized or avoided, with rank-discriminative signals sufficiently large to affect top-k perturbation while remaining finite and bounded relative to edge distances, negative gap means the edge should be encouraged or preserved, and zero gap means no guidance.
self.prompt_func_name2 update_edge_distance
self.prompt_func_inputs2 edge_distance, local_opt_tour, edge_n_used
self.prompt_func_outputs2 updated_edge_distance
self.prompt_inout_inf2
The function signature must exactly be def update_edge_distance. 'local_opt_tour' is a one-dimensional integer array with shape (100,), ordered from node 0's successor to node 0 without explicit closure. 'edge_distance' (two-dimensional array with shape (100,100)) and 'edge_n_used' (two-dimensional array with shape (100,100)) are matrices. 'edge_n_used' includes the number of times each edge is used during perturbation and may contain zeros. The function must return updated_edge_distance as a numeric NumPy-compatible matrix with exactly the same shape as edge_distance, not a scalar, list, tuple, None, NaN, or infinity. Do not modify edge_n_used in-place. The returned matrix should be symmetric, finite, and non-negative. Avoid numerically explosive formulas such as 1/(edge_n_used + 1e-6), edge_n_used**2.
self.prompt_other_inf
The node indices range from 0 to 99. Import the necessary Python components. When calling any function, match the number, names and types of arguments to the function signature. Don't miss the 'return' at the end. Avoid None, NaN or infinite. All are NumPy arrays by using NumPy methods or convert to other types before applying non-NumPy method. In order to avoid divide-by-zero, add a small epsilon (e.g. +1e-6) to denominators every dividing. Do not call any helper function or use any auxiliary variable unless it is fully defined inside the same function. Treat node IDs and array positions separately. Never index a candidate-length array by node ID or apply element-wise operations to arrays with unequal lengths. Each function must use only its own input arguments and locally defined variables; do not use variables from the other function. Never use edge_n_used in select_next_node; edge_n_used may only be used in update_edge_distance. If a quantity is not in the function signature, do not use it unless you can compute it directly from the provided inputs inside the same function.
A.2 Basic Attribute Description for CVRP
Basic Attribute Description For CVRP
self.problem_description
Capacitated Vehicle Routing Problem (CVRP): given a depot, a set of customers with known demands, pairwise travel distances, and identical vehicles with a fixed capacity, construct feasible routes that each start and end at the depot, serve every customer exactly once without exceeding vehicle capacity, and use exactly the prescribed number K of non-empty vehicle routes while minimizing the total routing cost.
Solution Initialization (select_next_node)
self.prompt_task1
Given the current vehicle node, the feasible customers that can be served without violating the capacity constraint, the remaining unserved customers, the remaining vehicle capacity, the customer demands, and the distance matrix, please help me design a strategy to select the next customer during CVRP route construction. The task can be solved step-by-step by starting from the current vehicle node and iteratively choosing the next feasible customer until all customers are served. The goal is to build a high-quality feasible initial solution. Help me design a novel algorithm that is different from the algorithms in literature.
self.prompt_func_name1
select_next_node
self.prompt_func_inputs1
current_node, feasible_customers, remaining_customers,
remaining_capacity, demands, distance_matrix
self.prompt_func_outputs1
next_node
self.prompt_inout_infl
The function signature must exactly be def select_next_node.
'current_node' and returned 'next_node' are node IDs and must be integers. 'feasible_customers' and 'remaining_customers' are one-dimensional arrays of customer IDs and do not include the depot. 'feasible_customers' is a subset of 'remaining_customers'.
'remaining_capacity' is a non-negative integer. demands' is a one-dimensional array and demands[0] = 0 for the depot.
'distance_matrix' is a symmetric two-dimensional array with shape (n, n). When this function is called, 'feasible_customers' is guaranteed to be non-empty. The function must return exactly one integer customer ID selected from feasible_customers, not the depot, an index position, score, array, list, tuple, None, NaN, or infinity.
Penalty Construction (update_edge_distance)
self.prompt_task2
Given the current edge distance matrix, locally optimal CVRP routes, edge usage counts, customer demands, and vehicle capacity, design a signed global edge-guidance strategy for CVRP. The returned matrix should express how bad or good it is to include each edge in a feasible solution: Here gap means updated_edge_distance - edge_distance: positive gap means the edge should be selectively penalized or avoided, with rank-discriminative signals sufficiently large to affect top-k perturbation while remaining finite and bounded relative to edge distances, negative gap means the edge should be encouraged or preserved, and zero gap means no guidance.
self.prompt_func_name2
update_edge_distance
self.prompt_func_inputs2
edge_distance, local_opt_routes, edge_n_used, demands, vehicle_capacity
self.prompt_func_outputs2
updated_edge_distance
self.prompt_inout_inf2
The function signature must exactly be def update_edge_distance.
'edge_distance' and 'edge_n_used' are two-dimensional arrays with shape (n, n). 'local_opt_routes' is a two-dimensional integer array with shape (n_routes, max_route_len); each row lists customer IDs in visiting order, uses -1 as padding, and does not include the depot. Also score depot boundary edges as well as customer-to-customer edges. Before processing each route, use customers = route[route >= 0] and only process customers; never use np.count_nonzero(route) to determine its valid length. 'demands' is a one-dimensional array and demands[0] = 0. 'vehicle_capacity' is a positive integer. The function must return updated_edge_distance as a numeric NumPy-compatible matrix with exactly the same shape as edge_distance, not a scalar, list, tuple, None, NaN, or infinity. Do not modify edge_n_used in-place. The returned matrix should be symmetric, finite, non-negative, and keep the diagonal equal to zero. Avoid numerically explosive formulas such as 1/(edge_n_used + 1e-6), edge_n_used**2. The returned matrix is also used as the guided distance matrix for endpoint-driven local search in the perturbation phase.
self.prompt_other_inf
Node 0 is the depot. Import the necessary Python components. When calling any function, match the number, names and types of arguments to the function signature. Don't miss the 'return' at the end. Avoid None, NaN or infinite. In order to avoid divide-by-zero, add a small epsilon to denominators every dividing. Use only variables from the current function signature or values locally computed from them; initialize every auxiliary variable on all execution paths before use. Array inputs are NumPy arrays: use NumPy-compatible operations or explicit conversion, respect the documented dimensions, distinguish node IDs from array positions, and check length/shape before indexing or broadcasting. Never use edge_n_used in select_next_node; edge_n_used may only be used in update_edge_distance. Avoid overly aggressive heuristics: do not overemphasize tiny demands or use high-order powers that make scores or penalties extreme and unstable.
A.3 LLM-HCJG Initialization (i1) Prompt Specification
Initialization (i1)
Evolution-specific hints
You are an expert in heuristic algorithm design for the following optimization problem self.problem_description.
Task description
The first task called 'Task1' is that self.prompt_task1. Firstly, start with the title 'Algorithm1:' to describe your new algorithm and main steps in one sentence. The description must be inside a brace. Next, start with the title 'Code1:' to implement it in Python as a function named self.prompt_func_name1. This function should accept str(len(self.prompt_func_inputs1)) input(s): self.prompt_func_inputs1. The function should return str(len(self.prompt_func_outputs1)) output(s): self.prompt_func_outputs1. self.prompt_inout_inf1 + self.prompt_other_inf1.
The second task called 'Task2' is that self.prompt_task2. Firstly, start with the title 'Algorithm2:' to describe your new algorithm and main steps in one sentence. The description must be inside a brace. Next, start with the title 'Code2:' to implement it in Python as a function named self.prompt_func_name2. This function should accept str(len(self.prompt_func_inputs2)) input(s): self.prompt_func_inputs2. The function should return str(len(self.prompt_func_outputs2)) output(s): self.prompt_func_outputs2. self.prompt_inout_inf2 + self.prompt_other_inf2.
Associations between components identification
Output Shared Blueprint consists of a single sentence articulating a common search-direction design principle between Task 1 and Task 2. It should define their complementary roles and explain how both component-level algorithms jointly instantiate this principle, rather than operate independently.
Other hints
Do not give additional explanations.
A.4 LLM-HCJG Crossover (e1) Prompt Specification
Crossover (e1)
Task description
There are two task-algorithms for you to design. Task 1: self.prompt_task1; Task 2: self.prompt_task2.
Parent algorithm(s)
Now I have str(len(indivs)) existing individuals with their hared blueprints, algorithms, and code for the two tasks as follows: No.1 individual
Shared Blueprint: indivs[1][blueprint]
For task1: Algorithm1: indivs[1][algorithm1] + Code1:indivs[1][code1] For task2: Algorithm2: indivs[1][algorithm2] + Code2:indivs[1][code2]
No.2 individual
Shared Blueprint: indivs[2][blueprint]
For task1: Algorithm1: indivs[2][algorithm1] + Code1:indivs[2][code1] For task2: Algorithm2: indivs[2][algorithm2] + Code2:indivs[2][code2]
...
Evolution-specific hints
Please help me create a new individual with new algorithms (Algorithm1 and Algorithm2) that have totally different forms from the given ones.
Associations between components identification
Output Shared Blueprint consists of a single sentence articulating a common search-direction design principle between Task 1 and Task 2.
- It should define their complementary roles and explain how both component-level algorithms jointly instantiate this principle, rather than operate independently.
Other hints
Do not give additional explanations.
A.5 LLM-HCJG Crossover (e2) Prompt Specification
Crossover (e2)
Task description
There are two task-algorithms for you to design. Task 1: self.prompt_task1; Task 2: self.prompt_task2.
Parent algorithm(s)
Now I have str(len(indivs)) existing individuals with their shared blueprints, algorithms, and codes for the two tasks as follows: No.1 individual
Shared Blueprint: indivs[1][blueprint]
For task1: Algorithm1: indivs[1][algorithm1] + Code1:indivs[1][code1] For task2: Algorithm2: indivs[1][algorithm2] + Code2:indivs[1][code2]
No.2 individual
Shared Blueprint: indivs[2][blueprint]
For task1: Algorithm1: indivs[2][algorithm1] + Code1:indivs[2][code1] For task2: Algorithm2: indivs[2][algorithm2] + Code2:indivs[2][code2]
...
Evolution-specific hints
Please help me create a new individual with new algorithms (Algorithm1 and Algorithm2) that have totally different forms from the given ones, but can be inspired by them.
Associations between components identification
Output Shared Blueprint consists of a single sentence articulating a common search-direction design principle between Task 1 and Task 2. It should define their complementary roles and explain how both component-level algorithms jointly instantiate this principle, rather than operate independently.
Other hints
Do not give additional explanations.
A.6 LLM-HCJG Mutation (m1) Prompt Specification
Mutation (m1)
Task description There are two task-algorithms for you to design. Task 1: self.prompt_task1; Task 2: self.prompt_task2.
Parent algorithm(s) Now I have one elite individual with its shared blueprint, algorithm, and code as follows: Shared Blueprint: indivs[blueprint] For task1: Algorithm1: indivs[algorithm1] + Code1:indivs[code1] For task2: Algorithm2: indivs[algorithm2] + Code2:indivs[code2]
Evolution-specific hints Please assist me in creating a new individual with new algorithms (Algorithm1 and Algorithm2) that have different forms but can be modified versions of the algorithms provided.
Associations between components identification
Output Shared Blueprint consists of a single sentence articulating
a common search-direction design principle between Task 1 and Task
2. It should define their complementary roles and explain how both
component-level algorithms jointly instantiate this principle, rather
than operate independently.
Other hints Do not give additional explanations.
A.7 LLM-HCJG Mutation (m2) Prompt Specification
Mutation (m2)
Task description There are two task-algorithms for you to design. Task 1: self.prompt_task1; Task 2: self.prompt_task2.
Parent algorithm(s) Now I have one elite individual with its shared blueprint, algorithm, and code as follows:
Shared Blueprint: indivs[blueprint] For task1: Algorithm1: indivs[algorithm1] + Code1: indivs[code1] For task2: Algorithm2: indivs[algorithm2] + Code2: indivs[code2]
Evolution-specific hints Please identify the main algorithm parameters and assist me in creating a new individual with new algorithms (Algorithm1 and Algorithm2) that have different parameter settings of the score functions provided.
Associations between components identification
Output Shared Blueprint consists of a single sentence articulating a common search-direction design principle between Task 1 and Task 2. It should define their complementary roles and explain how both component-level algorithms jointly instantiate this principle, rather than operate independently.
Other hints Do not give additional explanations.
A.8 LLM-HCJG Mutation (m3) Prompt Specification
Mutation (m3)
Task description There are two task-algorithms for you to design. Task 1: self.prompt_task1; Task 2: self.prompt_task2.
Parent algorithm(s) Now I have one elite individual with its shared blueprint, algorithm, and code as follows: Shared Blueprint: indivs[blueprint] For task1: Algorithm1: indivs[algorithm1] + Code1: indivs[code1] For task2: Algorithm2: indivs[algorithm2] + Code2: indivs[code2]
Evolution-specific hints Please assist me in creating a new individual with new algorithms (Algorithm1 and Algorithm2) that are simplified versions of the provided algorithms, focusing on reducing unnecessary complexity while preserving their essential functionality.
Associations between components identification
Output Shared Blueprint consists of a single sentence articulating a common search-direction design principle between Task 1 and Task 2. It should define their complementary roles and explain how both component-level algorithms jointly instantiate this principle, rather than operate independently.
Other hints
Do not give additional explanations.
B Guided Local Search Realizations for Routing Optimization
B.1 Canonical GLS Procedure for TSP
Algorithm 2 Guided Local Search for TSP
Inputs: Distance matrix , maximum iterations , scaling coefficient , current route , edge penalty and number of customers
Outputs: Best route
1: 2: 3: , 4: 5: 6: 7: for to do 8: 9: 10: for all in do 11: 12: if then 13: 14: 15: end if 16: end for 17: , 18: 19: 20: 21: if then 22: , 23: end if 24: end for 25: return
B.2 LLM-Driven GLS Procedure for TSP
Algorithm 3 LLM-driven Guided Local Search for TSP
Inputs: Distance matrix D, maximum iterations T, maximum perturbation moves per iteration p, current route S and edge penalty P
Outputs: Best route
1: // LLM Solution initialization 2: 3: , 4: 5: for to T do 6: for to p do 7: // LLM Penalty construction 8: 9: 10: for all edge in do 11: , 12: 13: if then 14: , 15: end if 16: 17: if then 18: , 19: end if 20: end for 21: end for 22: 23: 24: if then 25: , 26: end if 27: if then 28: , , 29: end if 30: end for 31: return
B.3 Transferred GLS Procedure for CVRP
Algorithm 4 Guided Local Search for CVRP
Inputs: Distance matrix D, demand vector q, vehicle capacity Q, required number of vehicles K, maximum iterations T, scaling coefficient , route set R, edge penalty P and number of customers n
Outputs: Best route set
1:
2:
3: ,
4:
5:
6: for to T do
7:
8:
9: for all in R do
10:
11: if then
12:
13:
14: end if
15: end for
16: ,
17:
18:
19:
20: if then
21: ,
22: end if
23: end for
24: return
B.4 LLM-Driven GLS Procedure for CVRP
Algorithm 5 LLM-driven Guided Local Search for CVRP
Inputs: Distance matrix D, customer demands q, vehicle capacity Q, required vehicle number K, maximum iterations T, maximum perturbation moves per iteration p, current route set R and edge penalty P
Outputs: Best route set
1: // LLM feasible solution initialization
2:
3: ,
4:
5: for to T do
6: for to p do
7: // LLM Penalty construction
8:
9:
10: for all edge in do
11: ,
12:
13: if then
14: ,
15: end if
16:
17: if then
18: ,
19: end if
20:
21: if then
22: ,
23: end if
24: end for
25: end for
26:
27:
28: if then
29: ,
30: end if
31: if then
32: , ,
33: end if
34: end for
35: return
C Best Elite Heuristics Automatically Generated by LLM
C.1 Best LLM-Generated Elite Heuristic for TSP
The Best Elite Individual
Shared Blueprint
Distance-driven stochastic guidance: construct the initial route by balancing immediate travel cost with randomized continuation potential, then diversify subsequent search through distance-scaled, usage-adaptive randomized penalties on current-route edges.
Thought1
Implement a distance-driven stochastic greedy rule to select the next node: evaluate each candidate mainly by its immediate distance from the current node, while adding a random-weighted nearest-continuation distance to perturb the greedy choice and encourage exploration.
Code1
import numpy as np
def select_next_node(current_node, destination_node, unvisited_nodes, → distance_matrix): scores = [] for next_node in unvisited_nodes: distance_to_next = distance_matrix[current_node][next_node] min_distance_to_unvisited = np.min([ distance_matrix[next_node][unvisited] for unvisited in unvisited_nodes if unvisited != next_node ]) score = distance_to_next + min_distance_to_unvisited * → np.random.rand() scores.append(score)
next_node = unvisited_nodes[np.argmin(scores)] return next_node
Thought2
Implement the distance-driven stochastic perturbation principle to update the search landscape: penalize edges in the local-optimal tour proportionally to their current distance, amplify the penalty for less-used edges, and add random noise to diversify subsequent search moves.
Code2
import numpy as np
def update_edge_distance(edge_distance, local_opt_tour, edge_n_used): updated_edge_distance = np.copy(edge_distance)
for i in range(len(local_opt_tour)): start_node = local_opt_tour[i] end_node = local_opt_tour[(i + 1) % len(local_opt_tour)]
usage_count = edge_n_used[start_node][end_node] + 1e-8 distance = updated_edge_distance[start_node][end_node] penalty = distance * (1 + (1 / usage_count)) * (1 + np.random.rand())
updated_edge_distance[start_node][end_node] += penalty updated_edge_distance[end_node][start_node] += penalty
return updated_edge_distance
Fitness
0.000
Mathematical interpretation of the generated functions.
In LLM_select_next_node, let be the current node and the set of unvisited nodes. Each candidate is scored by combining its immediate distance with a randomized nearest-continuation term,
The next node is selected as .
In LLM_update_edge_distance, for each edge in the current locally optimal tour, a distance-scaled, usage-adaptive, and randomized penalty is computed as
where denotes the current edge distance in the updated distance matrix, is the historical usage count of edge , and avoids division by zero. The penalized distance matrix is then symmetrically modified by
C.2 Best LLM-Generated Elite Heuristic for CVRP
The Best Elite Individual
Shared Blueprint Structure-aware penalty-augmented distance shaping: construct feasible routes by balancing immediate distance with spatial coherence and long-move avoidance, then guide perturbation through demand- and usage-aware adjustments to current-route edges.
Thought1 Select the next feasible customer using a penalty-augmented distance score that combines immediate travel distance, spatial coherence among remaining feasible customers, and an additional penalty for unusually long moves.
Code1
import numpy as np
def select_next_node(current_node, feasible_customers, remaining_customers, remaining_capacity, demands, distance_matrix): next_node = None best_score = float('inf')
distances = distance_matrix[current_node, feasible_customers]
for i, customer in enumerate(feasible_customers): if demands[customer] <= remaining_capacity: nearby_customers = [ c for c in remaining_customers if c != customer and demands[c] <= remaining_capacity ]
if len(nearby_customers) > 0: spatial_coherence = np.mean( distance_matrix[customer, nearby_customers] ) else: spatial_coherence = 0.0
score = distances[i] + 0.15 * spatial_coherence
if distances[i] > np.mean(distances): score *= 1.1 if score < best_score: best_score = score next_node = customer
return next_node
Thought2 Update the edge distance matrix using a penalty-augmented distance adjustment, where each local-optimal-route edge is scaled by its distance, route demand level, and historical usage, with clipping and symmetry preserving stability.
Code2 import numpy as np
def update_edge_distance(edge_distance, local_opt_routes, edge_n_used, demands, vehicle_capacity): n = edge_distance.shape[0] updated_edge_distance = np.copy(edge_distance)
for route in local_opt_routes: customers = route[route >= 0]
if customers.size > 0: total_demand = demands[customers].sum() demand_normalized = total_demand / max(vehicle_capacity, 1)
for i in range(len(customers) - 1): from_customer = customers[i] to_customer = customers[i + 1]
edge_use = ( edge_n_used[from_customer][to_customer] + 1e-6 )
adjustment = ( edge_distance[from_customer][to_customer] * (1 - edge_use / 20) * (1 + 0.5 * demand_normalized) )
updated_edge_distance[from_customer][to_customer] = max(
0, updated_edge_distance[from_customer][to_customer]
- adjustment )
updated_edge_distance[to_customer][from_customer] = ( updated_edge_distance[from_customer][to_customer] )
np.fill_diagonal(updated_edge_distance, 0)
return updated_edge_distance
Fitness 2.046
Mathematical interpretation of the generated functions.
In LLM_select_next_node, let be the current node and the set of capacity-feasible candidate customers. For each , the compactness-oriented score is defined as
where is the immediate travel distance, is the spatial-coherence penalty computed over , and is the long-move penalty factor:
The next customer is selected as .
In LLM_update_edge_distance, for each local-optimal route , let denote its valid customer sequence and define the normalized route demand as
For each edge in , a structure-aware distance adjustment reshapes the local-route edge cost by scaling the original distance with route demand and historical edge usage:
where is the historical usage count of edge , and is a small smoothing constant. The penalized distance matrix is then symmetrically modified by
C.3 Best Penalty-Construction Individuals Generated by EoH and ReEvo
C.3.1 EoH on TSP from Publication (Liu et al., 2024a)
The Best EoH Penalty-Construction Individual for TSP
Thought2 Update the edge distances in the edge distance matrix by incorporating a pheromone-like effect, where the update is determined by edge count, distance, and usage, with the addition of a decay factor to avoid stagnation and promote exploration.
Code2 import numpy as np
def update_edge_distance(edge_distance, local_opt_tour, edge_n_used): updated_edge_distance = np.copy(edge_distance) edge_count = np.zeros_like(edge_distance) for i in range(len(local_opt_tour) - 1): start = local_opt_tour[i] end = local_opt_tour[i + 1] edge_count[start][end] += 1 edge_count[end][start] += 1
edge_n_used_max = np.max(edge_n_used) + 1e-8 decay_factor = 0.1 mean_distance = np.mean(edge_distance) + 1e-8
for i in range(edge_distance.shape[0]): for j in range(edge_distance.shape[1]): if edge_count[i][j] > 0: noise_factor = ( np.random.uniform(0.7, 1.3) / edge_count[i][j] + edge_distance[i][j] / mean_distance - (0.3 / edge_n_used_max) * edge_n_used[i][j] ) updated_edge_distance[i][j] += ( noise_factor * (1 + edge_count[i][j]) - decay_factor * updated_edge_distance[i][j] )
return updated_edge_distance
C.3.2 EoH on CVRP
The Best EoH Penalty-Construction Individual for CVRP
Thought2 Balancing capacity awareness and search diversification by revising traversed edge costs according to customer demand, distance, and historical usage.
Code2
def update_edge_distance(edge_distance, local_opt_routes, edge_n_used, → demands, vehicle_capacity): updated_edge_distance = edge_distance.copy() eps = 1e-8
for route in local_opt_routes: if route[0] == -1: continue
route_length = len(route)
for i in range(route_length - 1): if route[i] == -1 or route[i + 1] == -1: continue
u = route[i] v = route[i + 1] current_load = demands[u]
distance_penalty = edge_distance[u][v] + eps usage_penalty = edge_n_used[u][v] + eps
if vehicle_capacity > 0: updating_value = ( current_load / vehicle_capacity ) * (distance_penalty + usage_penalty) else: updating_value = distance_penalty + usage_penalty
updated_edge_distance[u][v] += updating_value updated_edge_distance[v][u] += updating_value edge_n_used[u][v] += 1 edge_n_used[v][u] += 1
np.fill_diagonal(updated_edge_distance, 0) return updated_edge_distance
C.3.3 ReEvo on TSP
The Best ReEvo Penalty-Construction Individual for TSP
Thought2
Adaptively reshaping edge distances through usage-aware nonlinear penalties and exploration noise while preserving symmetry, non-negativity, and the original overall scale.
Code2
import numpy as np def update_edge_distance(edge_distance: np.ndarray, local_opt_tour: np.ndarray, edge_n_used: np.ndarray) -> np.ndarray: import numpy as np
updated = edge_distance.copy() n = len(local_opt_tour) max_penalty = np.max(edge_distance) + 1
for i in range(n): u = int(local_opt_tour[i]) v = int(local_opt_tour[(i + 1) % n])
usage_count = edge_n_used[u, v] distance = edge_distance[u, v]
penalty = (0.1 * distance * (1 + 0.05 * usage_count ** 2) if usage_count > 0 else 0.1 * distance + max_penalty )
updated[u, v] = max(0, distance + penalty) updated[v, u] = updated[u, v]
if usage_count > 0: decay_factor = 0.02 * np.log(usage_count + 1) ** 2 updated[u, v] += decay_factor updated[v, u] += decay_factor
if usage_count == 0: underused_penalty = 0.2 * (1 / (1 + np.sqrt(distance))) updated[u, v] += underused_penalty updated[v, u] += underused_penalty
exploration_need = np.mean(edge_n_used) randomness_scale = max(0.1, 0.5 / (1 + exploration_need)) randomness = np.random.rand(n, n) * randomness_scale updated += randomness
updated = np.maximum(updated, 0)
scale_factor = np.sum(updated) + 1e-10 updated = updated / scale_factor * np.sum(edge_distance)
np.fill_diagonal(updated, 0) return updated
C.3.4 ReEvo on CVRP
The Best ReEvo Penalty-Construction Individual for CVRP
Thought2 Diversifying routes by nonlinearly increasing the costs of unique route edges according to repeated usage, endpoint demand, and total route load.
Code2
def update_edge_distance(edge_distance: np.ndarray, local_opt_routes: np.ndarray, edge_n_used: np.ndarray, demands: np.ndarray, vehicle_capacity: int) -> np.ndarray: updated_edge_distance = np.copy(edge_distance) np.fill_diagonal(updated_edge_distance, 0.0)
cap = max(vehicle_capacity, 1.0) eps = 1e-8
route_load_factor = lambda demand: demand / (cap + eps)
if local_opt_routes.size != 0: for route in local_opt_routes: customers = route[route >= 0]
if customers.size > 0: route_demand = np.sum(demands[customers]) route_ratio = route_load_factor(route_demand)
route_edges = ([0, int(customers[0])]) + [ (int(customers[i]), int(customers[i + 1])) for i in range(len(customers) - 1) ] + [(int(customers[-1]), 0)] )
unique_edges = set(route_edges)
for u, v in unique_edges: edge_usage = edge_n_used[u, v] + 1 combined_demand = (demands[u] + demands[v]) / (cap + eps)
penalty = (1.0 + edge_usage ** 1.5 * 0.12 + combined_demand * 0.2 + route_ratio * 0.4 ) adaptive_factor = 1.0 updated_penalty = penalty * adaptive_factor * 0.18 updated_edge_distance[u, v] += updated_penalty updated_edge_distance[v, u] += updated_penalty
edge_n_used[u, v] += 1 edge_n_used[v, u] += 1
updated_edge_distance = (updated_edge_distance + updated_edge_distance.T) / 2 updated_edge_distance = np.clip(updated_edge_distance, 0, None) np.fill_diagonal(updated_edge_distance, 0.0)
return updated_edge_distance
C.4 Structural Focus and Diversity Indicators
Consider an evolved individual
where is the shared design blueprint, is the solution-initialization function, and is the penalty-construction function.
For a problem instance , let denote the original distance matrix and let collect the problem-specific information. For TSP, is omitted; for CVRP, contains the customer demands and vehicle capacity. The initialization function constructs the initial solution
Starting from , local search and guided perturbation produce a sequence of search states. Define as the current search state at the h-th call to , and define its route-edge collection as
Let denote the edge-usage count matrix at the -th update call. Applying to the current search state defines the guided distance matrix
where .
Define the positive gap on edge at update call h as
Because of the symmetric routing problems considered in this study, define the symmetric positive gap as
Define the average positive gap on the current search-state edges as
Let denote the number of nodes in instance x, and define the candidate undirected-edge set as
The global average positive gap is then defined as
Define the Penalty Focus Ratio as
where is a small constant that prevents division by zero. The normalized Focus indicator is defined as
To quantify edge-level differentiation within the current search state, define the standard deviation of the positive gaps as
Define the Penalty Focus Diversity ratio and its normalized form as
D Performance Comparison on Public Benchmark Instances
D.1 Results on TSPLIB Instances
Table 4: Performance comparison on TSPLIB instances
| Instance | LS | GLS | FA-GLS | KGLS-r | KGLS-c | EBGLS | AM | POMO | LEHD | GNNGLS | NeuralGLS | EoH | ReEvo | LLM-HCJG |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| eil51 | 1.214 | 1.643 | 0.000 | 0.700 | 0.700 | 0.700 | 1.628 | 0.829 | 1.640 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| berlin52 | 3.894 | 0.000 | 0.000 | 0.031 | 0.031 | 0.031 | 4.169 | 0.035 | 0.031 | 0.142 | 0.000 | 3.911 | 0.000 | 0.000 |
| st70 | 1.945 | 0.741 | 0.000 | 0.313 | 0.313 | 0.325 | 1.737 | 0.313 | 0.325 | 0.764 | 0.000 | 1.185 | 0.000 | 0.000 |
| eil76 | 4.146 | 0.558 | 0.000 | 1.184 | 1.184 | 1.184 | 1.992 | 1.184 | 2.544 | 0.163 | 0.000 | 0.000 | 0.000 | 0.000 |
| pr76 | 1.506 | 0.000 | 0.000 | 0.000 | 0.000 | 0.097 | 0.816 | 0.000 | 0.219 | 0.039 | 0.823 | 1.505 | 0.000 | 0.000 |
| rat99 | 6.459 | 4.211 | 0.000 | 0.681 | 0.826 | 6.459 | 2.645 | 2.392 | 1.099 | 0.550 | 0.718 | 7.597 | 0.000 | 0.000 |
| kroA100 | 2.998 | 0.108 | 0.000 | 0.119 | 0.016 | 2.998 | 4.017 | 0.413 | 0.119 | 0.728 | 0.029 | 2.979 | 0.000 | 0.000 |
| kroB100 | 0.577 | 0.262 | 0.262 | 0.254 | 0.254 | 0.577 | 5.142 | 0.323 | 0.256 | 0.147 | 0.882 | 0.578 | 0.000 | 0.000 |
| kroC100 | 5.582 | 2.024 | 0.000 | 0.344 | 0.008 | 0.008 | 0.972 | 0.183 | 0.325 | 1.571 | 1.771 | 5.591 | 0.000 | 0.000 |
| kroD100 | 6.641 | 0.545 | 0.000 | 0.001 | 0.001 | 0.001 | 2.717 | 0.842 | 0.383 | 0.572 | 0.000 | 6.631 | 0.000 | 0.000 |
| kroE100 | 4.641 | 0.480 | 0.172 | 0.174 | 0.194 | 0.288 | 1.470 | 0.450 | 0.426 | 1.216 | 1.053 | 4.649 | 0.000 | 0.000 |
| rd100 | 9.314 | 0.013 | 0.000 | 0.005 | 0.005 | 0.202 | 3.407 | 0.005 | 0.005 | 0.459 | 0.000 | 9.317 | 0.000 | 0.000 |
| eil101 | 5.180 | 0.477 | 0.000 | 2.113 | 2.514 | 2.117 | 2.994 | 1.844 | 2.309 | 0.201 | 0.362 | 0.000 | 0.000 | 0.000 |
| lin105 | 2.606 | 0.730 | 0.000 | 0.028 | 0.028 | 0.313 | 1.739 | 0.521 | 0.343 | 0.606 | 0.647 | 2.573 | 0.000 | 0.000 |
| pr107 | 0.614 | 0.305 | 0.000 | 0.000 | 0.000 | 0.414 | 3.933 | 0.524 | 11.235 | 0.439 | 0.808 | 0.618 | 0.000 | 0.000 |
| pr124 | 2.441 | 0.878 | 0.000 | 2.441 | 2.441 | 0.650 | 3.677 | 0.603 | 1.112 | 0.755 | 0.075 | 2.439 | 0.000 | 0.000 |
| bier127 | 1.789 | 0.579 | 0.119 | 0.190 | 0.185 | 0.247 | 5.908 | 13.721 | 4.761 | 1.948 | 2.272 | 1.777 | 0.037 | 0.026 |
| ch130 | 7.613 | 0.295 | 0.393 | 0.012 | 0.012 | 0.068 | 3.182 | 0.157 | 0.554 | 3.519 | 1.188 | 6.579 | 0.000 | 0.000 |
| pr136 | 6.304 | 1.898 | 0.234 | 0.155 | 0.092 | 0.152 | 5.064 | 0.927 | 0.449 | 3.387 | 2.319 | 6.305 | 0.000 | 0.000 |
| pr144 | 4.194 | 0.386 | 0.000 | 0.000 | 0.000 | 0.000 | 7.641 | 0.531 | 0.194 | 3.581 | 0.743 | 4.196 | 0.000 | 0.000 |
| ch150 | 1.282 | 0.934 | 0.000 | 0.437 | 0.429 | 0.429 | 4.584 | 0.528 | 0.519 | 2.113 | 2.488 | 2.099 | 0.000 | 0.000 |
| kroA150 | 7.101 | 3.273 | 0.004 | 0.099 | 0.099 | 1.458 | 3.784 | 0.696 | 1.402 | 2.984 | 0.773 | 7.099 | 0.000 | 0.000 |
| kroB150 | 5.546 | 2.748 | 0.758 | 0.790 | 1.234 | 0.091 | 2.437 | 1.167 | 0.756 | 3.258 | 3.114 | 4.298 | 0.008 | 0.000 |
| pr152 | 1.895 | 0.185 | 0.185 | 1.895 | 1.895 | 0.189 | 7.494 | 1.054 | 12.136 | 3.119 | 0.000 | 1.889 | 0.000 | 0.000 |
| u159 | 5.952 | 1.457 | 0.580 | 0.000 | 0.000 | 0.150 | 7.551 | 0.951 | 1.132 | 1.020 | 0.904 | 5.784 | 0.000 | 0.000 |
| rat195 | 1.562 | 1.722 | 0.387 | 1.562 | 1.106 | 0.640 | 6.893 | 8.150 | 1.418 | 1.666 | 0.478 | 1.894 | 0.430 | 0.215 |
| d198 | 1.775 | 0.817 | 0.114 | 0.393 | 0.425 | 0.824 | 373.020 | 17.290 | 9.235 | 4.772 | 1.280 | 1.027 | 0.114 | 0.101 |
| kroA200 | 0.907 | 0.872 | 0.000 | 0.548 | 0.459 | 0.567 | 7.106 | 1.577 | 0.644 | 2.029 | 0.861 | 0.916 | 0.177 | 0.089 |
| kroB200 | 5.357 | 4.308 | 0.856 | 0.722 | 0.984 | 1.524 | 8.541 | 1.440 | 0.156 | 2.589 | 3.742 | 5.364 | 0.099 | 0.051 |
| Average | 3.829 | 1.119 | 0.140 | 0.524 | 0.532 | 0.783 | 16.768 | 2.022 | 1.922 | 1.529 | 0.942 | 3.407 | 0.030 | 0.017 |
| Number | 0 | 2 | 17 | 4 | 4 | 1 | 0 | 1 | 0 | 1 | 7 | 3 | 23 | 28 |
Notes: All entries are optimality gaps (%). Boldface marks the smallest or tied-smallest gap on each instance.
D.2 Results on CVRPLIB Instances
Table 5: Performance comparison on CVRPLIB instances
| Instance | GLS | FA-GLS | EoH | ReEvo | LLM-HCJG |
|---|---|---|---|---|---|
| A-n32-k5 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| A-n60-k9 | 0.369 | 0.812 | 0.369 | 7.164 | 0.295 |
| B-n50-k7 | 8.637 | 0.405 | 0.000 | 0.270 | 0.000 |
| B-n78-k10 | 11.138 | 3.440 | 1.229 | 6.798 | 0.082 |
| E-n76-k10 | 3.614 | 7.349 | 4.337 | 14.819 | 1.687 |
| E-n101-k8 | 6.258 | 3.436 | 2.945 | 6.012 | 0.491 |
| P-n55-k15 | 15.875 | 19.818 | 10.313 | 35.490 | 4.449 |
| P-n101-k4 | 1.028 | 8.370 | 2.496 | 6.314 | 0.294 |
| M-n151-k12 | 11.133 | 7.783 | 4.532 | 12.709 | 3.054 |
| X-n162-k11 | 5.029 | 6.613 | 4.994 | 6.882 | 1.457 |
| X-n167-k10 | 7.219 | 8.902 | 6.990 | 10.702 | 4.461 |
| X-n190-k8 | 4.576 | 6.896 | 5.012 | 6.254 | 3.963 |
| Average | 6.240 | 6.152 | 3.601 | 9.451 | 1.686 |
| Number | 1 | 1 | 2 | 1 | 12 |
E Joint Component Co-Evolution Ablation
E.1 Cross-Component Combination Results on Synthetic TSP Instances
Table 6: Cross-component combination ablation results on synthetic TSP instances.
| Combination | TSP20 | TSP50 | TSP100 | |||
|---|---|---|---|---|---|---|
| Gap (%) | Time (s) | Gap (%) | Time (s) | Gap (%) | Time (s) | |
| EoH-EoH | 0.000 | 3.044 | 0.001 | 7.449 | 0.159 | 22.505 |
| HCJG-HCJG | 0.000 | 1.757 | 0.000 | 2.960 | 0.070 | 5.527 |
| EoH-HCJG | 0.000 | 1.934 | 0.000 | 2.830 | 0.082 | 5.059 |
| HCJG-EoH | 0.000 | 5.209 | 0.000 | 8.750 | 0.152 | 26.142 |
E.2 Cross-Component Combination Results on TSPLIB Instances
Table 7: Cross-component combination ablation results on TSPLIB instances.
| Instance | HCJG-HCJG | EoH-EoH | EoH-HCJG | HCJG-EoH |
|---|---|---|---|---|
| eil51 | 0.000 | 0.000 | 0.000 | 0.000 |
| berlin52 | 0.000 | 2.294 | 0.000 | 0.000 |
| st70 | 0.000 | 0.000 | 0.000 | 0.000 |
| eil76 | 0.000 | 0.000 | 0.000 | 0.000 |
| pr76 | 0.000 | 5.504 | 0.000 | 0.000 |
| rat99 | 0.000 | 3.468 | 0.000 | 1.156 |
| kroA100 | 0.000 | 1.198 | 0.000 | 0.000 |
| kroB100 | 0.000 | 5.090 | 0.000 | 0.357 |
| kroC100 | 0.000 | 3.634 | 0.000 | 0.713 |
| kroD100 | 0.000 | 6.490 | 0.000 | 1.371 |
| kroE100 | 0.000 | 2.411 | 0.000 | 0.195 |
| rd100 | 0.000 | 1.820 | 0.000 | 0.367 |
| eil101 | 0.000 | 0.000 | 0.000 | 0.000 |
| lin105 | 0.000 | 2.170 | 0.000 | 0.000 |
| pr107 | 0.000 | 0.618 | 0.000 | 0.000 |
| pr124 | 0.000 | 1.896 | 0.000 | 0.601 |
| bier127 | 0.026 | 3.817 | 0.063 | 0.965 |
| ch130 | 0.000 | 5.385 | 0.000 | 1.178 |
| pr136 | 0.000 | 0.339 | 0.000 | 1.406 |
| pr144 | 0.000 | 1.280 | 0.000 | 0.000 |
| ch150 | 0.000 | 3.676 | 0.000 | 0.077 |
| kroA150 | 0.000 | 6.466 | 0.000 | 1.218 |
| kroB150 | 0.000 | 4.057 | 0.000 | 1.382 |
| pr152 | 0.000 | 3.644 | 0.000 | 0.471 |
| u159 | 0.000 | 0.530 | 0.000 | 0.960 |
| rat195 | 0.215 | 3.874 | 0.517 | 1.378 |
| d198 | 0.101 | 0.627 | 0.133 | 0.754 |
| kroA200 | 0.089 | 2.874 | 0.099 | 1.199 |
| kroB200 | 0.051 | 7.698 | 0.065 | 1.981 |
| Mean gap | 0.017 | 2.788 | 0.030 | 0.611 |

Figure 8: Visual comparison of optimality gaps on TSPLIB with non-identical results.
F Statistical Significance and Uncertainty Analysis
Paired analyses are conducted using the per-instance optimality gaps reported in Appendices D.1, D.2, and E.2, with paired differences defined as the compared-method gap minus the HCJG gap, in percentage points. Uncertainty is quantified by percentile-bootstrap 95% confidence intervals for the mean paired difference using 20,000 instance-level resamples with a fixed random seed, while statistical significance is assessed using two-sided Wilcoxon signed-rank tests at .
F.1 Public TSPLIB and CVRPLIB Benchmarks
Table 8: Paired uncertainty and significance analysis on public benchmarks.
| Benchmark | Comparator | Bootstrap 95% CI (pp) | Wilcoxon -value | |
|---|---|---|---|---|
| TSPLIB | GLS | 29 | [0.703, 1.547] | |
| TSPLIB | FA-GLS | 29 | [0.048, 0.213] | |
| TSPLIB | EoH | 29 | [2.476, 4.343] | |
| TSPLIB | ReEvo | 29 | [0.001, 0.031] | |
| CVRPLIB | GLS | 12 | [2.306, 6.939] | |
| CVRPLIB | FA-GLS | 12 | [2.467, 6.936] | |
| CVRPLIB | EoH | 12 | [1.052, 2.879] | |
| CVRPLIB | ReEvo | 12 | [4.146, 12.759] |
Notes: The interval entirely above zero favors LLM-HCJG.
F.2 Cross-Component Co-Evolution Ablation
Table 9: Paired uncertainty and significance analysis for TSPLIB ablation.
| Comparator | Bootstrap 95% CI (pp) | Wilcoxon -value | |
|---|---|---|---|
| EoH-EoH | 29 | [2.010, 3.575] | |
| EoH-HCJG | 29 | [0.001, 0.036] | |
| HCJG-EoH | 29 | [0.388, 0.801] |
Note: The interval entirely above zero favors HCJG+HCJG.
G Proofs of Theoretical Results
G.1 Proof of Theorem 3.1
Proof. Let
and
By (16),
Substituting these four identities into (17) gives
(51)
By (18) and (19), there exists an edge for which
It follows from (51) that
and hence .
It remains to prove that (20) cannot hold. Suppose, to the contrary, that there exist and satisfying (20) for every component combination. By Definition 3.2,
which contradicts . Therefore, (20) is impossible, and the initialization and penalty-construction components are non-separable at the search-state-transition level.
G.2 Proof of Theorem 3.2
Proof. For joint generation, (5) implies that, conditional on any blueprint Z = z,
hold simultaneously with probability one. Hence,
Applying the law of total probability yields
(58) which proves (21).
For independent generation, (22) and (5) imply that
Therefore,
(60)
where the last equality follows from the independence of and . Taking the complement proves (25).
Finally, if there exist distinct such that
then . Thus, the mismatch probability in (25) is strictly positive.