# A New Centralized Clustering Algorithm for Wireless Sensor Networks
## 3 Proposed Method
### Node Scoring
\] (2) where \(roundsnoCH_{i}\) is zero when the node \(i\) is elected as a CH and is incremented by one in each round in the opposite case. This set of input variables makes the T2 FIS exportable to a wide range of applications because they are application independent. Other parameter such as the on duty or idle periods or the rate of event detection could be considered in the configuration phase but without altering the T2 FIS. As it will be discussed in the next section, the duration of a round could be adjusted for this purpose. These variables, all of them normalized between 0 and 1, are the input of the fuzzy system depicted in Figure 2. Each of these variables are fuzzified with the Type-2 member function layouts that are depicted in Figure 3.  
Figure 2: Block diagram of Type-2 fuzzy logic (T2 FIS). Once they are fuzzified, the values will interrelate between them through the knowledge base that contains the IT-THEN rules of the expert system. Each rule is defined as follows: IF \(R_{i}\) is \(Value_{1}\) and \(D_{i}\) is \(Value_{2}\) and \(DDE_{i}\) is \(Value_{3}\) and \(RnoCH_{i}\) is \(Value_{4}\), THEN \(score_{i}\) is _Output Value_, where \(Values_{1}\), \(Value_{2}\), \(Value_{3}\) and \(Value_{4}\) belong to \(low\), \(medium\), \(high\) as shown in Figure 3. The _Output Value_ belongs to very low (VL), low (L), medium (M), high (H), very high (VH) as illustrated in Figure 4.  
The rule base designed for the proposed method (see Table 1) is composed of 81 rules and, as can be observed, the effect of the qualitative value of each variable in the output score is different. For instance, high values of distance variable \(D_{i}\) affect more negatively in the score than low values of residual energy \(R_{i}\) due to the higher cost of long range communications compared with the threat of a low battery charge. Consequently, if rule 1 (L L L L \(>\) L) is compared with rule 73 (H H L L \(>\) VL), the output scores differ even when they share the same values for \(DDE_{i}\) and \(RnoCH_{i}\). For rule 1, the output is L however being far from the BS is penalized as modelled by rule 73. In rule 73, the output score is VL because \(D_{i}\) is also high (a node far from the BS) even if the node has an almost full battery (\(R_{i}\) is high). In the case of input variable \(RnoCH\), its purpose is trying to achieve a good score even in the worst conditions (low battery and long distances e.g., rules 12, 15 or 21) for nodes that have not been CH for several rounds, whereas \(DDE_{i}\) tries to exclude nodes that are supposed to be bad CHs candidates when the average available energy in the network is still high (e.g., rules 25-27 or 79-80). Figure 4: Output Membership functions of interval Type-2 fuzzy system. Figure 3: Membership functions of interval type-2 fuzzy system. The fuzzy system is a Mamdani one, in which the output variable is also a Type-2 fuzzy set like in Figure 4.  
In the last block of the T2 FIS (see Figure 2), the defuzzification is made and the output interval for the score (\(s_{l}\),\(s_{h}\)), is obtained. Then, the intervals obtained for each node are used by the BS to elect the CHs accordingly to the process outlined in the next section. \begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline
**Rule** & \(\mathbf{R_{i}}\) & \(\mathbf{D_{i}}\) & \(\mathbf{DDE_{i}}\) & \(\mathbf{RnoCH_{i}}\) & **Score** & **Rule** & \(\mathbf{R_{i}}\) & \(\mathbf{D_{i}}\) & \(\mathbf{DDE_{i}}\) & \(\mathbf{RnoCH_{i}}\) & **Score** \\ \hline
1 & L & L & L & L & L & 42 & M & M & M & H & H \\
2 & L