## 3 Proposed MFA-AOA Algorithm
### Routing Using the Aquila Algorithm
#### 3.5.3 Updating AOA  
As stated in Section 3.3, AOA employs four processes to identify the optimal solution. Equation (11) is utilised in the expanded exploration phase to update the locations of the AOA, and Equation (37) is employed to compute fitness. The process is carried out until the iteration stopping requirement is not met if the updated population's fitness is higher than the previous one. Equations (13), (21) and (22) are also used to update the locations in the other three stages of narrowed exploration, extended exploitation, and narrowed exploitation. The top positions are determined using the best fitness value for each phase. The best optimal path to the BS is discovered once all AOA iterations have been completed. This energy-efficient channel enables sending aggregated data to the BS.  
Algorithm 1 shows the pseudo-code for the proposed hybrid clustering algorithm in MFA-AOA. Initially, a random population \(Q_{0}\) is created and split into two groups: \(Q_{1}\) (MFA) and \(Q_{2}\) (AOA). The whole populations of MFA and AOA (\(Q_{1}\) and \(Q_{2}\)) are assessed by the suggested multi-objective function during each iteration of MFA-AOA. The two populations \(Q_{1}\) and \(Q_{2}\) are then shuffled and reassembled into new \(Q_{1}\) and \(Q_{2}\) populations, which are then chosen at random. The procedure is continued until it reaches the maximum number of iterations. When the proposed MFA-AOA is finished, the algorithm's global best solution is decoded to find the relevant CHs.  
```
#MFA optimization initialize population of male mayflies initialize population of female mayflies  Calculate the fitness and update \(Q_{1 best}\)  Find \(p_{best}\) and \(g_{best}\) while\((iteration<\max\_iteration)\)  Update male mayfly's velocity using Equation (4)  Update female mayfly's velocity using Equation (8)  Perform crossover using Equation (9)  Distinct male and female mayfly  Replace the worst solution with the latest one  Compute the fitness function of the best mayfly using Equation (32)  Update \(p_{best}\) and \(g_{best}\) End while Return \(Q_{1 best}\) #AOA optimization initialize population of \(Q_{2}\): While\(\left(t\leq\left(\frac{2}{3}\right)max_{2}\right)do\)  Calculate fitness and update \(Q_{2 best}\) For (i = 1:M)  IF \(rand<\) 0.4  Update \(Q_{2 neui}\) by using Equation (11) #Extended Exploration Else;  Update \(Q_{2 neui}\) by using Equation (13) #Narrowed Exploration End If  Compute the fitness value of \(Q_{2 neui}\) and \(Q_{2i}\) using Equation (37)  End For  Else: For (i = 1:M)  IF \(rand<\) 0.4  Update \(Q_{2 neui}\) by using Equation (21) # Extended Exploitation Else;  Update \(Q_{2 neui}\) by using Equation (22) # Narrowed Exploitation End If  Compute the fitness value of \(Q_{2 neui}\) and \(Q_{2i}\) using Equation (37)  Update \(Q_{2i}\)  End For  Else if\(t=t+1\) End while Return \(Q_{2 best}\)  Post-process results and discussions
```  
**Algorithm 1**Proposed hybrid MFA-AOA Algorithm  
BS constantly monitors the remaining energy of the nodes to prevent node failure during data transmission. The AOA method finds the best transmission path from the SN to the BS through CH. It finds the shortest way to lower the nodes' energy consumption. This MFA and AOA-based optimum CH selection and route development created an energy-efficient WSN. As a result, an energy-efficient WSN is utilized to increase the total number of packets transferred to the BS at data transmission, extending the network lifetime. Algorithm 1 shows the pseudo-code for the proposed hybrid MFA-AOA algorithm.