View full-text article in PMC Sensors (Basel). 2024 Dec 26;25(1):72. doi: 10.3390/s25010072 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 1: HAMO-based clustering. Input: Number of UAVs N, 3D positions of UAVs Pi=(xi,yi,zi), velocity of UAVs (Vxi,Vyi,Vzi), UAV residual energy E(i), and maximum energy level of UAVs Emax. Output: Initial clusters Ck with CHs # Step 1: Initialize population 1: for each UAV i in {1, 2, …, N} do: 2: initialize UAV[i] with: 3: ID: IDi, Pi=(xi,yi,zi), (Vxi,Vyi,Vzi), and E(i) 4: end for # Step 2: Initial cluster assignment 5: for each UAV i in {1, 2, …, N} do: 6: Calculate distance dij, between UAV[i] and all other UAVs j using (1) 7: Assign UAV[i] to the nearest cluster Ck based on dij8: end for # Step 3: CH selection using local information9: for each cluster Ck do:10: for each UAV i in Ck do:11: Calculate fitness score for UAV i based on (11)12: Select the UAV with maximum fitness score FCHi as CH13: end for# Step 4: Output summary of cluster formation14: Output the list of clusters Ckwith their corresponding CHs