| 1 | Input: Number of group; K |
|
| Coordinate points of device; |
| 2 | Output: Number of devices in each group; |
| 3 | Random initialization for k-means group centroids; |
| 4 |
|
| 5 | repeat |
| 6 | for do |
| 7 | for do |
| 8 | evaluate |
| 9 |
|
| 10 | end for |
| 11 |
|
| 12 | end for |
| 13 | for do |
| 14 |
|
| 15 | end for |
| 16 | until I iterations |