| Algorithm 2: Cluster Formation |
| Input:, i = 1, 2, …, j = 1, 2, …, K. |
| Output: Cluster , j = 1, 2, …, K. |
| 1: for each do |
| 2: Compute (the distance between the UAV and all CH within its communication range) |
| 3: if the UAV has a minimum distance from then |
| 5: end if |
| 6: end for |
| , j = 1, 2, …, K. |