Skip to main content
. 2022 Sep 27;24(10):1366. doi: 10.3390/e24101366
Algorithm 2: Cluster Formation
Input:UAVi, i = 1, 2, …, N, CHj, j = 1, 2, …, K.
Output: Cluster CLj, j = 1, 2, …, K.
1: for each UAVi do
2:   Compute (the distance between the UAV and all CH within its communication range)
3: if the UAV has a minimum distance from CHj then
4:       UAV joins the CLj
5:   end if
6: end for
7: Return CLj, j = 1, 2, …, K.