Python implementations of two nature-inspired optimisation algorithms — a Genetic Algorithm (GA) and Dispersive Flies Optimisation (DFO) — benchmarked on standard 30-dimensional continuous test functions with multi-run statistical analysis.
ga_optimiser.py— Genetic Algorithm (NumPy) with roulette-wheel selection, arithmetic crossover, Gaussian mutation and elitist truncation. Includes a 10-run experiment with summary statistics and a convergence plot, plus a mutation-rate study (μ = 0.05 / 0.10 / 0.20) on Rastrigin.dfo_optimiser.py— Dispersive Flies Optimisation with ring topology and dimension-wise disturbance, wrapped in a multi-run harness reporting mean / median / min / max / standard deviation.
All implemented in 30 dimensions:
| Function | Type | Global minimum |
|---|---|---|
| Sphere | Unimodal | 0 |
| Rastrigin | Multimodal | 0 |
| Rosenbrock | Valley | 0 |
- Implementing optimisation algorithms from first principles.
- Designing repeatable experiments and reporting performance with proper statistics rather than single lucky runs.
- Clean, documented, dependency-light Python.
pip install -r requirements.txt
python ga_optimiser.py
python dfo_optimiser.pyDeveloped as individual university coursework (COMP1805, Natural Computing). The base GA/DFO lab skeletons were provided by Dr Mohammad Majid al-Rifaie (credited in the file headers); the benchmark functions, experiment harnesses and statistical analysis are my own extensions.
— Sameer Ali