# MH-Builder: a C++ framework for designing adaptive metaheuristics for single and multi-objective optimization

Amadeu Almeida Coco, Olivier Caron, Laetitia Jourdan, Marie-Eléonore Kessaci, Nadarajen Veerapen

<figure><img src="image_1.png" /></figure>

## ► To cite this version:

Amadeu Almeida Coco, Olivier Caron, Laetitia Jourdan, Marie-Eléonore Kessaci, Nadarajen Veerapen. MH-Builder: a C++ framework for designing adaptive metaheuristics for single and multi-objective optimization. 26ème édition du congrès annuel de la Société Française de Recherche Opérationnelle et d'Aide à la Décision, ROADEF, Feb 2025, Champs-sur-Marne, France. hal-05234174

HAL Id: hal-05234174

https://hal.science/hal-05234174v1

Submitted on 1 Sep 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

Public Domain
# MH-Builder: a C++ framework for designing adaptive metaheuristics for single and multi-objective optimization

Amadeu A. Coco, Olivier Caron, Laetitia Jourdan, Marie-Éléonore Kessaci, Nadarajen Veerapen

Univ. Lille, CNRS, Centrale Lille, UMR 9189 CRISTAL, F-59000 Lille, France
{amadeu.almeidacoco, olivier.caron, laetitia.jourdan, marie-eleonore.kessaci, nadarajen.veerapen}@univ-lille.fr

**Keywords :** MH-Builder, metaheuristics, framework, optimization.

Heuristics and metaheuristics are essential for solving optimization problems, especially when exact methods are impractical due to resource limitations [8]. These methods prioritize finding satisfactory solutions within a reasonable timeframe rather than optimal ones. However, the lack of standardization across programming languages, data structures, and optimizations limits reproducibility and fair comparison of metaheuristics. Several frameworks exist (such as JMetalPy [2] or ParadisEO [4]) that address this issue by integrating multiple metaheuristics, ensuring fair and consistent evaluations through reproducibility. Despite their strengths, both have static designs and lack a dynamic environment for composing or modifying metaheuristics at runtime. Some work on adaptive metaheuristics issues is emerging [1], but no corresponding framework for reproducibility is currently available.

To overcome these limitations, MH-Builder [6] is an open-source, adaptive C++ framework developed by the ORKAD team at the CRISTAL laboratory of the University of Lille. Designed for single- and multi-objective optimization problems, it was initially created in 2019 to support ORKAD members develop metaheuristics within a unified environment that promotes reproducibility in an adaptive and dynamic setting [3, 5, 7]. In early 2024, it became open-source, broadening its support for researchers in fields like operations research and machine learning. As of November 2024, it had grown to include 248 classes, 525 commits, 144 unit tests, and a team of 10 contributors. Its GitLab repository [6] and documentation are publicly available. With ongoing development, MH-Builder aims to serve as a valuable framework for integrating heuristics and metaheuristics in an adaptive environment.

Like other available frameworks [2, 4], MH-Builder embraces two core principles of software development: modularity and flexibility. These principles are key to designing robust, scalable systems ensuring reproducibility, enhancing user customization and problem-solving capabilities. In MH-Builder, modularity is achieved through C++ templates and operator overloads, enabling easy customization of components. Heuristics and metaheuristics are organized into modular components that can be easily assembled to solve optimization problems. This modular foundation provides the flexibility to tackle both single- and multi-objective optimization problems with minimal code changes.

Building on these principles, MH-Builder stands out with a dynamic architecture that integrates adaptability. All components are configurable and can be exchanged dynamically, enabling users to modify or replace elements at runtime. For instance, users can switch the neighbor search operation (e.g., from the swap operator to 2-opt) or adjust the solution acceptance criteria (e.g., always accepting an improving solution to applying the Metropolis criterion [8]). This adaptability enables MH-Builder to deal effectively with a wide range of optimisation problems. As an extensible framework, it also enables users to define problem constraints and use various ready-to-use metaheuristics, ensuring easy reproducibility of previous studies.

