# Bio-Inspired Algorithms for Efficient Clustering and Routing in Flying Ad Hoc Networks
## 4 HMAO Algorithms
### Routing Phase
The simulated network environment comprised six distinct scenarios with varying UAV configurations that are capable of ad hoc communication within a 3D box-shaped area. The UAVs operated under a Gauss-Markov mobility model to account for realistic dynamic movement patterns. Each UAV node was equipped with an IEEE 802.11 ac wireless network interface for ad hoc communication, operating at a transmission power of 20 dBm. The simulation time was set to 120 s, and identical simulation parameters were maintained across all the routing protocols. The simulation parameters are listed in Table 2.

### Results and Discussion

The proposed HMAO algorithm was compared across key performance metrics, including CH count, CH changing ratio, PDR, routing overhead, latency, and energy consumption, to demonstrate its superior performance in FANETs. Figure 4 depicts how the HMAO algorithm maintains an optimal number of CHs as the number of UAVs increases, which is more than that of other algorithms that tend to create extra clusters, thus leading to inefficient energy consumption and instability. The proposed HMAO algorithm significantly enhances the clustering efficiency by selectively forming CHs based on adaptive criteria designed according to the positioning and dynamic conditions of UAVs. This technique reduces redundant CHs, saves energy, and provides stable network connectivity, showing significant improvements in high-mobility environments. Other algorithms, such as MFO, DCM, and MWCRSF, cannot prevent excessive clustering caused by strict clustering conditions. MFO lacks dynamic adaptability, thus causing frequent and energy-hungry re-clustering. DCM and MWCRSF are weak at load \begin{table}
\begin{tabular}{c c} \hline
**Parameter** & **Value** \\ \hline Network size & 2000 m \(\times\) 2000 m \(\times\) 500 m \\ \hline Simulation time & 120 s \\ \hline UAV speed & 10-30 m/s \\ \hline Number of UAVs & 20-100 \\ \hline UAV communication range & 300 m \\ \hline Minimal separation between UAVs & 10 m \\ \hline Mobility model & Gauss-Markov mobility model \\ \hline Air density & 1.23 kg/m\({}^{3}\) \\ \hline Channel model & IEEE 802.11n \\ \hline Inter-cluster carrier frequency & 5 GHz \\ \hline Intra-cluster carrier frequency & 2.4 GHz \\ \hline Acceleration due to gravity & 9.8 m/s\({}^{2}\) \\ \hline Packet size & 512 bytes \\ \hline Packet generation model & Constant bit rate (GRR), 2 Mbps \\ \hline Initial energy per UAV & 2000 \\ \hline Energy consumption model & Communication energy \\ \hline Electronic energy per Bit & 50 nl/bit \\ \hline Amplification energy (Long range) & 0.01 pl/bit/m\({}^{4}\) \\ \hline Amplification energy (Short range) & 100 p/bit/m\({}^{2}\) \\ \hline \end{tabular}
\end{table} 
Table 2: Simulation parameters. balancing and optimal CH selection. Shifting network demands result in decreased network stability and higher energy consumption. Figure 5 shows that the low CH change ratio in the proposed HMAO is due to its adaptive and stable clustering mechanism, which reduces the frequent re-election of cluster heads. In HMAO, this selection process of CHs depends on long-term factors, such as UAV stability, energy levels, and connectivity. In addition, HMAO adapts dynamically to minor changes without constantly reconfiguring the clusters. This maintains a stable CH structure and reduces the overhead from the frequent CH switches. HMAO achieves a high PDR as its predictive routing mechanism, using global information through the AO, ensures stable paths, and minimizes packet loss even with an increasing number of UAVs. HMAOCC focuses on selecting stable CHs using MGO but lacks the adaptive, global perspective provided by the AO in HMAO. This limitation leads to a lower PDR in dynamic scenarios where rapid UAV movement results in frequent link changes. MWCRSF uses weighted metrics for clustering based on mobility, but it does not adapt routes dynamically to global conditions.