Skip to main content
. 2024 Jan 14;24(2):0. doi: 10.3390/s24020521
Algorithm 1: SWARAM-based CH selection algorithm
Input: Network population size set to ‘n’ nodes and total count of iterations ‘T’
Output: optimal position of osprey acts as CH node.
1: Initialize network population randomly using Equations (1) and (2).
2: The objective function is computed using Equation (3).
3: For t = 1 to T do.
4: For i = 1 to n do.
//exploration phase
5: The fish position is updated for member of OOA using Equation (4).
6: The SF is determined randomly using ith osprey.
7: Osprey’s new position is computed using Equation (8a).
8: The boundary condition is verified using Equation (8b).
9: ith osprey position is updated using Equation (6).
//exploitation phase
10: the new position of osprey is computed using Equation (10a).
11: The boundary condition is verified for new position of osprey using Equation (10b).
12: Update the position of osprey using Equation (8).
13: Evaluate the fitness function using Equation (11).
14: If osprey reaches optimal position in network, then
15:  Best candidate osprey act as CH
16: else
17:  Go to step 1.
18: END for
19: END for
20: Return candidate CH.