# An Energy-Aware Method for Selecting Cluster Heads in Wireless Sensor Networks
## 3 Proposed Method
### Obtain a Set of Cluster Heads by Using the AHP Algorithm  
To organize and analyse complex decisions, we utilize the AHP method as a structured technique based on the mathematics model [27]. This method first decomposes the decision problem into a hierarchy of easier sub-problems, and we can analyse each of these sub-problems separately. Furthermore, according to each factor's importance, this method tries to find the best answers for the sub-problems. In this paper, we take advantage of the AHP method to select the most appropriate cluster head. In fact, AHP prioritizes the nodes to determine the highest sensor nodes' priority as the cluster head. This process is performed in three phases: First of all, a hierarchical structure for the problem is designed. Second, the matrices are created, and the local load of factors or elements is calculated. Third, the results from the two previous steps are combined, and the total load of each node is calculated. In the following, we express these steps as follows:  
Step 1:  
According to Figure 3, the structure consists of goals, decision-making factors, and nodes. The first level is our goal, which is to select the most appropriate cluster head. The second level shows the decision-making factors, and the third level illustrates the nodes. Step 2:  
The local load includes the load of each factor relative to the goal and the load of each candidate node relative to any factor for which both parts can be calculated in the same way. In fact, it is shown by the formation of matrices which factor/element is more important and by how much. Table 2[25] illustrates a fundamental scale, ranked from 1-9. To compare the pair to pair of four factors, a \(4\times 4\) matrix is created where \(a_{\frac{i}{j}}\) is the ratio of the factor load of \(i\) to the factor of load of \(j\). \[A= \begin{bmatrix}a_{\frac{\alpha}{\alpha}}&a_{\frac{\alpha}{\beta}}&a_{\frac{ \alpha}{\gamma}}&a_{\frac{\alpha}{\delta}}\\ a_{\frac{\beta}{\alpha}}&a_{\frac{\beta}{\beta}}&a_{\frac{\beta}{\gamma}}&a_{ \frac{\beta}{\delta}}\\ a_{\frac{\gamma}{\alpha}}&a_{\frac{\gamma}{\beta}}&a_{\frac{\gamma}{\gamma}}&a _{\frac{\gamma}{\delta}}\\ a_{\frac{\delta}{\alpha}}&a_{\frac{\delta}{\beta}}&a_{\frac{\delta}{\gamma}}&a _{\frac{\delta}{\delta}}\\ \end{bmatrix} \]  
\(AW=\lambda_{max}\) is calculated for matrix \(A\) in which \(\lambda\) is the eigenvalue and \(W\) is its corresponding nonzero eigenvector. Moreover, the local load of each factor is computed by \(W^{T}\), and the eigenvector is as Equation (4). \[W^{T}=\left\{W_{\alpha},W_{\beta},W_{\gamma},W_{\delta}\right\} \tag{4}\]  
If for each matrix element, we consider \(a_{\frac{i}{j}}=\frac{1}{a_{\frac{i}{j}}}\) and \(a_{\frac{i}{j}}=a_{\frac{k}{j}}\times a_{\frac{i}{k}}\), matrix \(A\) will be coherent. Moreover, unfortunately, due to random judgements of individuals, evaluation matrices are usually not fully consistent. Therefore, errors in judgements can be detected by a consistency ratio \((CR)\), which is defined as the ratio of the consistency index \((CI)\) to the random index \((RI)\). \(CI\) can be calculated as follows:  
\[CI=\frac{(\lambda_{max}-n)}{n-1} \tag{5}\]  
\[\lambda_{max}=(\frac{1}{n})\sum_{i=1}^{n}\frac{(AW)_{i}}{W_{i}}, \tag{6}\]  
Figure 3: The structure of AHP for cluster head selection. Table 3[25] illustrates the random index \((RI)\). Based on these calculation, if \(CR\leq 0.1\), the difference between opinions is almost good, and \(W\) can be considered as the corresponding component load. Otherwise, the elements of matrix A should be adjusted until matrix A satisfies desirable consistency. \begin{table}
\begin{tabular}{c c} \hline \hline
**Number Rating** & **Rank** \\ \hline Equally & 1 \\ Moderately & 3 \\ Strongly & 5 \\ Very Strongly & 7 \\ Extremely Strongly & 9 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: A fundamental scale (one to nine). The value of 2, 4, 6, and 8 is considered as the average value between the number before and after them.