Maximum iteration (Max-iter), maximum number of search agents (N max) number of search agents (N), number of dimensions (d), upper bound and lower bound of variables. Initialize the dragonflies’ populations (X). Initialize the step vectors (ΔX)
while maximum iterations not done
For each dragonfly calculate fitness value
If Fitness Value < DA-pbest
In this iteration move the current value to DA-pbest matrix
End if
if fitness value < DA-
set current value as DA-
End if
End
For each dragonfly
Update the food source and enemy
Update ,s, a, c, f, and e
Calculate S, A, C, F, and E using Equtaions (2)–(6)
Update neighbouring radius
If a dragonfly has at least one neighbouring dragonfly