-
1.
Initialize the population,,
//
represents the set of random solutions based on the size and position of relay nodes
-
2.
Initialize WOA parameters(x, X, G, Q and s) and GWO parameters(C, V and c)
-
3.
Calculate the fitness() of each search agent using Equation (1)
// Fitness represents the maximum number of paths covered with minimal relay nodes
-
4.
Selection based on the adapted search algorithm
-
5.
For WOA-based search
-
6.
Find the best solution
-
7.
For GWO-based search
-
8.
Do
-
9.
Separate the solutions based on the fitness
-
10.
= the first best search solution
-
11.
= the second-best search solution
-
12.
= the third best search solution
-
13.
Compare
and
//Select the best solution among
and
pass
to WOA- and GWO-based updating procedures
-
14.
While (
< maximum number of iterations)
-
15.
Do update based on WOA and GWO
-
16.
// WOA-based update
-
17.
For each search agent
-
18.
Update
,
and
-
19.
if1()
-
20.
if2()
-
21.
Update the position of the current search agent by,
-
22.
-
23.
else if2()
-
24.
Select a random search agent ()
-
25.
Update the position of the current search agent by,
-
26.
-
27.
end if2
-
28.
else if1()
-
29.
Update the position of the current search by,
-
30.
-
31.
(where
It means the distance between
whale and prey (i.e., the best solution attained till now);
and
is the constant for defining the shape of the logarithmic spiral)
-
32.
end if1
-
33.
end for
-
34.
Return
//GWO-based update
-
35.
For each search solution
-
36.
Update the current search agent
-
37.
-
38.
where
-
39.
End for
-
40.
Check if any search agent goes beyond the search space and adjust it
-
41.
Calculate the fitness of each search agent (i.e., relay set) obtained through both search algorithms
-
42.
Compare and update
if there is a better solution
-
43.
Store the best solution attained so far
-
44.
-
45.
end while
-
46.
return
-
47.
Stop