From: Study on optimization of communication network for multi-unmanned aerial vehicles
The algorithm of the UAV location deployment algorithm based on k-means++. |
---|
Input: Number of UAV and user location coordinates. |
Output: Horizontal position coordinates of UAV. |
1. Given the k value of UAV to be deployed. |
2. Initializes the location coordinates of the user to be covered. |
3. The location of a user was randomly selected as the location of the first cluster center. |
4. Go through all users, and get the horizontal distance from all the users to current cluster centers, then select the shortest distance as Li. |
5. The probability of this user that can be selected as the cluster center is calculated as: Pi = Li2/ΣLi2. |
6. The new cluster center is determined according to the probability Pi that the user is selected. |
7. Perform steps from 4 to 6 until the k initial cluster centers are determined. |
8. The distance between each user and the other cluster centers is calculated. |
9. Select the cluster closest to the user and add the user to the list of the cluster. |
10. All clusters were traversed and the average of the user coordinates within the cluster list was calculated. |
11. The mean values of coordinate were taken as the new cluster center coordinates. |
12. Return to step 8 until the cluster center coordinates unchanged or the number of iterations is reached. |
13. End. |