https://github.com/samashi47/metaheuristics
Implementation of various metaheuristic algorithms in C++ and Python
https://github.com/samashi47/metaheuristics
ant-lion-optimizer cpp genetic-algorithm grey-wolf-optimizer metaheuristics multi-verse-optimizer optimization python3 simulated-annealing tabu-search
Last synced: 7 months ago
JSON representation
Implementation of various metaheuristic algorithms in C++ and Python
- Host: GitHub
- URL: https://github.com/samashi47/metaheuristics
- Owner: Samashi47
- Created: 2024-02-28T21:26:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-06T10:52:36.000Z (about 1 year ago)
- Last Synced: 2025-02-05T02:55:53.836Z (8 months ago)
- Topics: ant-lion-optimizer, cpp, genetic-algorithm, grey-wolf-optimizer, metaheuristics, multi-verse-optimizer, optimization, python3, simulated-annealing, tabu-search
- Language: C++
- Homepage:
- Size: 18.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Metaheuristics
This repository contains code and resources for a university course on Metaheuristics and stochastic search algorithms.
### Author: Ahmed Samady
### Supervised by: Pr. Khalid Jebari## Overview
The purpose of this repository is to provide implementations of various metaheuristic algorithms in Python and C++. It covers topics such as Genetic Algorithms, Simulated Annealing, Multi-Verse Optimizer, and more.
## NoteThe Python implementations in this repository for GWO [[1]](#1)[[2]](#2), MVO [[3]](#3)[[4]](#4), and ALO [[5]](#5)[[6]](#6) are adapted from the MATLAB implementations by Dr. Seyedali Mirjalili.
### Optimization Algorithms| Algorithm | Python | C++ |
|-----------------------|--------------------|--------------------|
| Genetic Algorithms (incomplete) | :x: | :white_check_mark: |
| Tabu Search | :x: | :white_check_mark: |
| Simulated Annealing | :x: | :white_check_mark: |
| Grey Wolf Optimizer | :white_check_mark: | :x: |
| Multi-Verse Optimizer | :white_check_mark: | :x: |
| Ant Lion Optimizer | :white_check_mark: | :x: |## Getting Started
To get started with this repository, follow these steps:
Clone the repository:
```bash
git clone -b main --single-branch [https://github.com/Samashi47/Metaheuristics]
```
Navigate to the directory of the cloned repository:
```bash
cd Metaheuristics
```
### Python
Create a virtual environment in the repository by typing the followwing command:
```bash
python -m venv /path/to/repo/on/your/local/machine
```
After cloning the project and creating your venv, activate the venv by:```bash
.venv\Scripts\activate
```
You can run the following command to install the dependencies:
```bash
pip3 install -r requirements.txt
```
> [!NOTE]
> You should run the main scripts of the ALO, GWO, and MVO algorithms from the base directory so that they can access the common folder that has the Utils class in it (e.g. `python '.\Grey Wolf Optimizer\main.py'`).### C++
Compile the C++ files. For example, to run the `Simulated Annealing` implementation, you can compile the `sa.cpp` file in the `Simulated Annealing` folder using g++:
```bash
g++ -o sa sa.cpp
```
Run the compiled file:
```bash
./sa
```
## ContributingContributions to this repository are welcome. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
## Contact
For any questions or inquiries, please contact the owner of this repository or open an issue.
Happy coding!
## Cite me
### Bibtex generic citation
```txt
@misc{Samady,
title={Samashi47/metaheuristics: Implementation of various metaheuristic algorithms in C++ and python},
url={https://github.com/Samashi47/Metaheuristics},
journal={GitHub},
author={Samady, Ahmed}
}
```
### APA7
```txt
Samady, A. Samashi47/metaheuristics: Implementation of various metaheuristic algorithms in C++ and python. GitHub. https://github.com/Samashi47/Metaheuristics
```
## References[1] Seyedali Mirjalili (2024). Grey Wolf Optimizer (GWO) [MATLAB Central File Exchange](https://www.mathworks.com/matlabcentral/fileexchange/44974-grey-wolf-optimizer-gwo). Retrieved April 22, 2024. \
[2] Mirjalili, S., Mirjalili, S. M., & Lewis, A. (2014). Grey Wolf Optimizer. Advances in Engineering Software, 69, 46–61. doi:10.1016/j.advengsoft.2013.12.007 \
[3] Seyedali Mirjalili (2024). Multi-Verse Optimizer (MVO) [MATLAB Central File Exchange](https://www.mathworks.com/matlabcentral/fileexchange/50112-multi-verse-optimizer-mvo). Retrieved April 22, 2024. \
[4] Mirjalili, S., Mirjalili, S. M., & Hatamlou, A. (2015). Multi-Verse Optimizer: a nature-inspired algorithm for global optimization. Neural Computing and Applications, 27(2), 495–513. doi:10.1007/s00521-015-1870-7 \
[5] Seyedali Mirjalili (2024). Ant Lion Optimizer (ALO) [MATLAB Central File Exchange](https://www.mathworks.com/matlabcentral/fileexchange/49920-ant-lion-optimizer-alo). Retrieved April 22, 2024. \
[6] Mirjalili, S. (2015). The Ant Lion Optimizer. Advances in Engineering Software, 83, 80–98. doi:10.1016/j.advengsoft.2015.01.010 \