MH-Builder provides a range of heuristics, local searches, and metaheuristics for single- and multi-objective optimization problems. It includes local search operators like swap, insertion,
two-opt, and shift, each manipulating solution elements in unique ways. Users can also control
the neighborhood type, choosing between random and ordered neighborhoods. For single-
objective problems, metaheuristics such as Simulated Annealing, Tabu Search, Iterated Local
Search, and Hill Climbing are available. For multi-objective problems, users can choose between
Multi-objective Local Search and NSGA-II (Non-dominated Sorting Genetic Algorithm) to find
diverse solutions along the Pareto front, with the option to manage the front size using archives
that store non-dominated solutions.

MH-Builder includes classic optimization problems, such as the Travelling Salesman and Flow Shop Scheduling Problems, along with instance sets for users to solve. These features facilitate learning how MH-Builder works and make it suitable for academic studies. Additionally, MH-Builder is a key component of the Multi-Objective Classification Algorithm for Imbalanced Data [5], a supervised machine learning algorithm designed to classify medical data. It was employed to identify hospitalized patients at risk of multi-drug-resistant bacteria. MH-Builder has also been applied in studies examining the impact of diversity on bounded archives for multi-objective local searches [3] and in developing automatic multi-configuration algorithms for combinatorial optimization [7]. These examples highlight MH-Builder's applicability in optimization and machine learning, underscoring its potential for further exploration.

In summary, MH-Builder is an adaptive framework for developing and applying metaheuristics to any type of optimisation problem. Its modularity, flexibility, and adaptability make it a powerful tool for researchers and practitioners in optimization and machine learning. With ongoing development, MH-Builder holds great potential for advancing metaheuristic-based solutions and expanding its applicability to a wide range of optimization problems.

References

[1] B. S. Ahmed. An adaptive metaheuristic framework for changing environments. In *2024 IEEE Congress on Evolutionary Computation (CEC)*, pages 1–10, 2024.

[2] A. Benítez-Hidalgo, A. J. Nebro, J. García-Nieto, I. Oregi, and J. Del Ser. jmetalpy: A python framework for multi-objective optimization with metaheuristics: A python framework for multi-objective optimization with metaheuristics. *Swarm and Evolutionary Computation*, 51:100598, 2019.

[3] A. A. Coco, C. Borée, J. Baste, L. Jourdan, and L. Mousin. Impact of diversity on bounded archives for multi-objective local search. In *25ème édition du congrès annuel de la Société Française de Recherche Opérationnelle et d'Aide à la Décision, Amiens, France*, 2024.

[4] J. Dreo, A. Liefooghe, S. Verel, M. Schoenauer, J. J. Merelo, A. Quemy, B. Bouvier, and J. Gmys. Paradiseo: from a modular framework for evolutionary computation to the automated design of metaheuristics: 22 years of paradiseo. In *Proceedings of the Genetic and Evolutionary Computation Conference Companion*, page 1522–1530, 2021.

[5] J. Jacques, H. Martin-Huyghe, J. Lemtiri-Florek, J. Taillard, L. Jourdan, C. Dhaenens, D. Delerue, A. Hansske, and V. Leclercq. The Detection of hospitalized patients at risk of testing positive to multi-drug resistant bacteria using MOCA-I, a rule-based “white-box” classification algorithm for medical data. *International Journal of Medical Informatics*, 142, July 2020.

[6] L. Mousin, L. Jourdan, M.-É. Kessaci, N. Veerapen, N. Szczepanski, A. Almeida Coco, and C. Olivier. MH-Builder. https://gitlab.cristal.univ-lille.fr/orkad-public/mh-builder.git, 2019–2024.

[7] W. Sae-Dan. *Automatic algorithm multi-configuration for combinatorial optimization*. PhD thesis, Université de Lille, June 2022.

[8] E.-G. Talbi. *Metaheuristics: From Design to Implementation*. Wiley Publishing, 2009.