# A New Centralized Clustering Algorithm for Wireless Sensor Networks
## 3 Proposed Method
### Cluster Head Election Algorithm  
As previously commented, the BS rules the network in a round-based schedule to minimize the message exchange necessary to decide the CHs and, as a result, the energy consumption of the nodes is reduced.  
The overall process has two main phases: an initial setup phase and an operation round-based phase. This rounds-based scheduling must be synchronized with the desired event detection or measurement rate in order to fullfil the application requirements. Hence, the duration of any round must be carefully set to effectively detect the events or measure the physical magnitude under study. However, the time chosen for a round does not impact on the proposed algorithm because the energy spent in idle periods or node measurement is taken into account by variables \(R_{i}\) and \(DDE_{i}\) respectively. Thus, the design of the algorithm allows that the WSN has an effective adaptation to the timing requirements.  
Initial Setup  
In the initial phase, the BS broadcasts a startup message to all the nodes in the covered area. Next, the nodes send to the BS a message at maximum power so that the BS candetermine the distance of each node to it. For this determination, the Received Signal Strength Indicator (RSSI) is used. Due to the method design, the exact position, and its corresponding hardware, is not needed as the system can work with an approximation thanks to the Type-2 fuzzy system. All the nodes hear this message and their replies so that they can compute the distances to the rest of the nodes too. In this way, in a future phase they can decide which node is the nearest CH.  
Figure 5: Proposed algorithm.  
This is the first step of the operation phase. The BS computes the score value for all the nodes with the T2 FIS. For previous CHs, the score corresponds to the lower limit in the output interval obtained by the T2 FIS. Alternatively, for non-CHs, the score is the higher limit of the T2 FIS output. With this selection of the score, we aim at assigning the role of CHs to most nodes during the complete WSN lifetime. In this way, a fair energy consumption is possible. Once the BS computes all the scores, it selects the best \(k\) nodes (according to their scores) to nominate them as CHs with a future message. The value of \(k\) indicates the optimal number of cluster heads. It was established in the 5% of the total number of nodes as was recommended in [4].  
Cluster Configuration  
The BS sends a broadcast message indicating which nodes are CH to all the nodes. With this message, the nodes join to the closest CH. The number of nodes in a cluster is not the same for all the structures, so the proposal is considered an unequal clustering method. The nodes joining a cluster adjusts their power transmission in order to just communicate with their corresponding CH.  
Data Gathering  
With this information, the rest of the nodes will send their information to the nearest CH. Each CH aggregates the data from the ascribed nodes, in such a way that it can also inform the BS if a node is not ascribed (death of a node). Additional information about the residual energy is also sent, so that the BS does not have to estimate those values for a future CH selection.  
Skip Loop Iteration  
In our proposal all the nodes are maintained as CHs during a \(skip\) number of rounds. In this phase, the BS updates a counter each time it receives information from the CHs. Once the counter equals the \(skip\) value, the BS steps on a new calculation of the scores of each node to restart the operation phase.