LLM-Driven Co-Evolutionary Automated Heuristic Design for Bi-Component Coupled Combinatorial Optimization
Summary
Proposes CoEvo-AHD, an LLM-driven dual-population co-evolutionary framework for automated heuristic design in bi-component coupled combinatorial optimization problems. It leverages LLMs to co-evolve route and selection operators, using cooperative evaluation and joint crossover to discover complementary heuristics for problems like TTP and TPP.
View Cached Full Text
Cached at: 06/02/26, 03:48 PM
# LLM-Driven Co-Evolutionary Automated Heuristic Design for Bi-Component Coupled Combinatorial Optimization
Source: [https://arxiv.org/html/2606.00718](https://arxiv.org/html/2606.00718)
Mingen Kuang Xi’an Jiao Tong University kuangme@stu\.xjtu\.edu\.cn &Xudong Deng11footnotemark:1 Xi’an Jiao Tong University dxd3125307059@stu\.xjtu\.edu\.cn &Xi Lin Xi’an Jiao Tong University xi\.lin@xjtu\.edu\.cn Ye Fan Northwestern Polytechnical University fanye@nwpu\.edu\.cn &Jianyong Sun Xi’an Jiao Tong University jy\.sun@xjtu\.edu\.cn &Jialong Shi Xi’an Jiao Tong University jialong\.shi@xjtu\.edu\.cn
###### Abstract
While Large Language Models \(LLMs\) have recently shown promise in Automated Heuristic Design \(AHD\), existing methods typically generate and evolve heuristics as a single operator or search strategy, limiting their ability to model strong coupling among multiple decision substructures in problems such as the Traveling Thief Problem \(TTP\) and the Traveling Purchaser Problem \(TPP\)\. In this work, we propose CoEvo\-AHD, an LLM\-driven dual\-population co\-evolutionary framework for automated heuristic design in coupled combinatorial optimization\. Unlike prior methods that evolve individual heuristics in isolation, CoEvo\-AHD leverages LLMs to co\-evolve two closely related operator populations\. A cooperative evaluation mechanism explicitly captures interactions between route and selection operators, while pairwise scoring and synergistic joint crossover help discover complementary operator logic for joint improvement across coupled decision subspaces\. We further design a tool\-invocation environment library that encapsulates frequently used core operations, such as local\-search delta computation, into callable functions, enabling LLM\-generated operators to use standardized interfaces instead of reimplementing inefficient and error\-prone problem\-specific loops\. Experiments on TTP and TPP show that CoEvo\-AHD automatically discovers cooperative heuristic combinations and achieves competitive solution quality against traditional heuristics\.
## 1Introduction
Large language models \(LLMs\) have recently opened a new direction for automated heuristic design, where executable heuristics can be generated, evaluated, and refined with limited human intervention\. Existing LLM\-driven methods have shown promising results in generating heuristic functions, construction rules, or local search operators through iterative loops of generation, evaluation, feedback, and regeneration\[[24](https://arxiv.org/html/2606.00718#bib.bib1),[28](https://arxiv.org/html/2606.00718#bib.bib39),[15](https://arxiv.org/html/2606.00718#bib.bib2),[30](https://arxiv.org/html/2606.00718#bib.bib3)\]\. However, most of these methods still treat a generated heuristic as an isolated algorithmic unit\. This assumption becomes restrictive for many real\-world combinatorial optimization \(CO\) problems, where a solution consists of multiple interdependent decision components and the effect of a local move cannot be assessed within a single component alone\.
We use bi\-component coupled CO to denote problems whose solutions can be decomposed into two semantically distinct components, while the feasibility or objective effect of modifying either component depends on the state of the other\. In such problems, the utility of a component operator is inherently relational rather than intrinsic: it depends not only on how the operator modifies its own component, but also on how this modification interacts with the other component\. Consequently, independently designing or evaluating operators for the two components may lead to moves that are locally admissible but misaligned with the joint objective\.
The Traveling Thief Problem \(TTP\)\[[3](https://arxiv.org/html/2606.00718#bib.bib43),[21](https://arxiv.org/html/2606.00718#bib.bib44)\]and the Traveling Purchaser Problem \(TPP\)\[[16](https://arxiv.org/html/2606.00718#bib.bib14)\]are representative examples of this setting\. They differ in how coupling is induced: TTP couples routing with load\-dependent travel cost, where the tour order affects the cost of carrying selected items and the packing plan changes the evaluation of tour moves; TPP couples routing with market\-dependent procurement feasibility and cost, where market selection, visiting order, prices, supplies, and demand satisfaction jointly determine solution quality\. These problems illustrate a common challenge: high\-quality search requires not only strong component\-level operators, but also operator pairs whose behaviors are coordinated under the full coupled objective\.
Although recent LLM\-based studies have begun to explore heuristic sets and multi\-operator collaboration\[[14](https://arxiv.org/html/2606.00718#bib.bib42),[32](https://arxiv.org/html/2606.00718#bib.bib40),[22](https://arxiv.org/html/2606.00718#bib.bib41),[11](https://arxiv.org/html/2606.00718#bib.bib7)\], their focus is mainly on complementarity among algorithmic roles within general search frameworks, such as construction strategies, destroy–repair operators, or search\-policy combinations\. In contrast, bi\-component coupled CO requires modeling complementarity among decision components of the solution itself\. The key question is therefore not merely whether LLMs can generate stronger individual heuristics, but whether they can generate and refine paired component operators whose effectiveness is evaluated jointly under the full coupled objective\.
To address this question, we proposeCoEvo\-AHD, an LLM\-driven co\-evolutionary automated heuristic design framework for bi\-component coupled CO\. CoEvo\-AHD maintains two component\-specific operator populations and uses LLMs to generate, rewrite, and recombine executable component operators\. Instead of scoring operators in isolation, CoEvo\-AHD embeds selected operator pairs into search trajectories over complete solutions, applies feasibility repair or component reconstruction when necessary, and evaluates the resulting solutions under the full coupled objective\. The obtained rewards update both individual operator scores and pairwise synergy scores, aligning evolutionary selection pressure with the relational nature of operator utility\. In addition to within\-component mutation and crossover, CoEvo\-AHD performs cross\-component joint crossover on high\-performing operator pairs, encouraging newly generated operators to share compatible communication protocols and complementary search assumptions\.
CoEvo\-AHD further introduces structured inter\-component communication and a tool\-augmented problem environment\. The communication protocol specifies what types of information can be exchanged, such as search states, candidate modification suggestions, and local evaluation signals, without directly prescribing the heuristic logic for exploiting them\. These signals are treated as verifiable search suggestions and can be accepted only after candidate construction, repair or reconstruction, and full\-objective evaluation\. The tool\-augmented problem environment exposes reliable primitives for objective evaluation, feasibility repair, component reconstruction, marginal analysis, and delta evaluation, allowing LLM\-generated code to focus on neighborhood design and cross\-component search decisions rather than error\-prone low\-level implementation\.
The contributions of this paper are threefold\. First, we formulate LLM\-driven automated heuristic design for bi\-component coupled CO, where operator utility is relational and must be assessed through interactions between two heterogeneous solution components\. Second, we propose CoEvo\-AHD, a co\-evolutionary framework with component\-specific operator populations, paired execution\-based evaluation, and pairwise synergy scores for selecting complementary operator pairs\. Third, we design structured component communication, cross\-component joint crossover, and a tool\-augmented problem environment, and instantiate the framework on two representative problems, TTP and TPP, to evaluate its effectiveness\.
## 2Related Work
### 2\.1LLM\-Driven Automated Heuristic Design
Heuristic algorithms are widely used in combinatorial optimization, but their design often relies on manual specification of solution representations, neighborhood structures, and repair strategies\. Recent advances in large language models \(LLMs\) have enabled LLM\-driven automated heuristic design \(LLM\-AHD\), where executable heuristic code can be generated and refined through program search\. FunSearch combines LLMs with automatic evaluators to search for executable functions\[[24](https://arxiv.org/html/2606.00718#bib.bib1)\]\. EoH formulates heuristic design as joint evolution of natural\-language ideas and executable code\[[15](https://arxiv.org/html/2606.00718#bib.bib2)\], while ReEvo introduces reflective evolution that converts historical search performance into language feedback\[[30](https://arxiv.org/html/2606.00718#bib.bib3)\]\. HSEvo, MCTS\-AHD, and MEoH further extend LLM\-AHD in terms of population diversity, tree\-search exploration, and multi\-objective heuristic evolution\[[4](https://arxiv.org/html/2606.00718#bib.bib4),[33](https://arxiv.org/html/2606.00718#bib.bib5),[29](https://arxiv.org/html/2606.00718#bib.bib6)\]\.
These studies demonstrate that LLM\-AHD can handle more complex algorithmic structures than single heuristics, but operator complementarity mainly occurs at the level of algorithmic roles\. In contrast, our work binds operators to heterogeneous components of the complete solution, where their utility depends on interactions across components rather than the algorithmic workflow, thus modeling complementarity at the problem\-structure level\.
### 2\.2Multi\-Operator Collaboration and Positioning of This Work
Recent studies have extended LLM\-AHD to multi\-operator collaboration\. EoH\-S generates complementary heuristic sets to improve cross\-instance generalization\[[14](https://arxiv.org/html/2606.00718#bib.bib42)\]\. G\-LNS co\-evolves destroy and repair operators in a large neighborhood search framework and models their complementarity via cooperative evaluation\[[32](https://arxiv.org/html/2606.00718#bib.bib40)\]\. E2OC formulates interdependent operators in multi\-objective evolutionary algorithms as sequential decision problems\[[22](https://arxiv.org/html/2606.00718#bib.bib41)\]\. MOTIF extends automated solver design from multi\-strategy and multi\-agent perspectives\[[11](https://arxiv.org/html/2606.00718#bib.bib7)\]\.
These studies demonstrate that LLM\-AHD can handle more complex algorithmic structures than single heuristics, but operator complementarity is primarily confined to algorithmic roles within the search framework\. In contrast, our work focuses on complementarity induced by the structure of the problem itself\. Operators in CoEvo\-AHD are tied to heterogeneous components of the solution, and their effectiveness depends on cross\-component interactions rather than workflow roles\. This positioning allows us to model problem\-structure\-induced complementarity through component\-specific populations, paired execution\-based evaluation, pairwise synergy scores, and cross\-component joint crossover\.
### 2\.3Bi\-Component Coupled CO: TTP and TPP
Many real\-world combinatorial optimization problems involve multiple interdependent subproblems\. We use the Traveling Thief Problem \(TTP\) and the Traveling Purchaser Problem \(TPP\) as representative bi\-component coupled CO benchmarks\. TTP couples the Traveling Salesman Problem with the 0–1 Knapsack Problem: routing decisions determine the visiting order and items collected, while item selection affects travel speed and cost\[[3](https://arxiv.org/html/2606.00718#bib.bib43),[21](https://arxiv.org/html/2606.00718#bib.bib44)\]\. TPP jointly involves market selection, purchasing decisions, and route optimization to minimize the sum of travel and purchasing costs\[[16](https://arxiv.org/html/2606.00718#bib.bib14)\]\.
Existing algorithms for TTP and TPP include staged heuristics, memetic algorithms, ant colony optimization, tabu search, branch\-and\-cut, and ALNS variants\[[7](https://arxiv.org/html/2606.00718#bib.bib8),[17](https://arxiv.org/html/2606.00718#bib.bib10),[5](https://arxiv.org/html/2606.00718#bib.bib9),[26](https://arxiv.org/html/2606.00718#bib.bib11),[27](https://arxiv.org/html/2606.00718#bib.bib12),[9](https://arxiv.org/html/2606.00718#bib.bib15),[19](https://arxiv.org/html/2606.00718#bib.bib16),[20](https://arxiv.org/html/2606.00718#bib.bib17),[1](https://arxiv.org/html/2606.00718#bib.bib18),[25](https://arxiv.org/html/2606.00718#bib.bib19),[2](https://arxiv.org/html/2606.00718#bib.bib21),[8](https://arxiv.org/html/2606.00718#bib.bib22),[13](https://arxiv.org/html/2606.00718#bib.bib20),[31](https://arxiv.org/html/2606.00718#bib.bib23),[10](https://arxiv.org/html/2606.00718#bib.bib25),[12](https://arxiv.org/html/2606.00718#bib.bib24)\]\. CoCo explicitly emphasizes coordination between routing and packing in TTP\[[18](https://arxiv.org/html/2606.00718#bib.bib13)\]\. However, most traditional methods rely on manually designed cross\-component coordination mechanisms, which are problem\-specific, hard to transfer, and require extensive tuning\. In contrast, CoEvo\-AHD leverages LLMs to automatically generate component\-level operators and selects complementary operator pairs through paired execution\-based evaluation and co\-evolution, reducing dependence on handcrafted rules and expert intervention\.
This positioning highlights that the novelty of CoEvo\-AHD lies not only in leveraging LLMs for heuristic generation, but also in explicitly modeling and exploiting "problem\-structure\-induced operator complementarity" for bi\-component coupled combinatorial optimization\.
## 3Methodology
### 3\.1Overview of the Framework
CoEvo\-AHD consists of four stages: initialization, collaborative evaluation, population management, and LLM\-driven evolution\. In the initialization stage, separate operator populations are constructed for the two decision components\. In the collaborative evaluation stage, pairs of component operators are jointly evaluated on training instances\. The population management stage prunes low\-performing operators, while the LLM\-driven evolution stage generates new operators through intra\-component mutation, intra\-component homogeneous crossover, and cross\-component collaborative joint crossover\. Together, these stages form a closed loop of generation, evaluation, feedback, and regeneration, enabling the heuristic logic produced by the LLM to be continuously improved under real optimization feedback\.
Figure 1:Overview of the CoEvo\-AHD framework\. The framework consists of four stages: initialization, collaborative evaluation, population management, and LLM\-driven evolution\. Two component\-specific operator populations are maintained and co\-evolved through pairwise evaluation, score update, pruning, mutation, homogeneous crossover, and cross\-component joint crossover\.
### 3\.2Initialization
For a bi\-component coupled optimization problem, we denote a complete solution as
x=\(xA,xB\),x=\(x^\{A\},x^\{B\}\),\(1\)wherexAx^\{A\}andxBx^\{B\}correspond to two heterogeneous but interdependent decision components\. CoEvo\-AHD initializes two component\-specific operator populations:
𝒫A=\{o1A,o2A,…,oNA\},𝒫B=\{o1B,o2B,…,oNB\}\.\\mathcal\{P\}^\{A\}=\\\{o^\{A\}\_\{1\},o^\{A\}\_\{2\},\\ldots,o^\{A\}\_\{N\}\\\},\\qquad\\mathcal\{P\}^\{B\}=\\\{o^\{B\}\_\{1\},o^\{B\}\_\{2\},\\ldots,o^\{B\}\_\{N\}\\\}\.\(2\)For TTP, the two populations correspond to route operators and packing operators\. For TPP, they correspond to tour operators and purchasing operators\.
The initial populations are constructed from two sources\. First, we include a small number of manually specified seed operators to provide valid executable starting points and basic search behavior\. Second, we use the LLM to generate additional operators under the required component interface\. Before entering the population, every generated operator must pass syntax validation, interface validation, bounded execution validation, and component\-feasibility validation\. Invalid operators are discarded and regenerated\.
In the implementation, each component operator returns only a candidate for its own component:
x~c=oic\(xA,xB,ℐ,ℳ\),c∈\{A,B\}\.\\widetilde\{x\}^\{c\}=o\_\{i\}^\{c\}\(x^\{A\},x^\{B\},\\mathcal\{I\},\\mathcal\{M\}\),\\qquad c\\in\\\{A,B\\\}\.\(3\)The shared information spaceℳ\\mathcal\{M\}is implemented as a mutable dictionary, namelyproblem\_data\[’shared\_info’\]\. Operators may update this dictionary by side effect, and subsequent component operators or the unified evaluator may read these shared fields when constructing candidate complete solutions\.
For each training instance, the framework also constructs an initial feasible solution
x0=\(x0A,x0B\)\.x\_\{0\}=\(x\_\{0\}^\{A\},x\_\{0\}^\{B\}\)\.\(4\)For TTP,x0Ax\_\{0\}^\{A\}is initialized by a TSP\-style tour construction procedure, andx0Bx\_\{0\}^\{B\}is initialized by a route\-aware greedy packing procedure\. For TPP,x0Ax\_\{0\}^\{A\}is initialized as a feasible market tour, andx0Bx\_\{0\}^\{B\}is initialized by reconstructing a purchasing plan over the visited markets\. If a generated candidate violates feasibility, the problem environment either repairs or reconstructs the related component, or rejects the candidate if feasibility cannot be restored\.
The individual operator scores and pairwise collaboration scores are initialized as
FiA=0,FjB=0,Sij=0,∀i,j\.F\_\{i\}^\{A\}=0,\\qquad F\_\{j\}^\{B\}=0,\\qquad S\_\{ij\}=0,\\quad\\forall i,j\.\(5\)The local bandit statistics used for operator selection are also initialized with empty reward histories\. These statistics are updated only after operators have been evaluated through complete\-solution search trajectories\.
### 3\.3Cooperative Evaluation
The cooperative evaluation stage estimates both the individual utility of each component operator and the complementarity between operators from different populations\. For each training instance, CoEvo\-AHD performs multiple independent restarts\. Each restart starts from a feasible initial solution and iteratively applies one operator from population𝒫A\\mathcal\{P\}^\{A\}and one operator from population𝒫B\\mathcal\{P\}^\{B\}within the same search trajectory\. Thus, operators are not evaluated in isolation, but through their contribution to the complete coupled solution\.
##### Local Operator Selection
During instance\-level evaluation, CoEvo\-AHD uses a local Thompson Sampling strategy to select one operator from each component population\. Operators with higher historical rewards are more likely to be selected, while newly generated or rarely used operators still retain exploration opportunities\. This produces a component\-operator pair\(oiA,ojB\)\(o\_\{i\}^\{A\},o\_\{j\}^\{B\}\)for the current restart\. The pair is then evaluated jointly under the complete objective function, allowing the framework to capture not only the quality of each operator but also their cross\-component compatibility\.
##### Alternating Component Optimization
Given a current solutionxt=\(xtA,xtB\)x\_\{t\}=\(x\_\{t\}^\{A\},x\_\{t\}^\{B\}\), the selected operators are invoked alternately\. Each operator receives the complete current solution, the problem instance, and the shared information memory, but returns only a candidate update for its own component\. The framework then combines the updated component with the unchanged counterpart to form a complete candidate solution\. Since the two components are coupled, the candidate is passed to the problem environment for repair, reconstruction, validation, and complete\-objective evaluation when necessary\. The candidate is accepted only if it improves the current complete solution or restores feasibility in infeasible cases\.
For TTP, this process alternates between route optimization and packing optimization\. A route operator proposes a new city permutation, which is accepted only if the resulting TTP objective improves under the current packing plan\. A packing operator then proposes a new binary packing plan, which is checked against the knapsack capacity and evaluated together with the current route\. After accepted improvements, a lightweight item\-flip post\-optimization step is applied to further refine the packing component\. For TPP, the same procedure alternates between tour operators and purchasing operators, with the environment ensuring demand satisfaction and purchasing feasibility\.
##### Shared Information Memory
To support cross\-component coordination, CoEvo\-AHD maintains a shared information memory during each search trajectory\. In our implementation, this memory is realized as the mutable dictionaryproblem\_data\[’shared\_info’\]\. Component operators may write structural signals into this memory, and subsequent operators may read them as soft search guidance\. For example, in TTP, route operators may record city positions, load profiles, heavy\-item cities, or segment\-level priorities, which can then guide packing operators\. In TPP, tour operators may provide market insertion, deletion, or replacement cues, while purchasing operators may expose demand gaps or product\-level marginal costs\.
The shared memory does not directly modify the other component and does not override the acceptance rule\. Instead, it provides verifiable cues for candidate generation\. The final adoption of any shared suggestion is still determined by feasibility checks and the complete coupled objective\. This design preserves the modularity of component\-level operators while allowing search signals from one component to influence the optimization direction of the other\.
##### Tool\-Based Problem Environment
CoEvo\-AHD further provides a tool\-based problem environment to avoid requiring LLM\-generated operators to repeatedly implement low\-level problem\-specific routines\. The environment exposes stable and frequently used primitives, such as objective evaluation, feasibility checking, repair or reconstruction, greedy construction, structural analysis, and local move evaluation\. In the TTP implementation, for example, the environment provides callable interfaces such as objective evaluation, fast 2\-opt delta evaluation, and route\-aware greedy packing\. These tools allow LLM\-generated operators to focus on high\-level neighborhood design and component coordination, while relying on trusted computational kernels for expensive or error\-prone operations\.
##### Reward and Statistics Update
After each restart, CoEvo\-AHD computes the reward according to the improvement obtained by the selected operator pair over the initial solution of that restart\. The reward is used to update three types of statistics: the individual score of the selected operator in𝒫A\\mathcal\{P\}^\{A\}, the individual score of the selected operator in𝒫B\\mathcal\{P\}^\{B\}, and the pairwise synergy score of the selected cross\-component operator pair\. The same reward is also recorded in the local bandit statistics\. These statistics are later used for local operator selection, population pruning, and parent selection in the LLM\-driven evolution
### 3\.4Population Management
After collaborative evaluation, the framework ranks the operator populations of the two components separately according to their individual operator scores\. For each componentc∈\{A,B\}c\\in\\\{A,B\\\}, the topN−MN\-Moperators are retained:
𝒫c←TopN−M\(𝒫c;Fc\),c∈\{A,B\},\\mathcal\{P\}^\{c\}\\leftarrow\\mathrm\{Top\}\_\{N\-M\}\(\\mathcal\{P\}^\{c\};F^\{c\}\),\\quad c\\in\\\{A,B\\\},\(6\)while the lowest\-rankedMMoperators are pruned\. The multi\-armed bandit statistics associated with the pruned operators are removed accordingly\. This process preserves high\-performing operators while freeing population capacity for new operators generated by the LLM\.
### 3\.5LLM\-Driven Evolution
During the evolutionary stage, the LLM serves as a mutation and recombination operator in the code space\. To refill the vacancies created by pruning, the framework employs three types of evolutionary operations: intra\-component mutation, intra\-component homogeneous crossover, and cross\-component collaborative joint crossover\.
##### Mutation
Mutation generates a new operator from a single parent operator:
o~c=Φmut\(oic,rank\(oic\),𝒫prompt\),c∈\{A,B\},\\widetilde\{o\}^\{c\}=\\Phi\_\{\\mathrm\{mut\}\}\(o^\{c\}\_\{i\},\\mathrm\{rank\}\(o^\{c\}\_\{i\}\),\\mathcal\{P\}\_\{\\mathrm\{prompt\}\}\),\\quad c\\in\\\{A,B\\\},\(7\)whereΦmut\\Phi\_\{\\mathrm\{mut\}\}denotes the LLM, and𝒫prompt\\mathcal\{P\}\_\{\\mathrm\{prompt\}\}contains the problem description, component interface, available tools, parent code, and evaluation feedback\. For high\-ranking parents, mutation is biased toward parameter calibration and stability improvement; for low\-ranking parents, mutation is encouraged to introduce new search mechanisms\.
##### Homogeneous Crossover
Homogeneous crossover is performed within the population of the same component\. The framework selects two parent operators from the same component population and asks the LLM to recombine their search logic:
o~c=Φhomo\(oic,ojc,𝒫prompt\),c∈\{A,B\}\.\\widetilde\{o\}^\{c\}=\\Phi\_\{\\mathrm\{homo\}\}\(o^\{c\}\_\{i\},o^\{c\}\_\{j\},\\mathcal\{P\}\_\{\\mathrm\{prompt\}\}\),\\quad c\\in\\\{A,B\\\}\.\(8\)Parent selection follows a global UCB1 rule\. For a candidate parentoio\_\{i\}, its UCB1 value is defined as
UCB1\(oi\)=r¯i\+c0logNtotni,\\mathrm\{UCB1\}\(o\_\{i\}\)=\\bar\{r\}\_\{i\}\+c\_\{0\}\\sqrt\{\\frac\{\\log N\_\{\\mathrm\{tot\}\}\}\{n\_\{i\}\}\},\(9\)wherer¯i\\bar\{r\}\_\{i\}is the average reward,nin\_\{i\}is the number of selections,NtotN\_\{\\mathrm\{tot\}\}is the total number of selections over the candidate set, andc0c\_\{0\}is the exploration coefficient\. Operators that have not been selected before are prioritized for exploration\.
##### Collaborative Joint Crossover
Collaborative joint crossover selects the best\-performing pair of component operators according to the paired collaboration score:
\(i⋆,j⋆\)=argmaxi,jSij\.\(i^\{\\star\},j^\{\\star\}\)=\\arg\\max\_\{i,j\}S\_\{ij\}\.\(10\)The LLM then rewrites this operator pair as a unified entity:
\(o~A,o~B\)=Φjoint\(oi⋆A,oj⋆B,𝒫prompt\)\.\(\\widetilde\{o\}^\{A\},\\widetilde\{o\}^\{B\}\)=\\Phi\_\{\\mathrm\{joint\}\}\(o^\{A\}\_\{i^\{\\star\}\},o^\{B\}\_\{j^\{\\star\}\},\\mathcal\{P\}\_\{\\mathrm\{prompt\}\}\)\.\(11\)This mechanism encourages the newly generated component operators to share a consistent communication protocol, search assumptions, and complementary logic, thereby improving the coordination capability between paired components\.
## 4Experiments
To validate the effectiveness of the proposed CoEvo\-AHD framework on coupled combinatorial optimization problems, we evaluate it on TTP and TPP, both of which involve two interdependent decision\-making subproblems: route planning and resource selection\. In TTP, the visiting route determines the time cost of carrying selected items, while the packing decisions affect the travel speed through the knapsack weight\. Similarly, in TPP, procurement decisions and the visiting order jointly determine the overall cost\.
During the evolutionary phase, we use randomly generated instances\. At test time, the learned operators are evaluated on a separate set of randomly generated instances to assess their generalization ability\. To mitigate the effect of stochasticity, we conduct three independent evolutionary runs for each task, each for 200 generations\. The computational budget during evolution is limited to 100 iterations or 60 seconds of runtime\. In the final testing phase, the best evolved pair of operators is applied to test instances under a fixed budget of 500 iterations or 100 seconds, and the resulting solution quality is used to evaluate the effectiveness of the learned operators\.
##### Setting
For the large language model used to generate and evolve operators, we adopt Qwen3\.5\-Plus\. For the two co\-evolving populations, we maintain a population size of N=5\. During population management, the two individuals with the lowest fitness in each population are removed\. In the evaluation process, each instance is run with three restarts by default\.
For the TTP experiments, the training instances are automatically generated by an instance generator\. By default, we use 16 training instances, each consisting of 50 cities, where each non\-depot city is associated with one item\. The knapsack data type is set to bounded\-strongly\-corr\. CoEvo\-AHD maintains two operator populations, corresponding to the route optimization operator and the pack optimization operator\.
For the TPP experiments, the training and test instances are automatically generated in the TPPLIB\-compatible Class 3 format\[[23](https://arxiv.org/html/2606.00718#bib.bib38)\], following the Euclidean instance generation scheme introduced by Laporte et al\.\[[13](https://arxiv.org/html/2606.00718#bib.bib20)\]\. By default, we generate 10 instances for each of 11 city\-product scales, ranging from20×2020\\times 20to150×150150\\times 150, and split them into training and test sets with a ratio of 3:7\. Each instance has unit product demand and unit supply quantity, with product availability probability set to 0\.8 and prices sampled from\[1,100\]\[1,100\]\. CoEvo\-AHD maintains two operator populations, corresponding to the tour optimization operator and the purchasing optimization operator\. All the initial populations are constructed from both manually designed seed operators and LLM\-generated operators\.
##### Baseline
To evaluate the performance of CoEvo\-AHD, we compare it against several classical baselines\. For TTP, we select three top\-performing algorithms from the literature: MATLS\[[17](https://arxiv.org/html/2606.00718#bib.bib10)\], S5\[[6](https://arxiv.org/html/2606.00718#bib.bib37)\], and CoCo\[[18](https://arxiv.org/html/2606.00718#bib.bib13)\]\. For TPP, we use DMD\-ATA \(ACO\)\[[2](https://arxiv.org/html/2606.00718#bib.bib21)\], TA\[[8](https://arxiv.org/html/2606.00718#bib.bib22)\], and ALNS\[[12](https://arxiv.org/html/2606.00718#bib.bib24)\]as the three baseline methods\.
### 4\.1Experimental Results
Table[1](https://arxiv.org/html/2606.00718#S4.T1)reports the average objective values achieved by different methods on the TTP benchmark instances, where higher values indicate better solution quality\. CoEvo\-AHD exhibits strong performance on small\- and medium\-scale instances: it achieves the best results on TTP20 and TTP50, with objective values of 583\.10 and 1730\.60, respectively, outperforming all baselines\. This suggests that the dual\-population co\-evolutionary mechanism can effectively capture the coupling between route planning and packing decisions, enabling the discovery of high\-quality cooperative operator pairs in relatively small search spaces\.
On larger instances, namely TTP100 and TTP200, CoEvo\-AHD obtains the second\-best results, trailing only CoCo\. In terms of overall average performance, CoEvo\-AHD achieves an average objective value of 3184\.36, outperforming MATLS and S5 by approximately 2\.38% and 2\.19%, respectively, while remaining below CoCo, which obtains 3284\.46\. These results indicate that CoEvo\-AHD is highly competitive across most problem scales, particularly on small\- and medium\-sized instances, where it can identify superior solutions\. Meanwhile, the results on large\-scale TTP instances suggest that there remains room for further improving search depth and robustness\.
Table[2](https://arxiv.org/html/2606.00718#S4.T2)presents the experimental results on the TPP benchmark instances, where lower objective values indicate better solution quality\. Unlike on TTP, CoEvo\-AHD demonstrates a more pronounced overall advantage on TPP\. Specifically, CoEvo\-AHD achieves the best results on five instance scales, including50×15050\\times 150,100×100100\\times 100,100×150100\\times 150,150×100150\\times 100, and150×150150\\times 150, and obtains the second\-best results on three additional scales\.
The advantage of CoEvo\-AHD is particularly evident on larger\-scale instances\. For example, on150×100150\\times 100and150×150150\\times 150, CoEvo\-AHD achieves objective values of 1749\.00 and 2201\.71, respectively, substantially outperforming traditional heuristic methods\. The overall average results further confirm this trend: CoEvo\-AHD achieves an average objective value of 1850\.77, outperforming DMD\-ATA \(ACO\), TA, and ALNS\. Compared with the second\-best method, TA, which obtains 1903\.35, CoEvo\-AHD reduces the objective value by approximately 2\.76%; compared with DMD\-ATA \(ACO\) and ALNS, it achieves reductions of approximately 4\.11% and 11\.42%, respectively\.
These results indicate that CoEvo\-AHD can effectively exploit the synergy between routing operators and selection operators in TPP, making it particularly suitable for larger instances where route selection and procurement decisions are more strongly coupled\.
Table 1:Average objective values on TTP benchmark\.Higheris better\. The best result is highlighted with gray background, and the second\-best is underlined\.Table 2:Average objective values on TPP benchmark instances\.Loweris better\. The best result is highlighted with gray background, and the second\-best is underlined\.
### 4\.2Ablation Studies
To validate the contribution of each component in CoEvo\-AHD, we conduct ablation studies on the TTP50 and TPP50×5050\\times 50datasets\. We take the full CoEvo\-AHD framework as the reference and compare it with several degraded variants\.
Table[3](https://arxiv.org/html/2606.00718#S4.T3)reports the ablation results of CoEvo\-AHD on the TTP50 and TPP50×5050\\times 50instances\. For TTP, higher objective values indicate better solution quality, whereas for TPP, lower objective values are preferred\. We examine the performance changes when evolving only a single component\-specific population and when removing access to the tool\-augmented problem environment\. Specifically, for TTP, Route/Tour\-only evolution corresponds to evolving only the route\-operator population, while Packing/Purchasing\-only evolution corresponds to evolving only the packing\-operator population\. For TPP, Route/Tour\-only evolution corresponds to evolving only the tour\-operator population, while Packing/Purchasing\-only evolution corresponds to evolving only the purchasing\-operator population\. The variant w/o tool\-augmented environment indicates that the LLM\-generated operators are not provided with access to the tool\-augmented problem environment during evolution\.
As shown in the table, the full CoEvo\-AHD framework achieves the best performance on both tasks, reaching 1730\.60 on TTP50 and 1623\.72 on TPP50×5050\\times 50\. When only a single component\-specific population is evolved, performance degrades substantially in all cases\. For TTP, Route/Tour\-only evolution and Packing/Purchasing\-only evolution decrease to 1651\.69 and 1680\.37, respectively, indicating that optimizing either the route or packing operators alone is insufficient to fully capture the interaction between routing and packing decisions\. For TPP, the degradation caused by single\-population evolution is even more pronounced: the objective values of Route/Tour\-only evolution and Packing/Purchasing\-only evolution increase to 1803\.18 and 1789\.00, corresponding to deteriorations of approximately 11\.05% and 10\.18% relative to the full framework\. This suggests that, in the Traveling Purchaser Problem, the coupling between tour and purchasing decisions plays a critical role in overall solution quality, and evolving only one decision component cannot yield effective cooperative improvements\.
In addition, removing access to the tool\-augmented problem environment also leads to performance degradation\. On TTP50, w/o tool\-augmented environment obtains 1634\.79, corresponding to a decrease of approximately 5\.54% compared with the full CoEvo\-AHD framework\. Its performance is even worse than both single\-population variants, suggesting that the high\-frequency core operations encapsulated in the tool\-augmented problem environment can substantially improve the effectiveness and reliability of LLM\-generated operators\. On TPP50×5050\\times 50, w/o tool\-augmented environment obtains 1671\.47, corresponding to a deterioration of approximately 2\.94% relative to the full framework\. Although this variant still outperforms the single\-population variants, its performance drop indicates that standardized tool interfaces help the LLM avoid repeatedly implementing inefficient or error\-prone problem\-specific computations, thereby improving the quality of operators generated during evolution\.
Table 3:Ablation study of the key components in CoEvo\-AHD\. The best results are highlighted inbold\.
## 5Conclusion
In this paper, we introduced CoEvo\-AHD, an LLM\-driven dual\-population co\-evolutionary framework for automated heuristic design in coupled combinatorial optimization problems\. CoEvo\-AHD co\-evolves complementary operator populations, such as route and packing operators for the Traveling Thief Problem and tour and purchasing operators for the Traveling Purchaser Problem\. Through cooperative evaluation, pairwise synergy scoring, and cross\-component joint crossover, CoEvo\-AHD effectively captures cross\-population interactions and discovers synergistic heuristic combinations\. For future work, we plan to extend CoEvo\-AHD to problems with more than two coupled decision components and further improve its scalability, generalization, and on larger instances\.
## References
- \[1\]F\. F\. Boctor, G\. Laporte, and J\. Renaud\(2003\)Heuristics for the traveling purchaser problem\.Computers & Operations Research30\(4\),pp\. 491–504\.External Links:[Document](https://dx.doi.org/10.1016/S0305-0548%2802%2900020-5)Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1)\.
- \[2\]B\. Bontoux and D\. Feillet\(2008\)Ant colony optimization for the traveling purchaser problem\.Computers & Operations Research35\(2\),pp\. 628–637\.External Links:[Document](https://dx.doi.org/10.1016/j.cor.2006.03.023)Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1),[§4](https://arxiv.org/html/2606.00718#S4.SS0.SSS0.Px2.p1.1)\.
- \[3\]M\. R\. Bonyadi, Z\. Michalewicz, and L\. Barone\(2013\)The travelling thief problem: the first step in the transition from theoretical problems to realistic problems\.In2013 IEEE Congress on Evolutionary Computation,pp\. 1037–1044\.External Links:[Document](https://dx.doi.org/10.1109/CEC.2013.6557681)Cited by:[§1](https://arxiv.org/html/2606.00718#S1.p3.1),[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p1.1)\.
- \[4\]P\. V\. T\. Dat, L\. Doan, and H\. T\. T\. Binh\(2025\)HSEvo: elevating automatic heuristic design with diversity\-driven harmony search and genetic algorithm using LLMs\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.39,pp\. 26931–26938\.External Links:[Document](https://dx.doi.org/10.1609/aaai.v39i25.34898)Cited by:[§2\.1](https://arxiv.org/html/2606.00718#S2.SS1.p1.1)\.
- \[5\]M\. El Yafrani and B\. Ahiod\(2016\)Population\-based vs\. single\-solution heuristics for the travelling thief problem\.InProceedings of the Genetic and Evolutionary Computation Conference 2016,GECCO ’16,New York, NY, USA,pp\. 317–324\.External Links:[Document](https://dx.doi.org/10.1145/2908812.2908847),ISBN 9781450342063Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1)\.
- \[6\]M\. El Yafrani and B\. Ahiod\(2018\)Efficiently solving the traveling thief problem using hill climbing and simulated annealing\.Information Sciences432,pp\. 231–244\.External Links:[Document](https://dx.doi.org/10.1016/j.ins.2017.12.011)Cited by:[§4](https://arxiv.org/html/2606.00718#S4.SS0.SSS0.Px2.p1.1)\.
- \[7\]H\. Faulkner, S\. Polyakovskiy, T\. Schultz, and M\. Wagner\(2015\)Approximate approaches to the traveling thief problem\.InProceedings of the Genetic and Evolutionary Computation Conference,pp\. 385–392\.Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1)\.
- \[8\]M\. C\. Goldbarg, L\. B\. Bagi, and E\. F\. G\. Goldbarg\(2009\)Transgenetic algorithm for the traveling purchaser problem\.European Journal of Operational Research199\(1\),pp\. 36–45\.External Links:[Document](https://dx.doi.org/10.1016/j.ejor.2008.10.027)Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1),[§4](https://arxiv.org/html/2606.00718#S4.SS0.SSS0.Px2.p1.1)\.
- \[9\]B\. L\. Golden, L\. Levy, and R\. Dahl\(1981\)Two generalizations of the traveling salesman problem\.Omega9\(4\),pp\. 439–441\.Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1)\.
- \[10\]T\. Kapancioglu and R\. Bernardino\(2025\)An iterated local search algorithm for the traveling purchaser problem\.European Journal of Operational Research324\(3\),pp\. 759–772\.External Links:[Document](https://dx.doi.org/10.1016/j.ejor.2025.02.024)Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1)\.
- \[11\]N\. V\. T\. Kiet, T\. Dao, C\. D\. Tran, and H\. T\. T\. Binh\(2026\)MOTIF: multi\-strategy optimization via turn\-based interactive framework\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.40,pp\. 37000–37008\.External Links:[Document](https://dx.doi.org/10.1609/aaai.v40i43.41028)Cited by:[§1](https://arxiv.org/html/2606.00718#S1.p4.1),[§2\.2](https://arxiv.org/html/2606.00718#S2.SS2.p1.1)\.
- \[12\]I\. Kucukoglu, P\. Vansteenwegen, and D\. Cattrysse\(2024\)The traveling purchaser problem for perishable foods\.Computers & Industrial Engineering195,pp\. 110424\.Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1),[§4](https://arxiv.org/html/2606.00718#S4.SS0.SSS0.Px2.p1.1)\.
- \[13\]G\. Laporte, J\. Riera\-Ledesma, and J\. Salazar\-González\(2003\)A branch\-and\-cut algorithm for the undirected traveling purchaser problem\.Operations Research51\(6\),pp\. 940–951\.Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1),[§4](https://arxiv.org/html/2606.00718#S4.SS0.SSS0.Px1.p3.3)\.
- \[14\]F\. Liu, Y\. Liu, Q\. Zhang, X\. Tong, and M\. Yuan\(2026\)EoH\-S: evolution of heuristic set using LLMs for automated heuristic design\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.40,pp\. 37090–37098\.External Links:[Document](https://dx.doi.org/10.1609/aaai.v40i43.41038)Cited by:[§1](https://arxiv.org/html/2606.00718#S1.p4.1),[§2\.2](https://arxiv.org/html/2606.00718#S2.SS2.p1.1)\.
- \[15\]F\. Liu, X\. Tong, M\. Yuan, X\. Lin, F\. Luo, Z\. Wang, Z\. Lu, and Q\. Zhang\(2024\)Evolution of heuristics: towards efficient automatic algorithm design using large language model\.InProceedings of the 41st International Conference on Machine Learning,Proceedings of Machine Learning Research, Vol\.235,pp\. 32201–32223\.Cited by:[§1](https://arxiv.org/html/2606.00718#S1.p1.1),[§2\.1](https://arxiv.org/html/2606.00718#S2.SS1.p1.1)\.
- \[16\]D\. Manerba, R\. Mansini, and J\. Riera\-Ledesma\(2017\)The traveling purchaser problem and its variants\.European Journal of Operational Research259\(1\),pp\. 1–18\.External Links:[Document](https://dx.doi.org/10.1016/j.ejor.2016.12.017)Cited by:[§1](https://arxiv.org/html/2606.00718#S1.p3.1),[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p1.1)\.
- \[17\]Y\. Mei, X\. Li, F\. Salim, and X\. Yao\(2014\)Improving efficiency of heuristics for the large scale traveling thief problem\.InProceedings of the Asia\-Pacific Conference on Simulated Evolution and Learning,pp\. 631–643\.Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1),[§4](https://arxiv.org/html/2606.00718#S4.SS0.SSS0.Px2.p1.1)\.
- \[18\]M\. Namazi, M\. A\. H\. Newton, C\. Sanderson, and A\. Sattar\(2023\)Solving travelling thief problems using coordination based methods\.Journal of Heuristics29\(4–6\),pp\. 487–544\.External Links:[Document](https://dx.doi.org/10.1007/s10732-023-09518-7)Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1),[§4](https://arxiv.org/html/2606.00718#S4.SS0.SSS0.Px2.p1.1)\.
- \[19\]H\. L\. Ong\(1982\)Approximate algorithms for the traveling purchaser problem\.Operations Research Letters1\(5\),pp\. 201–205\.Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1)\.
- \[20\]W\. L\. Pearn and R\. C\. Chien\(1998\)Improved solutions for the traveling purchaser problem\.Computers & Operations Research25\(11\),pp\. 879–885\.Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1)\.
- \[21\]S\. Polyakovskiy, M\. R\. Bonyadi, M\. Wagner, Z\. Michalewicz, and F\. Neumann\(2014\)A comprehensive benchmark set and heuristics for the traveling thief problem\.InGECCO 2014: Proceedings of the 2014 Genetic and Evolutionary Computation Conference,pp\. 477–484\.External Links:[Document](https://dx.doi.org/10.1145/2576768.2598249),ISBN 9781450326629Cited by:[§1](https://arxiv.org/html/2606.00718#S1.p3.1),[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p1.1)\.
- \[22\]J\. Qiu, X\. Chen, L\. Ge, L\. Lin, Z\. Lu, and Q\. Zhang\(2026\)Evolving interdependent operators with large language models for multi\-objective combinatorial optimization\.arXiv preprint arXiv:2601\.17899\.External Links:2601\.17899Cited by:[§1](https://arxiv.org/html/2606.00718#S1.p4.1),[§2\.2](https://arxiv.org/html/2606.00718#S2.SS2.p1.1)\.
- \[23\]J\. Riera\-Ledesma\(2012\)TPPLIB\.Note:[https://jriera\.webs\.ull\.es/TPP\.htm](https://jriera.webs.ull.es/TPP.htm)Benchmark instances for the Traveling Purchaser Problem, accessed 2026\-05\-07Cited by:[§4](https://arxiv.org/html/2606.00718#S4.SS0.SSS0.Px1.p3.3)\.
- \[24\]B\. Romera\-Paredes, M\. Barekatain, A\. Novikov, M\. Balog, M\. P\. Kumar, E\. Dupont, F\. J\. R\. Ruiz, J\. S\. Ellenberg, P\. Wang, O\. Fawzi,et al\.\(2024\)Mathematical discoveries from program search with large language models\.Nature625\(7995\),pp\. 468–475\.External Links:[Document](https://dx.doi.org/10.1038/s41586-023-06924-6)Cited by:[§1](https://arxiv.org/html/2606.00718#S1.p1.1),[§2\.1](https://arxiv.org/html/2606.00718#S2.SS1.p1.1)\.
- \[25\]S\. Voß\(1996\)Dynamic tabu search strategies for the traveling purchaser problem\.Annals of Operations Research63,pp\. 253–275\.Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1)\.
- \[26\]M\. Wagner\(2016\)Stealing items more efficiently with ants: a swarm intelligence approach to the travelling thief problem\.InProceedings of the International Conference on Swarm Intelligence,pp\. 273–281\.Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1)\.
- \[27\]J\. Wu, S\. Polyakovskiy, M\. Wagner, and F\. Neumann\(2020\)Exact approaches for the travelling thief problem\.Algorithmica82,pp\. 2090–2111\.Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1)\.
- \[28\]C\. Yang, X\. Wang, Y\. Lu, H\. Liu, Q\. V\. Le, D\. Zhou, and X\. Chen\(2024\)Large Language Models as Optimizers\.InThe Twelfth International Conference on Learning Representations,Cited by:[§1](https://arxiv.org/html/2606.00718#S1.p1.1)\.
- \[29\]S\. Yao, F\. Liu, X\. Lin, Z\. Lu, Z\. Wang, and Q\. Zhang\(2025\)Multi\-objective evolution of heuristic using large language model\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.39,pp\. 27144–27152\.External Links:[Document](https://dx.doi.org/10.1609/aaai.v39i25.34922)Cited by:[§2\.1](https://arxiv.org/html/2606.00718#S2.SS1.p1.1)\.
- \[30\]H\. Ye, J\. Wang, Z\. Cao, F\. Berto, C\. Hua, H\. Kim, J\. Park, and G\. Song\(2024\)ReEvo: large language models as hyper\-heuristics with reflective evolution\.InAdvances in Neural Information Processing Systems,Vol\.37\.External Links:[Link](https://papers.nips.cc/paper_files/paper/2024/hash/4ced59d480e07d290b6f29fc8798f195-Abstract-Conference.html)Cited by:[§1](https://arxiv.org/html/2606.00718#S1.p1.1),[§2\.1](https://arxiv.org/html/2606.00718#S2.SS1.p1.1)\.
- \[31\]H\. Yuan, R\. Zhu, W\. Yang, S\. Song, K\. You, W\. Fan, and C\. L\. P\. Chen\(2026\)Deep reinforcement learning for traveling purchaser problems\.IEEE Transactions on Emerging Topics in Computational Intelligence10\(1\),pp\. 425–439\.External Links:[Document](https://dx.doi.org/10.1109/TETCI.2025.3581113)Cited by:[§2\.3](https://arxiv.org/html/2606.00718#S2.SS3.p2.1)\.
- \[32\]B\. Zhao, H\. Wang, and L\. Zeng\(2026\)G\-LNS: generative large neighborhood search for LLM\-based automatic heuristic design\.arXiv preprint arXiv:2602\.08253\.External Links:2602\.08253Cited by:[§1](https://arxiv.org/html/2606.00718#S1.p4.1),[§2\.2](https://arxiv.org/html/2606.00718#S2.SS2.p1.1)\.
- \[33\]Z\. Zheng, Z\. Xie, Z\. Wang, and B\. Hooi\(2025\)Monte carlo tree search for comprehensive exploration in LLM\-based automatic heuristic design\.InProceedings of the 42nd International Conference on Machine Learning,Proceedings of Machine Learning Research, Vol\.267,pp\. 78338–78373\.External Links:[Link](https://proceedings.mlr.press/v267/zheng25o.html)Cited by:[§2\.1](https://arxiv.org/html/2606.00718#S2.SS1.p1.1)\.
## Appendix AAdditional Related Work and Positioning
This appendix provides additional discussion on how CoEvo\-AHD differs from existing LLM\-driven automated heuristic design methods and multi\-operator optimization frameworks\.
Existing LLM\-AHD methods mainly generate and evolve heuristic functions, construction rules, local\-search operators, or algorithmic strategies\. Their operator complementarity is usually defined at the level of algorithmic roles, such as construction versus improvement, destroy versus repair, or different search policies\. In contrast, CoEvo\-AHD studies complementarity induced by the structure of the optimization problem itself\. Specifically, each operator population is tied to one decision component of the complete solution, and an operator’s utility is evaluated through its interaction with the other component\.
For TTP, the two decision components are routing and packing\. A route move changes the transportation cost of selected items, while a packing decision changes the effective cost landscape of route modifications\. For TPP, the two decision components are market\-route selection and purchasing\. A route modification changes the feasible set of purchasing choices, while a purchasing decision changes the marginal value of visiting or removing markets\. Therefore, the quality of a component operator cannot be reliably assessed in isolation\.
CoEvo\-AHD is designed around this relational nature of operator utility\. It maintains component\-specific populations, evaluates selected operator pairs through complete\-solution trajectories, records pair\-level collaboration scores, and uses cross\-component joint crossover to generate mutually compatible operators\. These mechanisms distinguish CoEvo\-AHD from methods that evolve a single heuristic, a homogeneous operator set, or operators tied only to search workflow roles\.
## Appendix BProblem Formulations
This section provides the mathematical formulations of the two coupled combinatorial optimization problems used to instantiate CoEvo\-AHD\. The Traveling Purchaser Problem \(TPP\) couples market selection, routing, and purchasing decisions, whereas the Traveling Thief Problem \(TTP\) couples routing and packing decisions through a load\-dependent travel speed\.
### B\.1Traveling Purchaser Problem
The Traveling Purchaser Problem \(TPP\) generalizes the traveling salesman problem by jointly considering market selection, route construction, and product purchasing\. Let0denote the depot,N=\{1,…,n\}N=\\\{1,\\ldots,n\\\}denote the set of markets,K=\{1,…,m\}K=\\\{1,\\ldots,m\\\}denote the set of products, andV=N∪\{0\}V=N\\cup\\\{0\\\}\. For each arc\(i,j\)\(i,j\)withi,j∈Vi,j\\in Vandi≠ji\\neq j, letcijc\_\{ij\}be the travel cost\. For marketi∈Ni\\in Nand productk∈Kk\\in K, letpikp\_\{ik\}be the unit purchase price,uiku\_\{ik\}be the available supply, anddkd\_\{k\}be the demand\.
We define binary routing variablesxijx\_\{ij\}, binary market\-visit variablesyiy\_\{i\}, and continuous purchasing variablesqikq\_\{ik\}as follows:
xij=\{1,if the route travels directly fromitoj,0,otherwise,yi=\{1,if marketiis visited,0,otherwise,x\_\{ij\}=\\begin\{cases\}1,&\\text\{if the route travels directly from \}i\\text\{ to \}j,\\\\ 0,&\\text\{otherwise,\}\\end\{cases\}\\quad y\_\{i\}=\\begin\{cases\}1,&\\text\{if market \}i\\text\{ is visited,\}\\\\ 0,&\\text\{otherwise,\}\\end\{cases\}and
qik≥0,i∈N,k∈K\.q\_\{ik\}\\geq 0,\\quad i\\in N,\\ k\\in K\.
A standard mixed\-integer formulation of TPP is:
min\\displaystyle\\min\\quad∑i,j∈Vi≠jcijxij\+∑i∈N∑k∈Kpikqik\\displaystyle\\sum\_\{\\begin\{subarray\}\{c\}i,j\\in V\\\\ i\\neq j\\end\{subarray\}\}c\_\{ij\}x\_\{ij\}\+\\sum\_\{i\\in N\}\\sum\_\{k\\in K\}p\_\{ik\}q\_\{ik\}\(12\)s\.t\.∑j∈Nx0j=1,\\displaystyle\\sum\_\{j\\in N\}x\_\{0j\}=1,\(13\)∑i∈Nxi0=1,\\displaystyle\\sum\_\{i\\in N\}x\_\{i0\}=1,\(14\)∑j∈Vj≠ixij=yi,\\displaystyle\\sum\_\{\\begin\{subarray\}\{c\}j\\in V\\\\ j\\neq i\\end\{subarray\}\}x\_\{ij\}=y\_\{i\},∀i∈N,\\displaystyle\\forall i\\in N,\(15\)∑j∈Vj≠ixji=yi,\\displaystyle\\sum\_\{\\begin\{subarray\}\{c\}j\\in V\\\\ j\\neq i\\end\{subarray\}\}x\_\{ji\}=y\_\{i\},∀i∈N,\\displaystyle\\forall i\\in N,\(16\)∑i∈Nqik=dk,\\displaystyle\\sum\_\{i\\in N\}q\_\{ik\}=d\_\{k\},∀k∈K,\\displaystyle\\forall k\\in K,\(17\)0≤qik≤uikyi,\\displaystyle 0\\leq q\_\{ik\}\\leq u\_\{ik\}y\_\{i\},∀i∈N,k∈K,\\displaystyle\\forall i\\in N,\\ k\\in K,\(18\)∑i,j∈Si≠jxij≤\|S\|−1,\\displaystyle\\sum\_\{\\begin\{subarray\}\{c\}i,j\\in S\\\\ i\\neq j\\end\{subarray\}\}x\_\{ij\}\\leq\|S\|\-1,∀S⊆N,\|S\|≥2,\\displaystyle\\forall S\\subseteq N,\\ \|S\|\\geq 2,\(19\)xij∈\{0,1\},\\displaystyle x\_\{ij\}\\in\\\{0,1\\\},∀i,j∈V,i≠j,\\displaystyle\\forall i,j\\in V,\\ i\\neq j,\(20\)yi∈\{0,1\},\\displaystyle y\_\{i\}\\in\\\{0,1\\\},∀i∈N\.\\displaystyle\\forall i\\in N\.\(21\)
Constraints \([13](https://arxiv.org/html/2606.00718#A2.E13)\)–\([14](https://arxiv.org/html/2606.00718#A2.E14)\) ensure that the route starts and ends at the depot\. Constraints \([15](https://arxiv.org/html/2606.00718#A2.E15)\) and \([16](https://arxiv.org/html/2606.00718#A2.E16)\) link market visits with routing decisions\. Constraint \([17](https://arxiv.org/html/2606.00718#A2.E17)\) enforces exact demand satisfaction, while Constraint \([18](https://arxiv.org/html/2606.00718#A2.E18)\) ensures that products can only be purchased from visited markets and cannot exceed available supply\. Constraint \([19](https://arxiv.org/html/2606.00718#A2.E19)\) eliminates cycles disconnected from the depot\. Since unvisited markets have zero in\-degree and out\-degree by Constraints \([15](https://arxiv.org/html/2606.00718#A2.E15)\)–\([16](https://arxiv.org/html/2606.00718#A2.E16)\), the subtour constraint remains valid for selected\-market routing\.
### B\.2Traveling Thief Problem
The Traveling Thief Problem \(TTP\) couples the Traveling Salesman Problem with the Knapsack Problem\. Given a set of cities, a set of items, a knapsack capacity, a maximum speed, a minimum speed, and a renting rate, the decision maker needs to determine a closed tour visiting all cities and decide which items to pick, so as to maximize the difference between collected item profit and travel renting cost\.
Let0denote the starting city,N=\{1,…,n\}N=\\\{1,\\ldots,n\\\}denote the remaining cities,V=N∪\{0\}V=N\\cup\\\{0\\\}denote the set of all cities, andJ=\{1,…,m\}J=\\\{1,\\ldots,m\\\}denote the set of items\. For anyi,j∈Vi,j\\in Vwithi≠ji\\neq j, letcijc\_\{ij\}be the travel distance from cityiito cityjj\. For itemk∈Jk\\in J, letpkp\_\{k\}denote its profit,wkw\_\{k\}denote its weight, andak∈Na\_\{k\}\\in Ndenote the city where it is located\. The knapsack capacity isWW, the maximum and minimum speeds arevmaxv\_\{\\max\}andvminv\_\{\\min\}, respectively, and the renting rate isRR\.
The routing decision is represented by a city permutation
π=\(π0,π1,…,πn\),\\pi=\(\\pi\_\{0\},\\pi\_\{1\},\\ldots,\\pi\_\{n\}\),\(22\)whereπ0=0\\pi\_\{0\}=0,\{π1,…,πn\}=N\\\{\\pi\_\{1\},\\ldots,\\pi\_\{n\}\\\}=N, andπn\+1=π0\\pi\_\{n\+1\}=\\pi\_\{0\}denotes the return to the starting city\. The packing decision is represented by
zk∈\{0,1\},k∈J\.z\_\{k\}\\in\\\{0,1\\\},\\quad k\\in J\.\(23\)
For route positiontt, the accumulated knapsack load when leaving cityπt\\pi\_\{t\}is
Lt\(π,z\)=∑k∈J:ak∈\{π0,π1,…,πt\}wkzk,t=0,1,…,n\.L\_\{t\}\(\\pi,z\)=\\sum\_\{k\\in J:\\,a\_\{k\}\\in\\\{\\pi\_\{0\},\\pi\_\{1\},\\ldots,\\pi\_\{t\}\\\}\}w\_\{k\}z\_\{k\},\\quad t=0,1,\\ldots,n\.\(24\)The travel speed decreases linearly with the accumulated load:
vt\(π,z\)=vmax−\(vmax−vmin\)Lt\(π,z\)W\.v\_\{t\}\(\\pi,z\)=v\_\{\\max\}\-\\left\(v\_\{\\max\}\-v\_\{\\min\}\\right\)\\frac\{L\_\{t\}\(\\pi,z\)\}\{W\}\.\(25\)
The TTP can be written as
maxπ,z\\displaystyle\\max\_\{\\pi,z\}\\quad∑k∈Jpkzk−R∑t=0ncπt,πt\+1vt\(π,z\)\\displaystyle\\sum\_\{k\\in J\}p\_\{k\}z\_\{k\}\-R\\sum\_\{t=0\}^\{n\}\\frac\{c\_\{\\pi\_\{t\},\\pi\_\{t\+1\}\}\}\{v\_\{t\}\(\\pi,z\)\}\(26\)s\.t\.π0=0,\\displaystyle\\pi\_\{0\}=0,\(27\)\{π1,…,πn\}=N,\\displaystyle\\\{\\pi\_\{1\},\\ldots,\\pi\_\{n\}\\\}=N,\(28\)∑k∈Jwkzk≤W,\\displaystyle\\sum\_\{k\\in J\}w\_\{k\}z\_\{k\}\\leq W,\(29\)zk∈\{0,1\},\\displaystyle z\_\{k\}\\in\\\{0,1\\\},∀k∈J\.\\displaystyle\\forall k\\in J\.\(30\)
The objective in Eq\. \([26](https://arxiv.org/html/2606.00718#A2.E26)\) maximizes item profit minus route renting cost\. The travel\-time term depends on both the route permutationπ\\piand the packing planzz: the route determines the remaining distance over which each picked item is carried, while the packing plan affects travel speed through accumulated load\.
### B\.3Unified Utility Convention
Since TPP is a minimization problem and TTP is a maximization problem, we use a unified utility functionu\(⋅\)u\(\\cdot\)in the algorithmic description:
u\(x∣ℐ\)=\{−FTPP\(x∣ℐ\),for TPP,FTTP\(x∣ℐ\),for TTP\.u\(x\\mid\\mathcal\{I\}\)=\\begin\{cases\}\-F\_\{\\mathrm\{TPP\}\}\(x\\mid\\mathcal\{I\}\),&\\text\{for TPP\},\\\\ F\_\{\\mathrm\{TTP\}\}\(x\\mid\\mathcal\{I\}\),&\\text\{for TTP\}\.\\end\{cases\}Under this convention, a larger utility value always indicates a better solution\. All acceptance rules, rewards, and bandit updates in the generic CoEvo\-AHD framework are written in terms ofu\(⋅\)u\(\\cdot\)\.
## Appendix CCoEvo\-AHD Implementation and Problem\-specific Instantiation
This section combines the implementation\-level description of CoEvo\-AHD with its problem\-specific instantiations on TPP and TTP\. The goal is to avoid repeating the same reconstruction, shared\-information, and validation mechanisms in separate appendix sections\. The section first defines the unified component interface, then explains the two instantiations, and finally summarizes the common evolution procedure\.
### C\.1Unified Operator Interface
For a bi\-component optimization problem, a complete solution is written asx=\(xA,xB\)x=\(x^\{A\},x^\{B\}\), wherexAx^\{A\}andxBx^\{B\}denote two coupled decision components\. CoEvo\-AHD maintains two component\-specific operator populations,𝒫A=\{o1A,…,oNA\}\\mathcal\{P\}^\{A\}=\\\{o\_\{1\}^\{A\},\\ldots,o\_\{N\}^\{A\}\\\}and𝒫B=\{o1B,…,oNB\}\\mathcal\{P\}^\{B\}=\\\{o\_\{1\}^\{B\},\\ldots,o\_\{N\}^\{B\}\\\}\. Each operator returns only a candidate for its own component:
x~c=oic\(xA,xB,ℐ,ℳ\),c∈\{A,B\}\.\\widetilde\{x\}^\{c\}=o\_\{i\}^\{c\}\(x^\{A\},x^\{B\},\\mathcal\{I\},\\mathcal\{M\}\),\\qquad c\\in\\\{A,B\\\}\.
The implementation uses the following concrete function signatures:
tour\_operator\(tour,purchasing\_plan,problem\_data\)
purchase\_operator\(tour,purchasing\_plan,problem\_data\)
route\_operator\(route,pack\_plan,problem\_data\)
pack\_operator\(route,pack\_plan,problem\_data\)
The shared information spaceℳ\\mathcal\{M\}is implemented as the mutable dictionaryshared\_infoinsideproblem\_data\. Operators may write soft cross\-component suggestions into this dictionary, but no suggestion is accepted without reconstruction, feasibility checking, and complete\-objective evaluation\.
### C\.2Instantiation on TPP
#### C\.2\.1Solution representation, evaluation, and reconstruction
For TPP, the complete solution is decomposed asx=\(xT,xP\)x=\(x^\{T\},x^\{P\}\), wherexTx^\{T\}is a route over a selected subset of markets andxPx^\{P\}is a purchasing plan represented as product\-indexed purchase records\. A route must contain valid city indices and include the depot, but it is not required to visit all markets\.
The TPP environment exposes
ℰTPP=\{Evaluate,GreedyPurchase,CityValueAnalysis,DropCityEval\}\.\\mathcal\{E\}\_\{\\mathrm\{TPP\}\}=\\\{\\mathrm\{Evaluate\},\\mathrm\{GreedyPurchase\},\\mathrm\{CityValueAnalysis\},\\mathrm\{DropCityEval\}\\\}\.Evaluate\\mathrm\{Evaluate\}computes the complete TPP objective or the internal penalty\-augmented search score\.GreedyPurchase\\mathrm\{GreedyPurchase\}reconstructs the cheapest purchasing plan for a fixed route\.CityValueAnalysis\\mathrm\{CityValueAnalysis\}andDropCityEval\\mathrm\{DropCityEval\}provide market\-level signals for insertion, removal, and simplification\.
During evaluation, a tour proposal is first normalized and validated\. Its purchasing plan is then reconstructed byGreedyPurchase\\mathrm\{GreedyPurchase\}, and the complete solution is accepted only if the objective decreases\. A purchase proposal is evaluated on the current route\. If it improves the complete solution, it is accepted; otherwise, the previous solution is retained\.
For intermediate infeasible purchasing plans, the implementation uses the penalty\-augmented score
ΦTPP\(xT,xP\)=Ctravel\(xT\)\+Cpurchase\(xP\)\+ρ∑k∈Kmax\(0,dk−∑i∈Nqik\)\+Ψinvalid\(xT,xP\)\.\\Phi\_\{\\mathrm\{TPP\}\}\(x^\{T\},x^\{P\}\)=C\_\{\\mathrm\{travel\}\}\(x^\{T\}\)\+C\_\{\\mathrm\{purchase\}\}\(x^\{P\}\)\+\\rho\\sum\_\{k\\in K\}\\max\\left\(0,d\_\{k\}\-\\sum\_\{i\\in N\}q\_\{ik\}\\right\)\+\\Psi\_\{\\mathrm\{invalid\}\}\(x^\{T\},x^\{P\}\)\.This score is used only during search and repair\. Reported final objective values are computed from validated solutions using the unified TPP evaluator\.
#### C\.2\.2Shared messages and post\-processing
For TPP, purchase operators may write purchase\-guided route suggestions such as suggested tours, candidate tour lists, add\-city lists, drop\-city lists, and swap moves\. These fields are decoded into a bounded set of candidate tours\. Complete route proposals are normalized by removing duplicate cities and ensuring that the depot is present\. Add or insert messages are converted into tours by cheapest insertion, drop messages produce compact removal candidates, and swap messages remove one visited market while inserting one proposed market\.
Each decoded route candidate is validated, completed byGreedyPurchase\\mathrm\{GreedyPurchase\}, and evaluated as a complete TPP solution\. If the current solution is already feasible, the accepted shared\-information candidate must also be feasible\. If the current solution is infeasible, a shared candidate may be accepted as a repair move when it improves the penalty\-augmented score\.
After an accepted route update, purchase update, or shared\-information move, CoEvo\-AHD applies a city\-drop post\-processing step\. Candidate market removals are tested by reconstructing the purchasing plan and re\-evaluating the complete solution\. A removal is accepted only when demand satisfaction is preserved and the original TPP objective decreases\.
### C\.3Instantiation on TTP
#### C\.3\.1Solution representation, evaluation, and reconstruction
For TTP, the complete solution is decomposed asx=\(xR,xB\)x=\(x^\{R\},x^\{B\}\), wherexRx^\{R\}is a full city permutation andxBx^\{B\}is a binary packing vector\. The implementation exposes
ℰTTP=\{Evaluate,Fast2OptDelta,GreedyPack\}\.\\mathcal\{E\}\_\{\\mathrm\{TTP\}\}=\\\{\\mathrm\{Evaluate\},\\mathrm\{Fast2OptDelta\},\\mathrm\{GreedyPack\}\\\}\.Evaluate\\mathrm\{Evaluate\}computes the complete TTP objective,Fast2OptDelta\\mathrm\{Fast2OptDelta\}evaluates a 2\-opt route move under the current packing plan, andGreedyPack\\mathrm\{GreedyPack\}constructs a route\-aware packing plan\.
Given a routexRx^\{R\}, the fallback route\-aware packing rule scores itemkk, located at cityaka\_\{k\}, by
sk\(α\)=\(pk/max\(wk,1\)\)αmax\(Dsuffix\(ak;xR\),10−9\),s\_\{k\}\(\\alpha\)=\\frac\{\(p\_\{k\}/\\max\(w\_\{k\},1\)\)^\{\\alpha\}\}\{\\max\(D\_\{\\mathrm\{suffix\}\}\(a\_\{k\};x^\{R\}\),10^\{\-9\}\)\},whereDsuffix\(ak;xR\)D\_\{\\mathrm\{suffix\}\}\(a\_\{k\};x^\{R\}\)is the remaining route distance after the item city\. Items are inserted in descending score order while respecting the capacity constraint\.
During evaluation, a route proposal must be a valid full permutation and is accepted only if it improves the complete TTP objective\. A packing proposal must be a binary vector satisfying the knapsack capacity and is accepted only if it improves the complete objective\.
#### C\.3\.2Shared messages and post\-processing
For TTP, route operators may write route\-side structural signals such as route positions, suffix distances, city\-load profiles, loaded\-edge information, and acceleration segments\. Packing operators may read these fields and may write load, value, and position signals, including city burden scores, net pick\-value signals, early/late pressure indicators, critical items, heavy cities, valuable cities, and compact route\-reordering hints\.
Because TTP must visit every city, shared route suggestions never add or drop cities\. The evaluator interprets them as soft reordering signals and constructs full\-permutation route candidates\. For each candidate route, the evaluator applies distance and load\-order guards, reconstructs route\-aware packing candidates, evaluates the complete TTP objective, and accepts only the best improving feasible route–pack solution\.
After an accepted route update, packing update, or pack\-guided shared candidate, CoEvo\-AHD applies an item\-flip post\-processing step\. A flip is tested only if it preserves knapsack capacity and is retained only if it improves the exact TTP objective\.
### C\.4Comparison of the Two Instantiations
Table 4:Comparison of the TPP and TTP instantiations of CoEvo\-AHD\.
### C\.5Component\-wise Thompson Sampling and Pair Score Recording
In each collaborative evaluation round, CoEvo\-AHD selects one operator from each component population\. The implementation uses component\-wise local Thompson sampling rather than directly sampling over all possible operator pairs\. A lightweight local bandit is initialized inside each per\-instance evaluation worker\. For each operatoroo, it maintains the number of observations, reward sum, squared reward sum, and reward history\.
If an operator has fewer than two observations, it is sampled from a wide exploratory Gaussian\. Otherwise, the local sampler draws
θo∼𝒩\(μo,νono\),\\theta\_\{o\}\\sim\\mathcal\{N\}\\left\(\\mu\_\{o\},\\frac\{\\nu\_\{o\}\}\{n\_\{o\}\}\\right\),whereμo\\mu\_\{o\},νo\\nu\_\{o\}, andnon\_\{o\}are its empirical mean, empirical variance, and observation count\. The two component operators are selected independently by this rule and then evaluated as a pair\. Pair\-level collaboration scores are recorded after evaluation and used for best\-pair tracking and cross\-component joint crossover\.
### C\.6Candidate Reconstruction and Acceptance Rule
Because the two components are coupled, every component\-level proposal is reconstructed into a complete solution before acceptance\. The problem\-specific rules are those described in the TPP and TTP instantiations above\. In general, the evaluator follows
xt\+1=\{x¯,ifx¯is feasible and improves the current complete solution,xt,otherwise\.x\_\{t\+1\}=\\begin\{cases\}\\bar\{x\},&\\text\{if \}\\bar\{x\}\\text\{ is feasible and improves the current complete solution\},\\\\ x\_\{t\},&\\text\{otherwise\.\}\\end\{cases\}Thus, component outputs and shared messages act as candidate generators rather than direct replacements of the current solution\.
### C\.7Reward and Credit Assignment
The reward rule is instantiated differently for the two objectives\. For TPP, which is a minimization problem, letF0F\_\{0\}be the initial objective value of a restart,FbestF\_\{\\mathrm\{best\}\}the best objective found in that restart, andFbaseF\_\{\\mathrm\{base\}\}the objective value of the deterministic baseline\. The reward is
rTPP=F0−Fbestmax\(\|F0\|,1\)\+0\.5Fbase−Fbestmax\(\|Fbase\|,1\)\.r\_\{\\mathrm\{TPP\}\}=\\frac\{F\_\{0\}\-F\_\{\\mathrm\{best\}\}\}\{\\max\(\|F\_\{0\}\|,1\)\}\+0\.5\\frac\{F\_\{\\mathrm\{base\}\}\-F\_\{\\mathrm\{best\}\}\}\{\\max\(\|F\_\{\\mathrm\{base\}\}\|,1\)\}\.This reward is added to the selected tour operator, purchase operator, and their pair\.
For TTP, which is a maximization problem, the evaluator decomposes the raw gain into direct improvement and pack\-guided proposal improvement:
graw=Fbest−F0,g¯prop=min\{max\(0,gprop\),max\(0,graw\)\},gdir=graw−g¯prop,rR=gdir\+λRg¯prop,rB=gdir\+λBg¯prop,rRB=graw\.\\begin\{gathered\}g\_\{\\mathrm\{raw\}\}=F\_\{\\mathrm\{best\}\}\-F\_\{0\},\\qquad\\bar\{g\}\_\{\\mathrm\{prop\}\}=\\min\\\{\\max\(0,g\_\{\\mathrm\{prop\}\}\),\\max\(0,g\_\{\\mathrm\{raw\}\}\)\\\},\\\\ g\_\{\\mathrm\{dir\}\}=g\_\{\\mathrm\{raw\}\}\-\\bar\{g\}\_\{\\mathrm\{prop\}\},\\qquad r\_\{R\}=g\_\{\\mathrm\{dir\}\}\+\\lambda\_\{R\}\\bar\{g\}\_\{\\mathrm\{prop\}\},\\quad r\_\{B\}=g\_\{\\mathrm\{dir\}\}\+\\lambda\_\{B\}\\bar\{g\}\_\{\\mathrm\{prop\}\},\\quad r\_\{RB\}=g\_\{\\mathrm\{raw\}\}\.\\end\{gathered\}In the implementation,λR=0\.50\\lambda\_\{R\}=0\.50andλB=0\.80\\lambda\_\{B\}=0\.80\. The route and pack local Thompson samplers are updated withrRr\_\{R\}andrBr\_\{B\}, respectively, while the pair\-level collaboration score is updated withrRBr\_\{RB\}\.
### C\.8Population Management and LLM\-driven Evolution
At the end of each generation, each component population is ranked according to its individual operator score\. For componentc∈\{A,B\}c\\in\\\{A,B\\\}, the framework keepsTopN−M\(𝒫c;Fc\)\\mathrm\{Top\}\_\{N\-M\}\(\\mathcal\{P\}^\{c\};F^\{c\}\)and removes the lowest\-rankedMMoperators\. Reward histories and pair\-level statistics associated with removed operators are also removed\.
The vacancies are filled by LLM\-generated operators through three actions: mutation, homogeneous crossover, and cross\-component joint crossover\. Mutation rewrites a single parent operator\. Homogeneous crossover recombines two operators from the same component population\. Cross\-component joint crossover selects the highest\-scoring operator pair and asks the LLM to rewrite it as a coordinated pair\. Generated operators must use the required component interfaces and pass the validation pipeline before insertion\.
### C\.9Overall Pseudocode
Algorithm 1CoEvo\-AHD Implementation\-Level Procedure1:Training instances
ℐtrain\\mathcal\{I\}\_\{\\mathrm\{train\}\}, generations
GG, population size
NN, pruning size
MM, evaluation rounds
RR, search iterations
BB
2:Evolved operator populations
𝒫A,𝒫B\\mathcal\{P\}^\{A\},\\mathcal\{P\}^\{B\}and best evolved pair
\(oi⋆A,oj⋆B\)\(o\_\{i^\{\\star\}\}^\{A\},o\_\{j^\{\\star\}\}^\{B\}\)
3:Initialize component populations
𝒫A\\mathcal\{P\}^\{A\}and
𝒫B\\mathcal\{P\}^\{B\}
4:Validate generated operators before insertion
5:Initialize global operator statistics and pair scores
6:for
g=1,…,Gg=1,\\ldots,Gdo
7:foreach training instance
ℐ\\mathcal\{I\}in paralleldo
8:Initialize a local Thompson sampler for all valid operators
9:for
r=1,…,Rr=1,\\ldots,Rdo
10:Select
oiAo\_\{i\}^\{A\}and
ojBo\_\{j\}^\{B\}by component\-wise Thompson sampling
11:Construct an initial complete solution
x=\(xA,xB\)x=\(x^\{A\},x^\{B\}\)
12:Initialize or clearproblem\_data\[’shared\_info’\]
13:for
b=1,…,Bb=1,\\ldots,Bdo
14:Execute
oiAo\_\{i\}^\{A\}, validate its component output, reconstruct a complete solution, and accept if improved
15:Execute
ojBo\_\{j\}^\{B\}, validate its component output, reconstruct a complete solution, and accept if improved
16:Decode shared\-information signals into candidate complete solutions
17:Validate, reconstruct, evaluate, and accept the best improving candidate if any
18:endfor
19:Compute rewards for the selected component operators and their pair
20:Update local Thompson samplers and pair statistics
21:endfor
22:Return local rewards, pair scores, best objectives, and diagnostics
23:endfor
24:Aggregate rewards, histories, pair scores, and diagnostics across instances
25:Update global operator scores and pair\-level collaboration scores
26:Update the best evolved operator pair if validation performance improves
27:Prune the lowest\-ranked
MMoperators from each component population
28:Generate replacements by mutation, homogeneous crossover, or joint crossover
29:Validate generated operators before insertion
30:endfor
31:return
𝒫A\\mathcal\{P\}^\{A\},
𝒫B\\mathcal\{P\}^\{B\}, and
\(oi⋆A,oj⋆B\)\(o\_\{i^\{\\star\}\}^\{A\},o\_\{j^\{\\star\}\}^\{B\}\)
## Appendix DPrompt Templates and Operator Validation
### D\.1Prompt Templates
This section reports compact prompt skeletons used for LLM\-driven operator generation and evolution\. In the implementation, these skeletons are instantiated separately for TPP and TTP with problem\-specific function signatures, FastEnv tools, and shared\-information keys\. All generated operators are required to follow the component interface defined in Appendix[C\.1](https://arxiv.org/html/2606.00718#A3.SS1)\. The raw LLM output is not inserted into the population directly\. Instead, it must pass the validation pipeline in Appendix[D\.2](https://arxiv.org/html/2606.00718#A4.SS2)\.
Prompt for Operator InitializationYou are an expert in heuristic optimization for combinatorial problems\. Your task is to design a new\{component\_type\} Operatorfor\{problem\_type\}\.Problem Description:\{task\_description\}Existing \{component\_type\} Operators:\{existing\_operators\}Auxiliary Protocol:\{auxiliary\_protocol\}Requirements:1\.First, describe the new algorithm and its main steps in one sentence\. The description must be inside braces\{\.\.\.\}\.2\.The logic should be different from the provided reference operators to improve population diversity\.3\.Implement it in Python using the required function signature:\{function\_signature\}\.4\.The function must return a feasible output for the corresponding component\.5\.Only use standard Python libraries and NumPy\.6\.If helper functions are needed, define them inside the main function\.7\.Use the exposed environment tools when available\.8\.Wrap code in‘‘‘python \.\.\. ‘‘‘\.9\.Do not provide additional explanations outside the required output\.
Prompt for MutationYou are an algorithm optimizer\. We have a\{component\_type\} Operatorfor\{problem\_type\}\.Problem Description:\{task\_description\}Strategy:\{advice\}Current Code:\{operator\_code\}Optional Execution Profile:\{profiling\_report\}Task:Refine and improve this operator code according to the strategy\.Requirements:1\.Keep the required function signature unchanged:\{function\_signature\}\.2\.The function must return a feasible output for the corresponding component\.3\.Only use standard Python libraries and NumPy\.4\.Define helper functions inside the main function if needed\.5\.Use exposed environment tools when available\.6\.Wrap code in‘‘‘python \.\.\. ‘‘‘\.7\.Do not provide additional explanations outside the required output\.
Prompt for Homogeneous CrossoverYou are an expert in heuristic optimization\. Create a new\{component\_type\} Operatorfor\{problem\_type\}by combining ideas from two parent operators of the same component type\.Problem Description:\{task\_description\}Parent Operator 1:\{parent1\_code\}Parent Operator 2:\{parent2\_code\}Task:Identify useful mechanisms from both parents and synthesize a new operator\. The new operator should not simply copy either parent\.Requirements:1\.First, describe the new algorithm and its main steps in one sentence\. The description must be inside braces\{\.\.\.\}\.2\.Implement the new operator using the required function signature:\{function\_signature\}\.3\.The function must return a feasible output for the corresponding component\.4\.Only use standard Python libraries and NumPy\.5\.Define helper functions inside the main function if needed\.6\.Use exposed environment tools when available\.7\.Wrap code in‘‘‘python \.\.\. ‘‘‘\.8\.Do not provide additional explanations outside the required output\.
Prompt for Cross\-Component Joint CrossoverYou are an expert in heuristic optimization\. We use cross\-component joint crossover to co\-evolve two heterogeneous operators for\{problem\_type\}\.Component A Description:\{task\_description\_A\}Component B Description:\{task\_description\_B\}Best\-performing Operator Pair:Operator A Code:\{operator\_A\_code\}Operator B Code:\{operator\_B\_code\}Synergy Objective:\{synergy\_rule\}Task:Rewrite this pair as a coordinated entity\. The two new operators should be mutually compatible rather than independently optimized\.Requirements:1\.First, describe the joint design idea and its main steps in one sentence\. The description must be inside braces\{\.\.\.\}\.2\.Return one code block containing both generated operators\.3\.Use the required function signatures:\{function\_signature\_A\}and\{function\_signature\_B\}\.4\.Each operator must return a feasible output for its corresponding component\.5\.Only use standard Python libraries and NumPy\.6\.Define helper functions inside each main function if needed\.7\.Use shared information and exposed environment tools when useful\.8\.Wrap code in‘‘‘python \.\.\. ‘‘‘\.9\.Do not provide additional explanations outside the required output\.
### D\.2Validation Pipeline for LLM\-Generated Operators
CoEvo\-AHD does not directly trust raw LLM\-generated code\. The implementation validates generated code before insertion and again during per\-instance evaluation\.
##### Code extraction and registration\.
Generated text must contain a Python code block\. The code is executed in a restricted namespace containing standard Python utilities, NumPy, and the problem\-specific FastEnv class when enabled\. The framework then searches for the required function name:tour\_operatororpurchase\_operatorfor TPP, androute\_operatororpack\_operatorfor TTP\. If the exact function name is absent, the implementation attempts to locate a callable with a compatible signature\.
##### TPP validation\.
For TPP, operators are invoked with a timeout during evaluation\. A tour proposal must be a valid list of city indices containing the depot and no duplicate cities\. A purchasing proposal must be a dictionary mapping product indices to lists of\(city,quantity\)\(\\text\{city\},\\text\{quantity\}\)entries\. Invalid outputs, exceptions, and timeouts are recorded in diagnostics and do not replace the current solution\.
##### TTP validation\.
For TTP, generated operators are executed through a hard\-timeout subprocess or a persistent worker process\. A route proposal must be a list of lengthnnthat forms a valid permutation of all cities\. A packing proposal must be a binary list of lengthmm, and the total selected item weight must not exceed the knapsack capacity\. Operators that time out, raise exceptions, return malformed objects, or violate these feasibility conditions are rejected\.
##### Generation retry\.
When a generated operator fails syntax, registration, timeout, or feasibility checks, the framework can regenerate the operator by appending the observed error message to the prompt\. Only validated operators are inserted into the population or used in final testing\.
## Appendix EBest Evolved Operator Pairs
This section reports the evolutionary trajectories and the best evolved operator pairs selected according to validation performance\. The trajectory figures are included to illustrate how the operator populations evolve across generations and how representative route/tour\-side and packing/purchasing\-side mechanisms emerge during the search process\. The final operators shown below passed syntax validation, interface validation, bounded execution validation, component\-feasibility validation, and complete\-solution validation before being used in final testing\. They are included to improve transparency and reproducibility rather than as hand\-designed heuristics\. The operators are not manually tuned after selection; they are the validated outputs selected by the CoEvo\-AHD evolution process\.
### E\.1Evolutionary Trajectories and Operator Milestones
Figures[2](https://arxiv.org/html/2606.00718#A5.F2)and[3](https://arxiv.org/html/2606.00718#A5.F3)visualize the evolutionary trajectories of CoEvo\-AHD on TTP and TPP, respectively\. The horizontal axis denotes the number of generations, and the vertical axis denotes the normalized progress from the initial best validation result to the final best validation result\. The red curve records the best\-so\-far validation performance during evolution, whereas the annotated boxes summarize representative operator milestones\. To avoid interrupting the operator listings, these two dense figures are placed on dedicated appendix pages before the final evolved operator code\.
For TTP, the trajectory shows that early improvements are mainly driven by route and packing seed operators, whereas later improvements are associated with load\-aware route perturbation, route–packing coordination, and adaptive packing refinement\. The final best pair is obtained at generation 151, which is consistent with the selected TTP operator pair reported in Appendix[E\.2](https://arxiv.org/html/2606.00718#A5.SS2)\.
For TPP, the trajectory indicates a staged improvement process\. Initial gains come from seed synergy, greedy purchase reconstruction, and shared add/drop/swap proposals, whereas later gains are associated with crossover\-based tour refinement, purchase\-side candidate generation, and vectorized regret\-based search\. The final best pair is obtained at generation 194, which corresponds to the selected TPP operator pair reported in Appendix[E\.3](https://arxiv.org/html/2606.00718#A5.SS3)\.
Figure 2:Evolutionary trajectory and representative operator milestones of CoEvo\-AHD on TTP\. Higher validation performance is better\.Figure 3:Evolutionary trajectory and representative operator milestones of CoEvo\-AHD on TPP\. Lower validation cost is better, and the plotted value is normalized as progress toward the final best result\.
### E\.2Best Evolved Operator Pair for TTP
The best evolved TTP operator pair was selected at generation 151\. Its validation average objective is 1756\.82, where higher is better, and its pair\-level collaboration score is 1107\.21\.
Best Evolved TTP Route Operator[⬇](data:text/plain;base64,aW1wb3J0IHJhbmRvbQppbXBvcnQgbnVtcHkgYXMgbnAKCmRlZiByb3V0ZV9vcGVyYXRvcihyb3V0ZSwgcGFja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Bmb3IgaSwgdyBpbiBlbnVtZXJhdGUobG9hZF9wcm9maWxlKSBpZiB3IDw9IDAuMyAqIGNhcGFjaXR5CiAgICBdCgogICAgcmV0dXJuIGJlc3Rfcm91dGU=)importrandomimportnumpyasnpdefroute\_operator\(route,pack\_plan,problem\_data\):env=problem\_data\[’env’\]items=problem\_data\[’items’\]n\_cities=problem\_data\[’n\_cities’\]n\_items=problem\_data\[’n\_items’\]capacity=problem\_data\[’capacity’\]shared=problem\_data\.get\(’shared\_info’,\{\}\)city\_weights=np\.zeros\(n\_cities\)forkinrange\(n\_items\):ifpack\_plan\[k\]:city\_weights\[items\[k\]\[3\]\]\+=items\[k\]\[2\]defbest\_2opt\_move\(r\):n=len\(r\)for\_inrange\(n\):i=random\.randint\(0,max\(0,n\-2\)\)forjinrandom\.sample\(range\(i\+2,n\),max\(0,n\-i\-2\)\):delta=env\.fast\_2opt\_delta\(r,pack\_plan,i,j\)ifdelta\>1e\-9:returni,jreturnNonedeflocal\_search\(r\):r=list\(r\)whileTrue:move=best\_2opt\_move\(r\)ifmoveisNone:breaki,j=mover\[i\+1:j\+1\]=reversed\(r\[i\+1:j\+1\]\)returnrdefload\_aware\_perturb\(r,strength\):r=list\(r\)limit=int\(len\(r\)\*0\.65\)candidates=sorted\(\[\(c,city\_weights\[c\]\*\(idx\+1\)\)foridx,cinenumerate\(r\[:limit\]\)ifcity\_weights\[c\]\>0\],key=lambdax:x\[1\],reverse=True\)forcity,\_incandidates\[:strength\]:r\.remove\(city\)r\.insert\(random\.randint\(limit,len\(r\)\),city\)returnrcurrent=local\_search\(route\)best\_route=current\[:\]best\_score=env\.evaluate\(best\_route,pack\_plan\)stagnation=0for\_inrange\(25\):candidate=load\_aware\_perturb\(current,min\(max\(3,n\_cities//12\)\+stagnation,n\_cities//4\)\)candidate=local\_search\(candidate\)score=env\.evaluate\(candidate,pack\_plan\)ifscore\>best\_score\+1e\-9:best\_route,best\_score=candidate\[:\],scorecurrent,stagnation=candidate\[:\],0else:stagnation\+=1ifstagnation\>=8:random\.shuffle\(current\)current=local\_search\(current\)stagnation=0shared\[’route\_position’\]=\{city:idxforidx,cityinenumerate\(best\_route\)\}load\_profile,load=\[\],0\.0forcityinbest\_route:load\+=city\_weights\[city\]load\_profile\.append\(load\)shared\[’city\_load\_profile’\]=load\_profileshared\[’safe\_zone\_threshold\_index’\]=int\(n\_cities\*0\.7\)shared\[’acceleration\_segments’\]=\[\(i,i\)fori,winenumerate\(load\_profile\)ifw<=0\.3\*capacity\]returnbest\_route
Best Evolved TTP Pack Operator[⬇](data:text/plain;base64,aW1wb3J0IHJhbmRvbQppbXBvcnQgbnVtcHkgYXMgbnAKCmRlZiBwYWNrX29wZXJhdG9yKHJvdXRlLCBwYWNrX3BsYW4sIHByb2JsZW1fZGF0YSk6CiAgICBlbnYgPSBwcm9ibGVtX2RhdGFbJ2VudiddCiAgICBpdGVtcyA9IG5wLmFycmF5KHByb2JsZW1fZGF0YVsnaXRlbXMnXSwgZHR5cGU9ZmxvYXQpCiAgICBjYXBhY2l0eSA9IHByb2JsZW1fZGF0YVsnY2FwYWNpdHknXQogICAgc2hhcmVkID0gcHJvYmxlbV9kYXRhLmdldCgnc2hhcmVkX2luZm8nLCB7fSkKCiAgICBwcm9maXRzLCB3ZWlnaHRzLCBjaXRpZXMgPSBpdGVtc1s6LCAxXSwgaXRlbXNbOiwgMl0sIGl0ZW1zWzosIDNdLmFzdHlwZShpbnQpCiAgICBuX2l0ZW1zID0gbGVuKGl0ZW1zKQogICAgcm91dGVfcG9zID0gc2hhcmVkLmdldCgncm91dGVfcG9zaXRpb24nLCB7YzogaSBmb3IgaSwgYyBpbiBlbnVtZXJhdGUocm91dGUpfSkKICAgIHBvc2l0aW9ucyA9IG5wLmFycmF5KFtyb3V0ZV9wb3MuZ2V0KGMsIGxlbihyb3V0ZSkpIGZvciBjIGluIGNpdGllc10pCgogICAgZGVmIHNjb3JlKGluZGljZXMsIGN1cnJlbnRfd2VpZ2h0LCBhZGQ9VH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ZCwgY3VycmVudF93ZWlnaHQsIGFkZD1UcnVlKSldWzo0MF0KCiAgICAgICAgZm9yIG91dF9pZHggaW4gcmVtb3ZlX29yZGVyOgogICAgICAgICAgICBmb3IgaW5faWR4IGluIGFkZF9vcmRlcjoKICAgICAgICAgICAgICAgIGlmIGN1cnJlbnRfd2VpZ2h0IC0gd2VpZ2h0c1tvdXRfaWR4XSArIHdlaWdodHNbaW5faWR4XSA8PSBjYXBhY2l0eToKICAgICAgICAgICAgICAgICAgICB0cmlhbCA9IGN1cnJlbnRbOl0KICAgICAgICAgICAgICAgICAgICB0cmlhbFtvdXRfaWR4XSwgdHJpYWxbaW5faWR4XSA9IDAsIDEKICAgICAgICAgICAgICAgICAgICBvYmogPSBlbnYuZXZhbHVhdGUocm91dGUsIHRyaWFsKQogICAgICAgICAgICAgICAgICAgIGlmIG9iaiA+IGJlc3Rfb2JqICsgMWUtNzoKICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCwgYmVzdF9wbGFuLCBiZXN0X29iaiA9IHRyaWFsWzpdLCB0cmlhbFs6XSwgb2JqCiAgICAgICAgICAgICAgICAgICAgICAgIHN0YWduYXRpb24sIGltcHJvdmVkID0gMCwgVHJ1ZQogICAgICAgICAgICAgICAgICAgICAgICBicmVhawogICAgICAgICAgICBpZiBpbXByb3ZlZDoKICAgICAgICAgICAgICAgIGJyZWFrCgogICAgICAgIGlmIG5vdCBpbXByb3ZlZDoKICAgICAgICAgICAgc3RhZ25hdGlvbiArPSAxCiAgICAgICAgICAgIGlmIHN0YWduYXRpb24gPj0gNSBhbmQgbGVuKHBpY2tlZCkgPiAwOgogICAgICAgICAgICAgICAgZHJvcF9udW0gPSBtaW4oNSwgbWF4KDEsIGxlbihwaWNrZWQpIC8vIDQpKQogICAgICAgICAgICAgICAgZm9yIGlkeCBpbiByYW5kb20uc2FtcGxlKGxpc3QocGlja2VkKSwgZHJvcF9udW0pOgogICAgICAgICAgICAgICAgICAgIGN1cnJlbnRbaWR4XSA9IDAKICAgICAgICAgICAgICAgIHN0YWduYXRpb24gPSAwCgogICAgICAgIGlmIHN0YWduYXRpb24gPj0gMzA6CiAgICAgICAgICAgIGJyZWFrCgogICAgcmV0dXJuIGJlc3RfcGxhbg==)importrandomimportnumpyasnpdefpack\_operator\(route,pack\_plan,problem\_data\):env=problem\_data\[’env’\]items=np\.array\(problem\_data\[’items’\],dtype=float\)capacity=problem\_data\[’capacity’\]shared=problem\_data\.get\(’shared\_info’,\{\}\)profits,weights,cities=items\[:,1\],items\[:,2\],items\[:,3\]\.astype\(int\)n\_items=len\(items\)route\_pos=shared\.get\(’route\_position’,\{c:ifori,cinenumerate\(route\)\}\)positions=np\.array\(\[route\_pos\.get\(c,len\(route\)\)forcincities\]\)defscore\(indices,current\_weight,add=True\):eff=profits\[indices\]/np\.maximum\(weights\[indices\],1e\-9\)pos\_factor=0\.3\+0\.7\*positions\[indices\]/max\(1,len\(route\)\-1\)load\_penalty=\(current\_weight\+weights\[indices\]\)/max\(1\.0,capacity\)returneff\*pos\_factor\-\(0\.15\*load\_penaltyifaddelse\-0\.15\*load\_penalty\)current=list\(pack\_plan\)best\_plan=current\[:\]best\_obj=env\.evaluate\(route,best\_plan\)stagnation=0for\_inrange\(200\):picked=np\.flatnonzero\(np\.array\(current,dtype=bool\)\)unpicked=np\.flatnonzero\(~np\.array\(current,dtype=bool\)\)current\_weight=float\(np\.sum\(weights\[picked\]\)\)improved=Falseremove\_order=picked\[np\.argsort\(\-score\(picked,current\_weight,add=False\)\)\]\[:15\]add\_order=unpicked\[np\.argsort\(\-score\(unpicked,current\_weight,add=True\)\)\]\[:40\]forout\_idxinremove\_order:forin\_idxinadd\_order:ifcurrent\_weight\-weights\[out\_idx\]\+weights\[in\_idx\]<=capacity:trial=current\[:\]trial\[out\_idx\],trial\[in\_idx\]=0,1obj=env\.evaluate\(route,trial\)ifobj\>best\_obj\+1e\-7:current,best\_plan,best\_obj=trial\[:\],trial\[:\],objstagnation,improved=0,Truebreakifimproved:breakifnotimproved:stagnation\+=1ifstagnation\>=5andlen\(picked\)\>0:drop\_num=min\(5,max\(1,len\(picked\)//4\)\)foridxinrandom\.sample\(list\(picked\),drop\_num\):current\[idx\]=0stagnation=0ifstagnation\>=30:breakreturnbest\_plan
### E\.3Best Evolved Operator Pair for TPP
The best evolved TPP operator pair was selected at generation 194\. Its validation average objective is 1869\.67, where lower is better, and its pair\-level collaboration score is 1\.76\.
Best Evolved TPP Tour Operator[⬇](data:text/plain;base64,aW1wb3J0IHJhbmRvbQppbXBvcnQgbnVtcHkgYXMgbnAKCmRlZiB0b3VyX29wZXJhdG9yKHRvdXIsIHB1cmNoYXNpbmdfcGxhbiwgcHJvYmxlbV9kYXRhKToKICAgIGVudiA9IHByb2JsZW1fZGF0YS5nZXQoJ2VudicpCiAgICBpZiBlbnYgaXMgTm9uZToKICAgICAgICByZXR1cm4gbGlzdChkaWN0LmZyb21rZXlzKHRvdXIpKSBvciBbMF0KCiAgICBkaXN0ID0gbnAuYXJyYXkocHJvYmxlbV9kYXRhWydkaXN0X21hdHJpeCddLCBkdHlwZT1mbG9hdCkKICAgIHByaWNlcyA9IG5wLmFycmF5KHByb2JsZW1fZGF0YVsncHJpY2VzJ10sIGR0eXBlPWZsb2F0KQogICAgcXVhbnRpdGllcyA9IG5wLmFycmF5KHByb2JsZW1fZGF0YVsncXVhbnRpdGllcyddLCBkdHlwZT1mbG9hdCkKICAgIGRlbWFuZHMgPSBucC5hcnJheShwcm9ibGVtX2RhdGFbJ2RlbWFuZHMnXSwgZHR5cGU9ZmxvYXQpCiAgICBuX2NpdGllcyA9IHByb2JsZW1fZGF0YVsnbl9jaXRpZXMnXQogICAgc2hhcmVkID0gcHJvYmxlbV9kYXRhLmdldCgnc2hhcmVkX2luZm8nLCB7fSkKCiAgICBkZWYgY2xlYW4odCk6CiAgICAgICAgdCA9IGxpc3QoZGljdC5mcm9ta2V5cyhpbnQoYykgZm9yIGMgaW4gdCkpIG9yIFswXQogICAgICAgIHJldHVybiBb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nRbcG9zOl0KICAgICAgICAgICAgY29zdCwgcGxhbiA9IGV2YWx1YXRlKGNhbmRpZGF0ZSkKICAgICAgICAgICAgaWYgY29zdCA8IGJlc3RfY29zdCAtIDFlLTk6CiAgICAgICAgICAgICAgICBjdXJyZW50LCBiZXN0X3RvdXIsIGJlc3RfY29zdCwgYmVzdF9wbGFuID0gY2FuZGlkYXRlWzpdLCBjYW5kaWRhdGVbOl0sIGNvc3QsIHBsYW4KICAgICAgICAgICAgICAgIG5vX2ltcHJvdmUgPSAwCiAgICAgICAgICAgICAgICBjb250aW51ZQoKICAgICAgICBub19pbXByb3ZlICs9IDEKICAgICAgICBpZiBub19pbXByb3ZlID49IDEwOgogICAgICAgICAgICBjdXJyZW50ID0gYmVzdF90b3VyWzpdCiAgICAgICAgICAgIHJlbW92YWJsZSA9IFtpIGZvciBpLCBjIGluIGVudW1lcmF0ZShjdXJyZW50KSBpZiBjICE9IDBdCiAgICAgICAgICAgIGZvciBpZHggaW4gc29ydGVkKHJhbmRvbS5zYW1wbGUocmVtb3ZhYmxlLCBtYXgoMSwgbGVuKHJlbW92YWJsZSkgLy8gMykpLCByZXZlcnNlPVRydWUpOgogICAgICAgICAgICAgICAgZGVsIGN1cnJlbnRbaWR4XQogICAgICAgICAgICBub19pbXByb3ZlID0gMAoKICAgIHNoYXJlZFsndXNlZnVsX2NpdGllcyddID0gW2MgZm9yIGMgaW4gYmVzdF90b3VyIGlmIGMgIT0gMF0KICAgIHNoYXJlZFsndG91cl9zdHJhdGVneSddID0gJ3JlZ3JldF9pbnNlcnRpb25faWxzX2NvcmUnCiAgICByZXR1cm4gYmVzdF90b3Vy)importrandomimportnumpyasnpdeftour\_operator\(tour,purchasing\_plan,problem\_data\):env=problem\_data\.get\(’env’\)ifenvisNone:returnlist\(dict\.fromkeys\(tour\)\)or\[0\]dist=np\.array\(problem\_data\[’dist\_matrix’\],dtype=float\)prices=np\.array\(problem\_data\[’prices’\],dtype=float\)quantities=np\.array\(problem\_data\[’quantities’\],dtype=float\)demands=np\.array\(problem\_data\[’demands’\],dtype=float\)n\_cities=problem\_data\[’n\_cities’\]shared=problem\_data\.get\(’shared\_info’,\{\}\)defclean\(t\):t=list\(dict\.fromkeys\(int\(c\)forcint\)\)or\[0\]return\[0\]\+\[cforcintifc\!=0\]defevaluate\(t\):plan=env\.greedy\_purchase\(t\)returnenv\.evaluate\(t,plan\),plandefbest\_insertion\(current\_tour\):tour\_set=set\(current\_tour\)t=np\.array\(current\_tour,dtype=int\)iflen\(t\)<2:returnNonetour\_mask=np\.zeros\(n\_cities,dtype=bool\)tour\_mask\[t\]=Truetour\_mask\[0\]=Falsecurr\_prices=prices\[:,tour\_mask\]\.copy\(\)curr\_qty=quantities\[:,tour\_mask\]curr\_prices\[curr\_qty<=0\]=np\.infcurrent\_best=np\.min\(curr\_prices,axis=1\)candidates=np\.array\(\[cforcinrange\(1,n\_cities\)ifcnotintour\_set\],dtype=int\)iflen\(candidates\)==0:returnNonecand\_prices=prices\[:,candidates\]\.copy\(\)cand\_prices\[quantities\[:,candidates\]<=0\]=np\.infsavings=np\.maximum\(current\_best\[:,None\]\-cand\_prices,0\.0\)\*demands\[:,None\]total\_savings=np\.sum\(savings,axis=0\)u,v=t\[:\-1\],t\[1:\]delta=dist\[candidates\[:,None\],u\]\+dist\[candidates\[:,None\],v\]\-dist\[u,v\]best\_pos=np\.argmin\(delta,axis=1\)\+1net\_change=np\.min\(delta,axis=1\)\-total\_savingsidx=int\(np\.argmin\(net\_change\)\)ifnet\_change\[idx\]\>=0:returnNonereturnint\(candidates\[idx\]\),int\(best\_pos\[idx\]\)current=clean\(tour\)best\_cost,best\_plan=evaluate\(current\)best\_tour=current\[:\]no\_improve=0for\_inrange\(50\):move=best\_insertion\(current\)ifmoveisnotNone:city,pos=movecandidate=current\[:pos\]\+\[city\]\+current\[pos:\]cost,plan=evaluate\(candidate\)ifcost<best\_cost\-1e\-9:current,best\_tour,best\_cost,best\_plan=candidate\[:\],candidate\[:\],cost,planno\_improve=0continueno\_improve\+=1ifno\_improve\>=10:current=best\_tour\[:\]removable=\[ifori,cinenumerate\(current\)ifc\!=0\]foridxinsorted\(random\.sample\(removable,max\(1,len\(removable\)//3\)\),reverse=True\):delcurrent\[idx\]no\_improve=0shared\[’useful\_cities’\]=\[cforcinbest\_tourifc\!=0\]shared\[’tour\_strategy’\]=’regret\_insertion\_ils\_core’returnbest\_tour
Best Evolved TPP Purchase Operator[⬇](data:text/plain;base64,aW1wb3J0IG51bXB5IGFzIG5wCgpkZWYgcHVyY2hhc2Vfb3BlcmF0b3IodG91ciwgcHVyY2hhc2luZ19wbGFuLCBwcm9ibGVtX2RhdGEpOgogICAgcHJpY2VzID0gbnAuYXJyYXkocHJvYmxlbV9kYXRhWydwcmljZXMnXSwgZHR5cGU9ZmxvYXQpCiAgICBxdWFudGl0aWVzID0gbnAuYXJyYXkocHJvYmxlbV9kYXRhWydxdWFudGl0aWVzJ10sIGR0eXBlPWZsb2F0KQogICAgZGVtYW5kcyA9IG5wLmFycmF5KHByb2JsZW1fZGF0YVsnZGVtYW5kcyddLCBkdHlwZT1mbG9hdCkKICAgIGRpc3QgPSBucC5hcnJheShwcm9ibGVtX2RhdGFbJ2Rpc3RfbWF0cml4J10sIGR0eXBlPWZsb2F0KQogICAgZW52ID0gcHJvYmxlbV9kYXRhLmdldCgnZW52JykKICAgIHNoYXJlZCA9IHByb2JsZW1fZGF0YS5nZXQoJ3NoYXJlZF9pbmZvJywge30pCgogICAgYmFzZV90b3VyID0gWzBdICsgW2MgZm9yIGMgaW4gZGljdC5mcm9ta2V5cyh0b3VyKSBpZiBjICE9IDBdCiAgICB0b3VyX3NldCA9IHNldChiYXNlX3RvdXIpCiAgICB0b3VyX2FyciA9IG5wLmFycmF5KGJhc2VfdG91ciwgZHR5cGU9aW50KQoKICAgIGJhc2VfcGxhbiA9IGVudi5ncmVlZHlfcHVyY2hhc2UoYmFzZV90b3VyKSBpZiBlbnYgZWxzZSB7fQoKICAgIHVzZWQgPS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dmluZyA9IGZsb2F0KG5wLnN1bShzYXZpbmdzKSkKICAgICAgICBpZiB0b3RhbF9zYXZpbmcgPiAwOgogICAgICAgICAgICByZWdyZXRfc2NvcmVzW2NdID0gdG90YWxfc2F2aW5nIC8gbWF4KGluc2VydGlvbl9jb3N0KGMpLCAxZS05KQoKICAgIGFkZF9jaXRpZXMgPSBbYyBmb3IgYywgXyBpbiBzb3J0ZWQocmVncmV0X3Njb3Jlcy5pdGVtcygpLCBrZXk9bGFtYmRhIHg6IC14WzFdKVs6MTBdXQogICAgZHJvcF9jaXRpZXMgPSBpZGxlX2NpdGllc1s6MTBdCiAgICBzd2FwX21vdmVzID0gWyhkLCBhKSBmb3IgZCBpbiBkcm9wX2NpdGllc1s6NV0gZm9yIGEgaW4gYWRkX2NpdGllc1s6NV0gaWYgYSBub3QgaW4gdG91cl9zZXRdWzoxNV0KCiAgICBzaGFyZWRbJ2FkZF9jaXRpZXMnXSA9IGFkZF9jaXRpZXMKICAgIHNoYXJlZFsnZHJvcF9jaXRpZXMnXSA9IGRyb3BfY2l0aWVzCiAgICBzaGFyZWRbJ3N3YXBfbW92ZXMnXSA9IHN3YXBfbW92ZXMKCiAgICByZXR1cm4gYmFzZV9wbGFu)importnumpyasnpdefpurchase\_operator\(tour,purchasing\_plan,problem\_data\):prices=np\.array\(problem\_data\[’prices’\],dtype=float\)quantities=np\.array\(problem\_data\[’quantities’\],dtype=float\)demands=np\.array\(problem\_data\[’demands’\],dtype=float\)dist=np\.array\(problem\_data\[’dist\_matrix’\],dtype=float\)env=problem\_data\.get\(’env’\)shared=problem\_data\.get\(’shared\_info’,\{\}\)base\_tour=\[0\]\+\[cforcindict\.fromkeys\(tour\)ifc\!=0\]tour\_set=set\(base\_tour\)tour\_arr=np\.array\(base\_tour,dtype=int\)base\_plan=env\.greedy\_purchase\(base\_tour\)ifenvelse\{\}used=\{cforbuysinbase\_plan\.values\(\)forc,qinbuysifq\>0\}idle\_cities=\[cforcinbase\_tourifc\!=0andcnotinused\]definsertion\_cost\(city\):ifcityintour\_setorlen\(tour\_arr\)<2:return0\.0u,v=tour\_arr\[:\-1\],tour\_arr\[1:\]returnfloat\(np\.min\(dist\[u,city\]\+dist\[city,v\]\-dist\[u,v\]\)\)tour\_best=np\.full\(len\(demands\),np\.inf\)forpinrange\(len\(demands\)\):available=quantities\[p,list\(tour\_set\)\]\>0ifnp\.any\(available\):tour\_best\[p\]=np\.min\(prices\[p,list\(tour\_set\)\]\[available\]\)regret\_scores=\{\}forcinrange\(prices\.shape\[1\]\):ifcintour\_set:continuemask=quantities\[:,c\]\>0savings=np\.maximum\(tour\_best\[mask\]\-prices\[mask,c\],0\.0\)\*demands\[mask\]total\_saving=float\(np\.sum\(savings\)\)iftotal\_saving\>0:regret\_scores\[c\]=total\_saving/max\(insertion\_cost\(c\),1e\-9\)add\_cities=\[cforc,\_insorted\(regret\_scores\.items\(\),key=lambdax:\-x\[1\]\)\[:10\]\]drop\_cities=idle\_cities\[:10\]swap\_moves=\[\(d,a\)fordindrop\_cities\[:5\]forainadd\_cities\[:5\]ifanotintour\_set\]\[:15\]shared\[’add\_cities’\]=add\_citiesshared\[’drop\_cities’\]=drop\_citiesshared\[’swap\_moves’\]=swap\_movesreturnbase\_plan
## Appendix FExperimental Details
### F\.1Baseline Settings
We compare CoEvo\-AHD with representative baseline algorithms for both TTP and TPP\. All methods are evaluated under the same final testing budget whenever applicable\. For TPP, all baselines are adapted to the same instance parser, purchasing reconstruction procedure, objective evaluator, and output format\. For a fixed set of visited markets, the purchasing plan is recomputed using the same price\-supply\-demand information, and the final objective value is evaluated by the unified TPP evaluator\. Therefore, the comparison reflects differences in search strategies rather than differences in objective implementation\.
#### F\.1\.1TPP Baselines
For TPP, we compare CoEvo\-AHD with three representative metaheuristic baselines: DMD\-ATA, ALNS, and Transgenetic Algorithm\. In the main result table, DMD\-ATA is reported as DMD\-ATA \(ACO\), and Transgenetic Algorithm is reported as TA\.
Table 5:TPP baseline methods and their main settings\.##### DMD\-ATA \(ACO\)\.
DMD\-ATA is implemented as an ant\-colony\-based TPP solver with multiple pheromone levels, heterogeneous ant parameters, local search, and Dropstar\-based intensification\. Each solution is represented as a market visiting sequence starting from depot 0\. During construction, the next market is selected by jointly considering pheromone intensity, travel distance, and the potential improvement in unsatisfied demand or purchasing cost\. After a complete solution is constructed, local search is applied, including 2\-opt, market insertion, simplification, and market drop\. Since the original DMD\-ATA was mainly designed for uncapacitated TPP, our capacitated implementation uses Dropstar as a candidate generation and intensification mechanism\. All candidate solutions are finally evaluated by the unified capacitated TPP evaluator\.
##### ALNS\.
The ALNS baseline follows an adaptive large neighborhood search framework with destroy and repair operators, simulated annealing acceptance, and adaptive operator scoring\. A solution state consists of a visited\-market path and a purchasing plan\. For a fixed market set, the purchasing subproblem is solved by purchasing each product from visited markets in ascending unit\-price order until the demand is satisfied or available supply is exhausted\. The implementation uses random market removal, random product\-market removal, worst purchase\-cost removal, price\-similarity removal, distance\-gap removal, and high\-quantity removal as destroy operators\. The repair operators include greedy product insertion, randomized product insertion, regret product insertion, and cheapest market insertion\. Since our experiments consider the standard capacitated TPP, release\-time, perishability, deterioration\-cost, and cold\-chain terms from TPP\-PF variants are removed, leaving only travel cost and purchasing cost\.
##### Transgenetic Algorithm \(TA\)\.
The Transgenetic Algorithm baseline follows a host\-repository, plasmid, and transposon search mechanism\. A chromosome represents a market sequence without the depot, and it is converted into a depot\-starting route during evaluation\. The initial population is generated by random feasible construction followed by unused\-market removal and 2\-opt route improvement\. The host repository stores both prior path information and high\-quality chromosomes from the current population\. Plasmid operations inject promising information strings into chromosomes, while transposon operations perturb a chromosome by moving or removing route segments\. The original Lin\-Kernighan local improvement step is replaced by deterministic first\-improvement 2\-opt to avoid external LK/LKH dependencies\. This implementation difference is explicitly reported for reproducibility\.
#### F\.1\.2TTP Baselines
For TTP, we compare CoEvo\-AHD with MATLS, S5, and CoCo\. The detailed parameter settings of these baselines will be reported after the final TTP baseline configuration is fixed\.
Table 6:TTP baseline methods and their main settings\.##### MATLS
MATLS is a memetic algorithm for the Traveling Thief Problem, where each individual jointly encodes a city tour and an item\-picking plan\. The initial population is generated using CLKSolver\-based TSP tours when available, with an MST\-based construction over Delaunay\-neighbor edges as fallback, and random feasible packing plans\. During evolution, two parents are selected to produce an offspring by order crossover for the tour and single\-point crossover for the packing plan, followed by a repair step if the knapsack capacity is violated\. Each offspring is further improved by a two\-stage local search: a 2\-opt procedure for tour improvement and a single\-flip packing search based on estimated item gains under the current tour\. Candidate offspring are inserted only when sufficiently different from existing individuals, and the population is sorted by the TTP objective, i\.e\., collected profit minus renting cost, before being truncated to the fixed population size\. In our implementation, the main settings are population size=30=30, maximum initialization trials=100=100, no\-improvement limit=2000=2000, and, for TTP instances,500500MA iterations with33independent runs per instance\.
##### S5
S5 is a restart\-based heuristic for the Traveling Thief Problem\. In each outer iteration, the method first generates a closed TSP tour using CLKSolver and then constructs a packing plan with an iterative greedy packing procedure\. For a fixed tour, items are ranked by a distance\-aware profit\-weight score, where the heuristic value is proportional toprofitα/\(dto\_go⋅weightα\)\\mathrm\{profit\}^\{\\alpha\}/\(d\_\{\\mathrm\{to\\\_go\}\}\\cdot\\mathrm\{weight\}^\{\\alpha\}\)\. The exponentα\\alphais tuned by a ternary\-search\-like procedure initialized atα=5\.0\\alpha=5\.0with search spread2\.52\.5, using at most2020search iterations and a convergence tolerance of0\.10\.1\. For each candidate value ofα\\alpha, items are greedily inserted into the packing plan while respecting the knapsack capacity, and the TTP objective is evaluated as the collected profit minus the renting cost induced by the load\-dependent travel time\. The best solution over all generated tours and packing trials is retained\. In our implementation, S5 can be terminated either by a runtime budget or by an outer\-iteration limit\.
##### CoCo
CoCo is a collaborative local\-search heuristic for the Traveling Thief Problem, where each solution consists of a city tour and a binary packing plan\. The initial tour is generated by CLKSolver when available, and the initial packing plan is selected as the better one between an insertion\-based packing heuristic and an iterative greedy packing heuristic\. The iterative packing procedure ranks items using a ratio\- and distance\-aware score and searches the weighting parameter with initial valuec=5\.0c=5\.0, spreadd=2\.5d=2\.5, and at mostq=20q=20search rounds\. Starting from the initial solution, CoCo repeatedly alternates between tour and packing optimization\. The tour is improved by a steepest\-ascent 2\-opt search restricted to Delaunay\-neighbor candidate moves, while the packing plan is improved by an all\-item bit\-flip hill\-climbing procedure that accepts flips only when they increase the TTP objective\. Each solution is evaluated by the collected profit minus the renting cost under the load\-dependent travel speed\. The best solution over all restarts and alternating local\-search iterations is retained\. In our implementation, the default algorithm setting isalg=4\\mathrm\{alg\}=4\.
##### Fairness and implementation notes\.
All baseline methods are evaluated on the same test instances as CoEvo\-AHD\. Whenever applicable, the same wall\-clock time limit is used\. For stochastic methods, independent repeated runs are conducted and the mean objective value is reported\. For TPP baselines, all final solutions are re\-evaluated by the unified TPP evaluator\. Infeasibility penalties are used only during search or repair; reported final objective values are computed from the corresponding validated solutions\.Similar Articles
HMACE: Heterogeneous Multi-Agent Collaborative Evolution for Combinatorial Optimization
This paper introduces HMACE, a heterogeneous multi-agent collaborative evolution framework that uses Large Language Models to automate heuristic design for NP-hard combinatorial optimization problems. It demonstrates improved quality-efficiency trade-offs over single-agent and multi-agent baselines on problems like TSP and BPP.
AHD Agent: Agentic Reinforcement Learning for Automatic Heuristic Design
This paper introduces AHD Agent, a framework using agentic reinforcement learning to enable LLMs to autonomously design heuristics for combinatorial optimization problems by dynamically interacting with the solving environment.
Beyond Static Evaluation: Co-Evolutionary Mechanisms for LLM-Driven Strategy Evolution in Adversarial Games
This paper proposes three co-evolutionary mechanisms (evaluator co-evolution, hierarchical deep evaluation, and weakness pressure) for LLM-driven code evolution in adversarial multi-agent games, achieving state-of-the-art results on the MCTF 2026 maritime capture-the-flag task.
AlgoEvolve: LLM-driven Meta-evolution of Algorithmic Trading Programs
Introduces AlgoEvolve, an LLM-driven evolutionary framework that generates and iteratively improves algorithmic trading strategies, with a meta-evolutionary outer loop that evolves prompts to guide the inner loop synthesis.
CoEvolve: Training LLM Agents via Agent-Data Mutual Evolution
CoEvolve proposes an agent-data mutual evolution framework for training LLM agents through closed-loop, interaction-driven learning that adapts both the agent and its training data distribution. The method extracts feedback signals from rollout trajectories to guide LLM-based task synthesis, demonstrating significant improvements (15-19% absolute gains) across multiple Qwen models on AppWorld and BFCL benchmarks.