Skip to main content
. 2022 Dec 12;22(24):9731. doi: 10.3390/s22249731
Algorithm 3: DCK-LEACH algorithm
(1) Initializing network parameters
(2) For each round
(3)     If it is the first round (r = 1)
(4)        Run Canopy optimized K-means algorithm to get each cluster
(5)        For each cluster
(6)          Select the primary cluster-head
(7)          Select the vice cluster-head
(8)       Broadcast the formed cluster information to all nodes via the base station
(9)       For nodes in the network {
(10)         Nodes send data to their primary cluster-heads in that cluster
(11)         The primary cluster-head fuses data and then sends the data to the vice
cluster-head.
(12)         The vice cluster-head forwards the data to the base station}
(13)    Else
(14)       If r mod (1/p) == 0
(15)         All nodes send their positions and residual energy to the base station.
(16)         Run again (4) to (12).
(17)       Else
(18)         The network runs without re-clustering
(19) All nodes are dead.
(20) End