Repository for some of my solved tasks for a college course titled Biologically Inspired Algorithms.
The function extremes directory contains test function definitions in functions.py and some basic global extreme-searching algorithms defined in main.py, or algorithms using swarm logic defined in swarms.py.
The travelling salesman folder contains point definitions in cities.json and two algorithms that use them.
- Blind search
- Hill climb
- Simulated annealing
- PSO (Particle Swarm Optimisation)
- Firefly swarm
- Differential
- Genetic
- ACO (Ant Colony Optimisation)
Python 3.7 or newer, Matplotlib
Uncomment one of the bottom runFunction lines in main.py or swarms.py. The first argument is the test function, second is a tuple of the function limits, and the third is the algorithm class to use in solving it.
Open either genetic.py or aco.py and run it. Optionally, you can limit the city count (to make the algorithm run faster) by changing the cityCnt variable to a non-negative number.