Dragonfly Algorithm
Dragonfly Algorithm (DA)
- Year introduced
- 2016
- Original authors
- Seyedali Mirjalili
- Source of inspiration
- Static (hunting) and migratory dragonfly swarms
- Search space
- Continuous
- Optimization types
- Feature Selection, Hyperparameter Optimization, Multi-objective Optimization
- Applied research in the repository
- 0
Overview
Each dragonfly's step is updated from five behaviours: separation, alignment, cohesion, attraction to food and distraction from the enemy; their weights are tuned adaptively to move from exploration to exploitation.
Source of inspiration and mechanism

Dragonflies form small swarms that move locally to hunt (static) and large swarms that migrate in one direction (dynamic). The algorithm uses Reynolds' flocking rules.
Initialization
Random positions and steps.
Update mechanism
A velocity-like step update with adaptive weights.
Exploration
Large separation weights and small cohesion at the start.
Exploitation
The cohesion and food weights increase as the neighbourhood radius grows.
Mathematical description
The formula is simplified here; in the original paper Lévy flights are used when an individual has no neighbours.
Step
\Delta X_{t+1} = (sS_i + aA_i + cC_i + fF_i + eE_i) + w\,\Delta X_tS separation, A alignment, C cohesion, F food, E enemy.
Position
X_{t+1} = X_t + \Delta X_{t+1}Computational complexity: O(T\cdot N^{2}\cdot D)
Pseudocode
Initialize positions X and steps dX
for t = 1..T:
update food (best) and enemy (worst); update weights s,a,c,f,e,w and neighbourhood radius
for each dragonfly: compute S,A,C,F,E from neighbours
if it has neighbours: dX = sS+aA+cC+fF+eE + w*dX ; X += dX
else: X += Levy(X)
return foodPython implementation
There is currently no tested python implementation of this algorithm in the lab. We did not include untested code so that it is not used as a reference implementation.
Coefficients
| Parameter | Symbol | Typical value | Range | Description |
|---|---|---|---|---|
| Behaviour weights | s,a,c,f,e | Adaptive | Weights of the five behaviours | |
| Inertia | w | 0.9 → 0.4 |
Advantages
Continuous, binary and multi-objective versions in the original paper.
Limitations
- Quadratic cost for computing neighbours
- Many parameters and weights.
Use in artificial intelligence
Domains documented in the card: Machine learning, Feature Selection, hyperparameter tuning
Continuous optimization, binary and multi-objective problems.
Hybridization potential
These are partnerships suggested theoretically in the card; any resulting design is presented as a "proposed hybrid method" until its results are compared with the literature.
Applied research from the repository
An aspect that did not appear in the current search results within the repository. This does not mean there is no published research outside it.
Related lessons
Original reference
Seyedali Mirjalili (2016). Dragonfly algorithm: a new meta-heuristic optimization technique for solving single-objective, discrete, and multi-objective problems. Neural Computing and Applications, Springer Science and Business Media LLC.
Verified DOI: 10.1007/s00521-015-1920-1
There is no tested Python code for this algorithm in this version.
