| Algorithm 1 Cluster initialization based on improved K-medoids algorithm |
| Input: Location and energy information of T sensor node in in the monitoring sub-network area of
|
| Output: T sensor nodes are allocated to K clusters in the mode of optimal energy consumption |
| Step 1: Determining the optimal clustering group number ; |
| Step 2: Selecting a sensor node as the first cluster center randomly; |
| Step 3: Calculating the distance from each node to the selected cluster center; |
| repeat
|
| for
i = 1, 2, …, k
|
| for
j = 1, 2, …, T − k
|
|
|
| until the distances between all nodes are calculated |
| Step 4: Selecting the k-th () clustering center |
| repeat
|
| for
j = 1, 2, …, T − k
|
| for
i = 1, 2, …, k
|
| ; |
|
|
|
|
| until all cluster centers had been selected |
| Step 5: Initialization of all clusters based on selected cluster centers |
| repeat
|
| for
i = 1, 2, …,
|
| for
j = 1, 2, …, T −
|
|
|
| for
j = 1,2,…,T-
|
| for
i = 1, 2, …,
|
| ; |
| until all sensor nodes are allocated to the cluster with the lowest energy consumption. |