isula
A Java Framework for Ant Colony Optimization algorithms.
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: sciencedirect.com -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.9%) to scientific vocabulary
Keywords
Repository
A Java Framework for Ant Colony Optimization algorithms.
Basic Info
- Host: GitHub
- Owner: cptanalatriste
- License: mit
- Language: HTML
- Default Branch: master
- Homepage: https://www.sciencedirect.com/science/article/pii/S2352711019300639
- Size: 1.17 MB
Statistics
- Stars: 42
- Watchers: 7
- Forks: 18
- Open Issues: 5
- Releases: 3
Topics
Metadata Files
README.md
isula
About
Ant Colony Optimisation (ACO) is an algorithmic framework for solving combinatorial optimisation problems. Algorithms in the framework imitate the foraging behaviour of ants. Ants in the wild traverse a terrain looking for food, while depositing pheromones over the path they take. Pheromone is a chemical substance attractive to ants. Efficient ants find shorter paths, making more trips from the food source to the colony than fellow ants on longer routes. This produces an accumulation of pheromone over short paths, getting the attention of the rest the colony. Over time, the whole colony converges towards the shortest path found.
In a similar fashion, artificial ants in ACO algorithms traverse the solution space of an optimisation problem, depositing pheromone over the components of the solution they built. The amount of pheromone is proportional to the quality of their solution, so pheromone accumulates in the most valuable solution components. Over time, ants in the artificial colony converge to high-quality solutions for a given optimisation problem. Isula allows an easy implementation of Ant-Colony Optimisation algorithms using the Java Programming Language. It contains the common elements present in the meta-heuristic, to allow algorithm designers the reutilization of behaviors. With Isula, solving optimisation problems with Ant Colony can be done in few lines of code.
Usage
Setup
The code uploaded to this GitHub Repository corresponds to a Maven Java Project. As such, it is strongly recommended that you have Maven installed before working with Isula.
You can use Isula as a dependency on your own Ant Colony Optimization project, by adding the following
to your pom.xml file:
```xml
Algorithm Configuration
To solve a problem with an Ant-Colony Optimization algorithm, you need a colony of agents (a.k.a. ants), a graph representing the problem, and a pheromone data-structure to allow communication between these agents. Isula tries to emulate that pattern:
```java
TspProblemConfiguration configurationProvider=new TspProblemConfiguration(problemRepresentation);
AntColony
AcoProblemSolver<Integer, TspEnvironment> solver=new AcoProblemSolver<>();
solver.initialize(environment,colony,configurationProvider);
solver.addDaemonActions(new StartPheromoneMatrix<Integer, TspEnvironment>(),
new PerformEvaporation<Integer, TspEnvironment>());
solver.addDaemonActions(getPheromoneUpdatePolicy());
solver.getAntColony().addAntPolicies(new RandomNodeSelection<Integer, TspEnvironment>());
solver.solveProblem();
```
That's a snippet from our Travelling Salesman Problem solution. Some things to notice there:
- Problem and algorithm configuration are provided by
ConfigurationProviderinstances. Make your own with the values you need. - The class that does most of the job is
AcoProblemSolver. In this case, we're using the same one provided by the framework but you can extend it to suit your needs. - The
ProblemSolverneeds anEnvironmentthat manages the problem graph and the pheromone matrix. You need to extend theEnvironmentclass provided by the framework to adjust it to your problem. - And we need an
AntColony. TheAntColonymain responsibility is to create Ants, and make them built solutions in iterations. The baseAntColonyclass makes implementing this very easy. - The heart of the algorithm is the
Antclass. You will need to define anAntthat suits your needs. - Isula supports daemon actions (global behaviors) and ant-level policies, such as the ones present in
multiple ACO Algorithms. You can add daemon actions to a solver via the
addDaemonActionsmethod and ant policies to a colony via theaddAntPoliciesmethod. - Finally, you call the
solveProblem()method and wait for the best solution to be obtained.
Isula Workflow
Here is a sequence diagram of the solveProblem() method, for you to get an idea on how isula works:
Isula will provide you the basic execution flow for an algorithm in the ACO metaheuristic. Usually, you
can rely on the implementations already available for AcoProblemSolver and AntColony but you are free to override
and extend in case you need it. Take in mind that you will need to create your own Ant instance for
custom problems, however the base implementation already contains a lot of functionality available.
If you need some reference, please take a look to the projects on the "Examples" section.
Every ACO algorithm has a set of customized behaviours that are executed during the solution processes: this behaviours
can have global impact (DaemonAction instances, like pheromone update rules) or only affect an ant and its solution
(like component selection rules: they are subclasses of AntPolicy). Isula already provides these behaviours for some
representative algorithms (take a look at the isula.aco.algorithms package) ,but you might need to define
your own policies or extend the ones already available.
Examples
If you are not familiar with the framework, a good place to start is the classic Travelling Salesman Problem:
- The Travelling Salesman Problem, using Ant System.
- The Travelling Salesman Problem, using Ant Colony System.
Here are some advanced examples of optimization problems solved with Isula-based algorithms:
- Flow-Shop Scheduling Problem, using Max-Min Ant System.
- Unicost Set Covering Problem, using a parallelization strategy
- Binary Image Segmentation using Ant System.
- Image Clustering using Max-Min Ant System
Resources
- The JavaDoc of every class on the framework.
- Our paper in the SoftwareX journal, for an in-depth discussion of the framework and its features.
- A video of our tutorial at GECCO 2022, where we describe how to use Isula to solve the Unicost Set Covering Problem.
- A Medium article, discussing how to solve the Travelling Salesman Problem using brute-force and an Isula-based ACO algorithm.
- A CodeProject article, where Ant Colony Optimization algorithms are discussed and Isula is used to implement them.
Support
Feel free to contact me via email, or create a GitHub Issue here.
Owner
- Name: Carlos Gavidia-Calderon
- Login: cptanalatriste
- Kind: user
- Location: London, United Kingdom
- Company: @alan-turing-institute
- Website: https://carlos.gavidia.me/
- Twitter: cptan_alatriste
- Repositories: 74
- Profile: https://github.com/cptanalatriste
Systems engineer by training, software developer by trade. Research Software Engineer at @alan-turing-institute .
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Gavidia-Calderon"
given-names: "Carlos"
orcid: "https://orcid.org/0000-0002-6136-0566"
- family-names: "Beltran Castanon"
given-names: "Cesar"
orcid: "https://orcid.org/0000-0002-0173-4140"
title: "Isula: A Java Framework for Ant Colony Optimization algorithms"
version: 2.1.6
url: "https://github.com/cptanalatriste/isula"
preferred-citation:
type: article
authors:
- family-names: "Gavidia-Calderon"
given-names: "Carlos"
orcid: "https://orcid.org/0000-0002-6136-0566"
- family-names: "Beltran Castanon"
given-names: "Cesar"
orcid: "https://orcid.org/0000-0002-0173-4140"
doi: "https://doi.org/10.1016/j.softx.2020.100400"
journal: "SoftwareX"
start: 100400
title: "Isula: A java framework for ant colony algorithms"
volume: 11
year: 2020
GitHub Events
Total
- Watch event: 3
- Pull request event: 1
Last Year
- Watch event: 3
- Pull request event: 1
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 6
- Total pull requests: 1
- Average time to close issues: almost 2 years
- Average time to close pull requests: N/A
- Total issue authors: 3
- Total pull request authors: 1
- Average comments per issue: 1.67
- Average comments per pull request: 1.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- cptanalatriste (3)
- drissDean (2)
- arcanefoam (1)
Pull Request Authors
- dependabot[bot] (2)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- org.apache.commons:commons-lang3 3.0
- org.apache.commons:commons-math3 3.6.1
- junit:junit 4.4 test
- actions/checkout v3 composite
- actions/setup-java v3 composite
- actions/upload-artifact v3 composite
- actions/checkout v3 composite
- actions/setup-java v3 composite
- s4u/maven-settings-action v2.6.0 composite
- actions/checkout v3 composite
- actions/setup-java v3 composite