Skip to Content
  • Article
  • Open Access

12 November 2025

35 Pages

Clustering-Guided Automatic Generation of Algorithms for the Multidimensional Knapsack Problem

,
,
and
1
Departamento de Ingeniería Informática, Universidad de Santiago de Chile, Santiago 9170124, Chile
2
Faculty of Engineering and Architecture, Universidad Central de Chile, Santiago 8330601, Chile
*
Authors to whom correspondence should be addressed.

Abstract

We propose a hybrid framework that integrates instance clustering with Automatic Generation of Algorithms (AGA) to produce specialized algorithms for classes of Multidimensional Knapsack Problem (MKP) instances. This approach is highly relevant given the latest trends in AI, where Large Language Models (LLMs) are actively being used to automate and refine algorithm design through evolutionary frameworks. Our method utilizes a feature-based representation of 328 MKP instances and evaluates K-means, HDBSCAN, and random clustering to produce 11 clusters per method. For each cluster, a master optimization problem was solved using Genetic Programming, evolving algorithms encoded as syntax trees. Fitness was measured as relative error against known optima, a similar objective to those being tackled in LLM-driven optimization. Experimental and statistical analyses demonstrate that clustering-guided AGA significantly reduces average relative error and accelerates convergence compared with AGA trained on randomly grouped instances. K-means produced the most consistent cluster-specialization. Cross-cluster evaluation reveals a trade-off between specialization and generalization. The results demonstrate that clustering prior to AGA is a practical preprocessing step for designing automated algorithms in NP-hard combinatorial problems, paving the way for advanced methodologies that incorporate AI techniques.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.