Supplementary Source Code to the Book: Handbook of Metaheuristic Algorithms: From Fundamental Theories to Advanced Applications
This repository holds the supplementary source code to the book Handbook of Metaheuristic Algorithms: From Fundamental Theories to Advanced Applications. It contains an implementation of a set of metaheuristic algorithms, in both C++ and Python, for solving five different optimization problems; namely, the onemax (0-es/1-onemax and 1-onemax), deceptive (0-es/2-deception and 2-deception), traveling salesman (3-tsp), single objective bound constrained (4-function), and data clustering (6-clustering) problem. Moreover, the directory 5-eval contains an implementation of the code for the interpretations and analyses of simulation results.
-
0-es
- exhaustive search (ES) for the onemax and deceptive problems
-
1-onemax
- hc.h: hill climbing (HC) that generates a new solution by moving the current solution left (-1) or right (+1)
- hc_r.h: hill climbing (HC) that is derived from hc.h to make it generate a new solution randomly, by jumping from the current solution to another that is not limited to the solution to the left or right of the current solution
- sa.h: simulated algorithm (SA)
- sa_refinit.h: simulated algorithm (SA) with a refined initial solution
- ts.h: tabu search (TS)
- ga.h: genetic algorithm (GA) that uses tournament selection and one-point crossover
- gar.h: genetic algorithm (GA) that is derived from ga.h to use roulette wheel selection
- gax2.h: genetic algorithm (GA) that is derived from ga.h to use two-point crossover
- gaxu.h: genetic algorithm (GA) that is derived from ga.h to use uniform crossover
- se.h: search economics (SE)
-
2-deception
- hcdp.h: hill climbing (HC) that is derived from hc.h for a deceptive problem
- hcdp_r.h: hill climbing (HC) that is derived from hcdp.h to make it generate a new solution randomly, by jumping from the current solution to another that is not limited to the solution to the left or right of the current solution
- sadp.h: simulated algorithm (SA) that is derived from sa.h for a deceptive problem
- tsdp.h: tabu search (TS) that is derived from ts.h for a deceptive problem
- gadp.h: genetic algorithm (GA) that is derived from ga.h for a deceptive problem
- gardp.h: genetic algorithm (GA) that is derived from gar.h for a deceptive problem
-
3-tsp
- aco.h: ant colony optimization (ACO)
- ga.h: genetic algorithm (GA) with modified one-point crossover (MOPC)
- gapmx.h: genetic algorithm (GA) that is derived from ga.h to use partially-mapped crossover (PMX)
- gacx.h: genetic algorithm (GA) that is derived from ga.h to use cycle crossover (CX)
- gaox.h: genetic algorithm (GA) that is derived from ga.h to use order crossover (OX)
- pga.h: master-slave parallel genetic algorithm (MSP-GA)
- hga.h and sa.h: hybrid genetic algorithm (HGA) that combines GA and SA
- gals.h: genetic algorithm (GA) with 2-opt
-
4-function
-
6-clustering
-
5-eval
- convergence curves using gnuplot
- histograms using gnuplot
Please modify the hyperlink(s) at the end of each chapter in the book so that each becomes "https://github.com/cwtsaiai/metaheuristics_2023/tree/main/src/...," as required by GitHub!
-
Chapter 3: es_main.cpp, es_search.h, es_search.cpp, main.cpp, hc.h, lib.h, and hcdp.h
-
Chapter 8: aco.h
-
Chapter 9: pso.h and functions.h
-
Chapter 11: sa_refinit.h, ga.h, and ga.h
-
Chapter 14: pga.h
-
Chapter 16: gals.h
-
Chapter 17: prega.h
-
Chapter 18: se.h
-
Appendix A: hcsa-10-100-o.gp, hcsa-10-100-1-o.gp, result-aco-tsp-eil51-1-o.gp, ga.h, gax2.h, and gaxu.h
- To clone the repository, type
git clone https://github.com/cwtsaiai/metaheuristics_2023.git
- To compile the C++ code, change to the directory src/c++ first and then type
make clean dep all
- To run a program, say, sa in 1-onemax, type either
./1-onemax/search sa 100 1000 10 "" 0.00001 1.0
to get the results or
./1-onemax/search sa
to get a help message about the parameters that you should be given to the program, as shown below.
Usage: ./search <algname> <#runs> <#evals> <#patterns> <filename_ini> <min_temp> <max_temp>
If you use code in this repository, please cite the book, as follows:
@Book{Tsai-2023,
title = "{Handbook of Metaheuristic Algorithms: From Fundamental Theories to Advanced Applications}",
author = "Chun-Wei Tsai and Ming-Chao Chiang",
year = "2023",
publisher = "Elsevier"
}
Copyright (c) 2022-2023 Chun-Wei Tsai and Ming-Chao Chiang
All rights reserved.
This work (the supplementary code in this repository) is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.