HeurEvo: Agentic Evolution of Hybrid Solver-Augmented Heuristics for Time-Critical Mathematical Optimization
Organizations: Purdue University · Microsoft Research
Abstract
Recent advances in agentic heuristic design use AI agents and execution feedback to automate algorithm discovery for challenging optimization problems. In many practical settings, high-quality solutions must be obtained under strict runtime constraints, motivating hybrid approaches that combine problem-specific heuristics with powerful mathematical programming solvers. However, existing approaches typically improve heuristic components within predefined procedures or tune solver configurations in isolation. This limits holistic adaptation of where to allocate computation, how to leverage solvers, and how to refine the overall algorithmic structure. To address these limitations, we propose HeurEvo, an automated plan--code--component co-evolution framework that jointly evolves the high-level algorithmic structures, their implementations, and a shared pool of reusable components. A planner determines which algorithmic components to use, how to combine them, and how to allocate runtime across stages, a coder realizes the resulting plan as executable code, while a component evolver updates the shared component pool. Within an island-based evolutionary framework, plans and implementations co-evolve with feedback from an interpreter agent that analyzes execution results and identifies opportunities for improvement. Across diverse combinatorial optimization benchmarks and challenging MIPLIB instances, HeurEvo finds high-quality solutions within tight runtime budgets, often matching or surpassing state-of-the-art optimization solvers given hours or days of computation. On several nonlinear geometry problems such as hexagon packing, it also improves upon the best previously reported results. These results highlight the value of jointly searching over algorithmic structure and implementation for agentic heuristic design.
Figures & tables
| Step | Component | Subgoal | Implementation details | Time budget |
| 1 | Euclidean tour construction | Produce feasible and diverse incumbents | Build a small portfolio of nearest-neighbor and insertion tours; retain a diverse elite set | s |
| 2 | Local tour improvement | Rapidly reduce tour length with cheap moves | Apply candidate-restricted 2-opt and Or-opt descent; perturb and restart only after stagnation | s |
| 3 | Candidate-edge restricted MIP | Escape local minima through nonlocal edge changes | Warm-start Gurobi on a sparse graph containing proximity, incumbent, elite, and repair arcs | s |
| 4 | Large-neighborhood search | Repair costly regions missed by the sparse global search | Fix most of the incumbent, destroy a long-edge or geographic region, and use Gurobi to reconnect that region exactly | s |
| 5 | Residual anytime primal portfolio | Use the residual budget on the most productive search mode | Adaptively select among Gurobi LNS micro-repair, Gurobi sparse-MIP retry, and heuristic local-search restart using same-run progress | Remaining time |
| Mean gap (%) | Beat Gurobi | |||
| Method | Train | Test | Train | Test |
| OpenEvolve | ||||
| AdaEvolve | ||||
| EvoX | ||||
| HeurEvo | ||||
| Mean gap (%) | Beat Gurobi | |||
| Method | Train | Test | Train | Test |
| OpenEvolve | ||||
| AdaEvolve | ||||
| EvoX | ||||
| HeurEvo | ||||
| Method | OP | C-CVRP | RCPS | PFSS | MIS | ||||||||||
| Train | Val | Test | Train | Val | Test | Train | Val | Test | Train | Val | Test | Train | Val | Test | |
| EoH (GLS) | – | – | – | – | – | – | – | – | – | -2.65 | -2.61 | -2.20 | – | – | – |
| ReEvo (ACO) | +4.16 | +1.32 | +7.40 | +6.58 | +9.77 | +8.28 | – | – | – | – | – | – | – | – | – |
| RefineEvo (ACO) | – | – | – | +5.06 | +9.59 | +8.18 | – | – | – | – | – | – | – | – | – |
| OpenEvolve | |||||||||||||||
| AdaEvolve | |||||||||||||||
| Method | comp12-2idx | comp21-2idx | graphdraw- grafo2 | graphdraw- mainerd | opm2-z12-s8 | sct32 |
| AdaEvolve | 366.20 | 100.40 | 85061.30 | 47940.40 | 58057.20 | -3.01 |
| HeurEvo | 327.00 | 103.20 | 82003.10 | 45681.00 | 58519.40 | -2.77 |
| Method | Circle packing-rectangle | Min-max distance ratio | Hexagon packing | |||||
| SOTA | 2.3658323759 | 2.6393205590 | 12.8892299 | 17.77499 | 19.05398 | 3.9245008973 | 3.9416420675 | 4.2689949573 |
| AdaEvolve | 2.3642481267 | 2.6355313151 | 12.8892299077 | 17.7749805542 | 19.0539845098 | 3.9326758559 | 3.9416423004 | 4.2723920772 |
| HeurEvo | 2.36 58323759 | 2.63 93205 643 | 12.889229 1072 | 17.7749 80 3417 | 19.0539 769136 | 3.9 245011309 | 3.941642 06 25 | 4.2 689950806 |
| Variant | Averaged performance | OP | C-CVRP | RCPS | PFSS | ||||||||||
| Train | Val | Test | Train | Val | Test | Train | Val | Test | Train | Val | Test | Train | Val | Test | |
| Fixed plan | |||||||||||||||
| Component only | |||||||||||||||
| Always-plan | |||||||||||||||
| Always-plan + component | |||||||||||||||
| Adaptive plan only | |||||||||||||||
| Variant | Average gap (%) | ||
| Train | Val | Test | |
| Single island | |||
| Shared plan | |||
| Partitioned library | |||
| HeurEvo (Ours) | |||
Appendix figures & tables15 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Description | Value | |
| Search budget and initialization | |||
| Number of islands (one initial plan per island) | 5 | ||
| – | Validated seed programs generated per plan | 1 | |
| Debugging attempts per generation call | 3 | ||
| Per-instance execution budget (seconds) | 120 | ||
| Island scheduling (Eqs. C1, C3) | |||
| Method | C-CVRP | U-CVRP | TSP | BP | OP | Decap | JSS | PFSS | RCPS | Max-Cut | MIS |
| EoH (Constr.) | – | – | – | +3.53 | – | – | – | – | – | – | – |
| EoH (GLS) | – | – | +0.68 | – | – | – | – | -2.65 | – | – | – |
| ReEvo (ACO) | +6.58 | +9.66 | +8.60 | +1.14 | +4.16 | – | – | – | – | – | – |
| ReEvo (Constr.) | – | – | +16.02 | – | – | – | – | – | – | – | – |
| ReEvo (GLS) | – | – | -0.83 | – | – | – | – | – | – | – | – |
| RefineEvo (ACO) | +5.06 | +9.10 | +9.60 | – | – | – | – | – | – | – | – |
| Method | C-CVRP | U-CVRP | TSP | BP | OP | Decap | JSS | PFSS | RCPS | Max-Cut | MIS |
| EoH (Constr.) | – | – | – | +3.30 | – | – | – | – | – | – | – |
| EoH (GLS) | – | – | +0.60 | – | – | – | – | -2.20 | – | – | – |
| ReEvo (ACO) | +8.28 | +13.30 | +9.96 | +1.56 | +7.40 | – | – | – | – | – | – |
| ReEvo (Constr.) | – | – | +15.37 | – | – | – | – | – | – | – | – |
| ReEvo (GLS) | – | – | -0.79 | – | – | – | – | – | – | – | – |
| RefineEvo (ACO) | +8.18 | +12.26 | +12.72 | – | – | – | – | – | – | – | – |
| Problem | Best result source | Reported reference | AdaEvolve | HeurEvo | ||
| Circle packing (rectangle) | 21 | – | EinsteinArena a | 2.3658323759185156 | 2.3642481267 | 2.36 58323759 |
| Circle packing (rectangle) | 26 | – | Lai b | 2.639320558987759336 | 2.6355313151 | 2.63 93205 643 |
| Circle packing (rectangle) | 27 | – | Dutton / Lai b,c | 2.691523360671018652 | 2.6834410277 | 2.68 91174195 |
| Circle packing (square) | 26 | – | Packomania d | 2.635983084919 | 2.6359830484 | 2.6359775049 |
| Circle packing (square) | 32 | – | Berthold et al. (2026a) d | 2.939572771205 | 2.9395727706 | 2.9395727706 |
| Distance ratio | 14 | 3 | Sun–Samanta e | 4.165 | 4.1657834746 | 4.16578 20926 |
| Method | C-CVRP | U-CVRP | TSP | BP | OP | Decap | JSS | PFSS | RCPS | Max-Cut | MIS |
| Fixed plan | -3.15 | -2.25 | +1.23 | +0.45 | +1.94 | +1.47 | -12.29 | -0.83 | +1.39 | -1.19 | +0.19 |
| Adaptive plan only | -2.48 | -0.68 | +1.11 | +0.45 | -0.87 | +1.43 | -12.32 | -1.48 | +0.87 | -1.18 | +0.27 |
| Component only | -3.09 | -2.47 | +1.98 | +0.40 | -1.67 | +1.30 | -12.28 | -0.79 | +1.37 | -1.08 | +0.35 |
| Earlier full configuration | -3.04 | -1.82 | +1.45 | +0.45 | -0.75 | +1.45 | -12.32 | -1.15 | +0.82 | -1.83 | +0.23 |
| Always-plan + component | -3.20 | -1.78 | +0.40 | +0.45 | -2.67 | +1.47 | -12.32 | -1.16 | -0.35 | -1.69 | +0.11 |
| Always-plan | -2.84 | -2.04 | -0.23 | +0.10 | +0.45 | +1.44 | -12.23 | -1.52 | +0.50 | -1.89 | -0.12 |
| Method | C-CVRP | U-CVRP | TSP | BP | OP | Decap | JSS | PFSS | RCPS | Max-Cut | MIS |
| Fixed plan | -3.26 | -1.81 | +2.53 | +0.69 | +7.97 | +2.66 | -6.30 | -0.50 | +0.39 | -0.86 | +1.20 |
| Adaptive plan only | -3.00 | -1.81 | +2.44 | +0.69 | +3.76 | +2.01 | -6.57 | -0.64 | +0.65 | -0.79 | +0.90 |
| Component only | -3.47 | -1.59 | +4.17 | +0.69 | +3.86 | +1.62 | -6.41 | -0.69 | +1.61 | -0.70 | +1.79 |
| Earlier full configuration | -3.45 | -1.06 | +1.78 | +0.69 | +7.04 | +1.98 | -6.42 | -0.89 | +0.57 | -1.54 | +0.57 |
| Always-plan + component | -3.62 | +0.09 | +1.97 | +0.69 | -2.39 | +1.82 | -6.19 | -0.93 | +0.43 | -1.08 | +1.52 |
| Always-plan | -2.95 | -1.96 | +0.18 | +0.38 | +8.12 | +2.03 | -6.17 | -1.67 | +0.43 | -1.44 | +0.11 |
| Variant | C-CVRP | U-CVRP | TSP | BP | OP | Decap | JSS | PFSS | RCPS | Max-Cut | MIS |
| Single island | -2.88 | +3.10 | -0.92 | +0.49 | -0.06 | +1.05 | -7.07 | -2.65 | -0.57 | -1.32 | +0.10 |
| Shared plan | -2.69 | -1.93 | -0.98 | +0.62 | -0.97 | +1.55 | -6.61 | -2.35 | +1.21 | -1.41 | -0.10 |
| Partitioned library | -1.88 | -1.94 | -0.93 | +0.49 | -3.98 | +1.17 | -6.74 | -1.86 | -1.78 | -1.23 | +0.10 |
| HeurEvo (Ours) | -3.36 | -3.19 | -0.82 | +0.45 | -3.80 | +1.40 | -11.60 | -2.25 | +0.12 | -1.32 | -0.04 |
| Variant | C-CVRP | U-CVRP | TSP | BP | OP | Decap | JSS | PFSS | RCPS | Max-Cut | MIS |
| Single island | -4.87 | +2.09 | -0.79 | +0.50 | +4.18 | +1.20 | -6.90 | -2.31 | +0.29 | -1.60 | 0.00 |
| Shared plan | -4.55 | -2.96 | -0.84 | +0.50 | +3.85 | +1.06 | -7.46 | -2.05 | +0.58 | -1.42 | -0.26 |
| Partitioned library | -3.58 | -3.74 | -0.78 | +0.50 | -1.46 | +1.45 | -6.90 | -1.52 | +0.29 | -1.51 | -0.07 |
| HeurEvo (Ours) | -4.38 | -3.48 | -0.70 | +0.69 | -1.94 | +1.90 | -5.52 | -1.85 | 0.00 | -0.85 | +0.14 |
| Collection | Tasks | Train | Val. | Test | Total |
| Synthetic Problems | 11 | 55 | 22 | 44 | 121 |
| MIPLIB-Derived Problems | 6 | 30 | – | – | 30 |
| Total | 17 | 85 | 22 | 44 | 151 |
| Task | Definition, generation details, and references |
|---|---|
| Clustered CVRP | Minimize total distance while serving each customer exactly once using exactly 22 depot-return routes, each carrying at most 55 demand units. There are 120 customers in four Gaussian clusters with coordinate standard deviation 0.08, clipped to the unit square. The depot is at ; customer demands are uniform integers from 1 to 13. Each customer independently chooses a cluster center uniformly from , , , and before its coordinates are sampled. This is our custom clustered generator for the CVRP of Dantzig & Ramser (1959) , not a reproduction of a published instance set. |
| Uniform CVRP | Minimize total distance with complete single-visit service, depot-return routes, and vehicle capacity 50. The 200 customers are sampled uniformly from the unit square, with a depot at and demands uniform on the integers 1–9. The fleet size is fixed for each instance and ranges from 20 to 22 vehicles: where is the number of capacity-50 bins obtained by first-fit decreasing on the demands. Coordinates, demands, depot, and capacity follow the ACO benchmark sampling of ReEvo Ye et al. (2024) ; the exact fleet-size constraint and integer distances are our adaptations. |
| Decap-Placement Proxy | Minimize capacitor cost subject to placing at most one capacitor type at each site and meeting every target’s required cumulative synthetic effect. A grid supplies 900 sites and 900 targets. Four types give 3,600 site–type choices; effects decay with distance inside a type-specific radius. Type contributes when the Euclidean grid distance , and zero otherwise. The four tuples are , , , and . Before rounding, target requires , where is the strongest-type all-site coverage and . Target-weight jitter is uniform on but cancels against inversely scaled base requirements, up to rounding. This covering proxy is inspired by ReEvo’s application Ye et al. (2024) , not its electrical simulator or data distribution; see Section B.2 for the diversity qualification. |
| Job-Shop Scheduling | job_shop_scheduling . Minimize makespan while preserving each job’s operation order and preventing machine conflicts. Operations cannot be interrupted. There are 100 jobs and 20 machines (2,000 operations). Every job visits every machine once in a random order, with processing times uniform on the integers 1–99. This follows Taillard’s random-permutation and processing-time recipe Taillard (1993) , with fresh seeds; the scheduling formulation follows Manne (1960) . |
| Max-Cut | max_cut . Partition the vertices into two sets to maximize the number of crossing edges Goemans & Williamson (1995) . Each graph has 2,000 vertices and 10,882–11,072 edges. Our hybrid generator combines Barabási–Albert-style preferential attachment Barabási & Albert (1999) , initialized with a five-vertex clique and attachment parameter 4, with an independent Erdős–Rényi edge overlay at Erdős & Rényi (1959) ; Gilbert (1959) . Duplicate edges are merged; all stored edge weights equal one. This is our custom combination of the two graph models. |
| Maximum Independent Set | maximum_independent_set . Maximize the cardinality of a vertex subset containing no adjacent pair. Each preferential-attachment graph has 1,500 vertices and 11,964 edges, uses attachment parameter 8, and starts from a nine-vertex clique. We follow the preferential-attachment principle of Barabási & Albert (1999) with this explicit initialization and use the unweighted independent-set objective Nemhauser & Trotter (1975) . |
| Problem ID | Definition and instance configuration |
|---|---|
| comp12-2idx | Coursescheduling. Schedule all required lectures into available periods while avoiding course conflicts and respecting the number of rooms. Minimize penalties for room-capacity shortfalls, insufficient teaching-day spread, and isolated curriculum lectures. There are 88 courses, 218 lectures, six days with six periods each, 11 rooms, 146 curricula, and 519 course-conflict pairs. |
| comp21-2idx | Coursescheduling. Solve the same time-assignment problem and three-part penalty objective, with a different timetable, room inventory, and curriculum structure. Room capacities are represented by capacity thresholds and penalized shortfalls. There are 94 courses, 327 lectures, five days with five periods each, 18 rooms, 78 curricula, and 302 conflict pairs. |
| graphdraw-grafo2 | Graphdrawing. Place entities at integer coordinates inside their permitted windows, enforcing size-dependent non-overlap and consistent directional relations. Minimize weighted connection-distance terms plus deviation from preferred anchors. This is the entity-placement phase of graph drawing, with 67 entities, 73 connections, and 2,211 entity pairs. All edge weights equal 122. |
| graphdraw-mainerd | Graphdrawing. Solve the same entity-placement problem on a smaller graph, with placement windows, pairwise separations, directional consistency, and centering terms. There are 31 entities, 33 connections, and 465 entity pairs. All edge weights equal 126. |
| opm2-z12-s8 | Mining-projectselection. Select mining blocks/projects to maximize total net present value. Selecting a project requires selecting its predecessors, and the total use of each resource must respect its capacity. There are 10,800 binary project decisions, eight resources, and 319,500 dependency arcs. Every resource has capacity 3,704,832. |
| sct32 | PCBassembly-lineconfiguration. Assign each operation’s full workload across eligible workstation options, using binary decisions on discrete lanes and fractional assignments where permitted. Minimize staffing cost minus weighted checkpoint performance and discrete-routing rewards, subject to capacities, checkpoint constraints, priority-token eligibility and budget, and policy checks. There are 552 operations, ten workstation options, seven board variants, 27 checkpoints, 67 policy checks, and a priority-token budget of six. |
| Problem | Variables | Linear constraints | General constraints | Key instance parameters |
|---|---|---|---|---|
| C-CVRP | 14,640 | 14,522 | 0 | 120 customers; 22 vehicles; capacity 55 |
| U-CVRP | 40,400 | 40,202 | 0 | 200 customers; 20–22 vehicles; capacity 50 |
| OP | 250,498 | 250,501 | 0 | 500 nodes; travel budget 8,944 |
| TSP | 122,499 | 122,152 | 0 | 350 nodes |
| JSSP | 101,001 | 201,900 | 0 | 100 jobs; 20 machines; 2,000 operations |
| PFSSP | 12,000 | 4,081 | 0 | 100 jobs; 20 machines |
| Problem Name | Size Configurations |
| circle_packing_square | |
| circle_packing_rectangle | |
| distance_ratio | ; |
| hexagon_packing |
| Annotation | Description |
| Shared Program Database of retained, validated programs. | |
| All retained programs from island , including earlier plans. | |
| Parent-eligible programs under the current plan generation. | |
| Available inspiration programs for island . | |
| Training set and per-instance execution budget. | |
| Instance fitness and average training fitness; larger is better. |
| Call category | Operators |
| System functions | SelectIsland , SelectCode , RestartIsland , UpdateState , SelectComponents |
| Agent-response calls | ImprovePlan , CodePlan , ImproveCode , Interpret , ImproveComponents |