# Game Theoretic Solution for Power Management in IoT-Based Wireless Sensor Networks
## 3 The Proposed Mechanism
### Assessment by Nodes  
Initially, the nodes and the BS design a borderline to distinguish all the \(\alpha\) and \(\beta\) nodes, while taking all the possible parameters and strategies of the nodes. According to Table 3, the preferences are set as:  
A threshold value TE (threshold for eligibility) is set by the BS to filter out the eligible nodes while processing the Algorithm 1. ```
1. FOR EACH Cluster\({}_{ID}\) in N
2. FOR EACH node \(i\) in Cluster\({}_{ID}\)
3. IF \(p_{i}<\mathit{Part}^{\mathit{Thres}}\) then
4. add it to PCH
5. ELSE
6. Calculate \(\text{CANDIDANCY}_{i}=(E_{i}+\mathit{HpL}_{i}+\lambda_{i})*(\frac{1}{f_{0}})\)
7. IF \(\text{CANDIDANCY}_{i}>\mathit{TE}\) THEN
8. add it to \(\alpha\) SET
9. ELSE
10. add it to \(\beta\) SET
11. END IF
12. END IF
13. END FOR
14. END FOR \begin{table}
\begin{tabular}{c c c} \hline \hline
**S\#** & **Factor** & **Impact** \\ \hline
1. & Remaining Energy & A higher level of remaining energy leads to a higher possibility of being \(\alpha\) \\
2. & Selfishness & A node being declared as selfish must be put in PCH \\
3. & Hop Level & Nodes nearer to the BS are considered more suitable for \(\alpha\) set \\
4. & Density & A node having many closed neighbors is preferred as an \(\alpha\) \\
5. & Degree of Connectivity & A node having fb ratio nearer to 1 is suitable for \(\alpha\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Considerations for cluster head (CH) selection. TE is smartly adjusted for each round of CH selection by the BS. The value of TE declines with the passage of time as the nodes exhaust their energies and ultimately die in the network. Algorithm 1 provides the optimal solution because each network node, either CH or CM, is accessed only once to determine its class by checking all its possible parameters. The nodes are scanned only once by using a nested loop, therefore, we can say that Algorithm 1 can be executed optimally at maximum of O(n) times. Where, n is the total number of nodes in the network. Moreover, in Algorithm 1 each cluster is taken and then all the nodes inside that cluster are classified for \(\alpha\), \(\beta\), and PCH. The ultimate result of this Algorithm 1 enables us to determine the suitability of nodes for being CHs. ### Cluster Head Selection

Since the nodes are rational, they can adapt their own strategies to either become CHs or not. The strategy set of node \(i\) can be \(\mathcal{S}_{i}=\{CH_{i}\}\) CM. The strategies align the direction of nodes towards their future responsibilities of either being a CH or a CM. Additionally, the parameters also influence the possibilities in this regard. Each node is continuously treated by the BS with a cardinal value V, which could be either profit (\(\Pi\)) or penalty (\(\pi\)). Each time, a value is given to the target node by the BS to adjust its likeness for either \(\alpha\) or \(\beta\). The utility function for each node to become either of CH or CM is directly associated with the value type of V assigned by the BS. The main utility function \(U_{i}\) of each node \(i\) can be defined as:

\[U_{i}=\Pi_{i}-\pi_{i}. \tag{13}\]

The main motivation behind the utility function is to allow the nodes of CM status to have \(\alpha\) capability. A node having higher \(\Pi\) than its \(\pi\) values will be a node having positive utility. Such nodes will have a strong chance of becoming CHs during the cluster selection process. The division of profit and penalty is also further divided into the classes according to following Table 4:

The payoff matrix of nodes having all the possibilities can be seen in Table 5.

**Lemma 1**: _According to the second stage of our game, the selection for CH exists for \(\alpha\) nodes and the selection of CM exists for \(\beta\) nodes at a certain point of time in the network._

**Proof**. Suppose the possibility of an \(\alpha\) node to become a CH is \(x\). So we can say that according to this assumption, an \(\alpha\) node must have \((1-x)\) possibility for being a \(CM\).