Python package with a variety of implementations of ant-based algorithms for the optimisation of problems that can be represented as grarphs.
The antco package provides a set of computational tools as well as algorithms already implemented in Cython/Python for graph-based optimisation problems using ant-colony optimisation algorithms.
This package has been designed with the idea of providing the user with the flexibility to tackle complex problems using ant-based metaheuristics, a strategy that has proved highly successful for solve a wide variety of complex problems.
For more information about the module and its components, consult the Wiki pages.
Requirements:
- numpy~=1.18.1
- joblib~=1.0.0
- cython~=0.29.21
- matplotlib~=3.3.1
- deap~=1.3.1
- seaborn~=0.11.0
- networkx~=2.5
These are the versions with which the library has been developed, others different from those presented may work properly.
The simplest way to install the library is via pip:
pip install antco
Sometimes the Cython code compilation may give errors using this installation method, depending on the platform. If errors appear the alternative version (also the most updated one) is installed as follows:
git clone https://github.com/FernandoGaGu/Ant-Colony-Optimisation.git
and after cloning the repository run the setup.py script to compile the code written in Cython using:
cd ./Ant-Colony-Optimisation
python setup.py build_ext -i
At this point you may get warnings related to "Using deprecated NumPy API..." which can be ignored.
Once the above installation is done, you can use the antco library in your scripts by adding the path where it is located:
import sys
sys.path.append('<PATH TO Ant-Colony-Optimisation DIRECTORY>')
import antco
Or, alternatively, you can install the library locally without having to worry about adding the path in the code via:
pip install -e .
(this last command must be executed inside the cloned GitHub repository)
The dynamics of this package is quite simple, it is only necessary to define the problem and select the hyperparameters with which to run the optimisation. For more information on how to use this library, see the example (examples.) codes or consult the Wiki pages where the module's operation is explained.
The code used, although it has been reviewed and tested with different test problems where it has been shown to lead to correct solutions, is still under development and it is possible to experience undetected bugs. If any errors appear, please report them to us via issues 🙃.