This repository contains the implementation of the following optimization methods:
The implemented methods are supposed to work for unconstrained non-linear minimization problems.
You can check the convergence properties of each of the algorithms in their corresponding reference paper.
We slightly changed two conditions w.r.t the original SABC algorithm:
- Stopping criteria: The
ABCalgorithm will stop if it reaches the maximum number of iterations or when a solution does not get improved after a given number of iterations - Scout bees stage: In the
SABCimplementation, the scout bees stage looks for a new solution when theNelder-Meadalgorithm does not improve the best solution among the current ones
This project was written and tested with Python 3.7, so make sure that you have it installed on your system.
The libraries required by the project are listed in the requirements.txt file. You can install them by running:
pip install -r requirements.txtThe core of the project is inside the sabc Python package, which has the following modules:
abeec.py, which contains the implementation of the ABC algorithmamoeba.py, which contains the implementation of the Nelder-Mead algorithmsabeec.py, which contains the implementation of the SABC algorithm
You can run each of the three algorithms separately. To check the required fields, cd into the sabc folder and run:
python3 <alg>.py -hHere, <alg> could be one of abeec, amoeba or sabeec.
n_food_sources: Number of food sources to use inside the given bounds, which represents also the number of employed/onlooker bees (defaults to 100)lower_bounds: List of numbers representing the lower bounds of each variable in the search space, which must have the same size asupper_bounds(they define the dimension of the search space)upper_bounds: List of numbers representing the upper bounds of each variable in the search spacelimit: Trails upper limit before abandoning a food source (defaults to 20)abc_iterations: Maximum number of iterations for theABCalgorithm (defaults to 3000)abc_stop: Maximum number of non-changing best value before stopping the algorithm (defaults to 100)function: Function on with to execute the search (defaults torosenbrock)runtimes: Number of executions, used for statistics purposes (defaults to 1)
-
initial_point: Initial point used to compute the simplex. -
nm_iterations: Maximum number of iterations for theNelder-Meadalgorithm (defaults to 1000) -
tol: Tolerance for the stopping criteria of the algorithm (defaults to$10^{-5}$ ) -
alpha: Coefficient for the reflection operation (defaults to 1) -
beta: Coefficient for the contraction operation (defaults to 0.5) -
gamma: Coefficient for the expansion operation (defaults to 2) -
function: Function on with to execute the search (defaults torosenbrock)
As a combination of the two algorithms it takes all of the parameters described above,
except the initial_point of Nelder-Mead, since it is computed by the ABC procedure.
The benchmark functions you can choose are implemented in the utils.py module:
Below you can find some examples to run the different modules:
python abeec.py 100 '[-10, -10]' '[10, 10]' -l 20 -i 1000 -c 50 -f 'rosenbrock'python amoeba.py '[10, 10]' -i 1000 -f 'rosenbrock'python sabeec.py 100 '[-10, -10]' '[10, 10]' -c 50 -l 20 --nm_iterations 100 --abc_iterations 1000 -f 'rosenbrock'- [1]
Dervis Karaboga and Bahriye Basturk (2007).
Artificial Bee Colony (ABC) Optimization Algorithm for Solving Constrained Optimization Problems.
Erciyes University, Engineering Faculty, The Department of Computer Engineering - [2]
J. A. Nelder and R. Mead (1965).
A simplex method for function minimization.
The Computer Journal, 7(4), 308-313. - [3]
Xufang Zhao, Ximing Liang, Long Wen (2018).
The Artificial Bee Colony Algorithm Improved with Simplex Method.
School of Science, Beijing University of Civil Engineering and Architecture. - [4]
Fuchang Gao, Lixing Han (2010).
Implementing the Nelder-Mead simplex algorithm with adaptive parameters.
Springer Science+Business Media, LLC 2010.