-
1:
Input the parameters of GGWO
-
2:
for i = 1:npop # create the initial population
-
3:
Create a random solution
-
4:
Calculate the fitness
-
5:
end for
-
6:
Sort the solutions based on the fitness values
-
7:
Set the best three solutions as Alpha, Beta, and Delta, respectively.
-
8:
Set the remaining wolves as Omegas
-
9:
it = 1
-
10:
while stopping criterion is not met # main loop of the algorithm
-
11:
for i = 1: npop
-
12:
Calculate and update A and C
-
13:
Calculate the value of
-
14:
update the position of wolves using Eq. (8)
-
15:
end for
-
16:
Calculate the fitness values of all wolves
-
17:
Update the Alpha, Beta, and Delta
-
18:
for i = 1: number of Omegas
-
19:
update the position of Omega wolves using Eqs. (12) to (13)
-
20:
end for
-
21:
Decrease
-
22:
it = it + 1;
-
23:
end while