# Game Theoretic Solution for Power Management in IoT-Based Wireless Sensor Networks
## 3 The Proposed Mechanism
### Assessment by Nodes
Similarly, for taking the nodes of the \(\beta\) set for \(CH\) and \(CM\) we can have y and \((1-y)\). The utility functions for selecting the \(CH\) and \(CM\) are as in the following: \begin{table}
\begin{tabular}{c c c} \hline \hline
**Node Class** & **Profit (\(\Pi\))** & **Penalty (\(\pi\))** \\ \hline \(\alpha\) & \(\Pi\) (\(\alpha\)) & \(\pi\)(\(\alpha\)) \\ \(\beta\) & \(\Pi\) (\(\beta\)) & \(\pi\)(\(\beta\)) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The further division of profit and penalty. \begin{table}
\begin{tabular}{c c c} \hline \hline \(\alpha\) & \(\beta\) \\ \hline \multicolumn{2}{c}{**CM**} & \(\mathbf{CH}\) \\ \hline CM & \((-\pi,-\pi)\) & \((\Pi-\pi,\Pi)\) \\ \hline CH & \((\Pi+2\pi,\pi)\) & \((\Pi,\Pi)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: The payoff matrix of nodes to be CH. \[U_{\alpha(CH)}=\ y\,\Pi\ +\ (1-y)(\ \Pi\ +2\ \pi) \tag{14}\]

\[U_{\alpha(CH)}=\ y\,\Pi\ +\ \Pi+\ 2\ \pi-y\Pi\ -2y\,\pi \tag{15}\]

\[U_{\alpha(CH)}=\ \Pi\ +\ 2\ \pi-2y\,\pi \tag{16}\]

\[U_{\alpha(CM)}=\ y(\Pi\ -\ \pi)\ +\ (1-y)(-\pi) \tag{17}\]

\[U_{\alpha(CM)}=\ y\,\Pi\ -\ \pi \tag{18}\]

Equation (16) defines the expected utility function \(U_{\alpha(CH)}\) of \(\alpha\) nodes for being selected as \(CH\), while the utility for being selected as \(CM\) of the same class \(\alpha\) is defined by \(U_{\alpha(CM)}\) in Equation (18). The average earning of a node can be denoted by Equation (20) as:

\[\overline{U}_{\alpha}=x(\Pi\ +2\ \pi\,2y\ \pi)+(1-x)(y\ \Pi\ -\ \pi) \tag{19}\]

\[\overline{U}_{\alpha}=x\ \Pi\ +3x\ \pi\ -2 xy\ \pi\ +y\,\Pi\ -xy\,\Pi\ -\ \pi \tag{20}\]

In evolutionary games, the replicator dynamic equation is considered as the most important aspect. The stability and convergence of evolutionary stability and Nash equilibrium can be summarized by this dynamic analysis. Equation (24) shows the replicator dynamic analysis of node \(\alpha\) as below:

\[\frac{dx}{dt}=F(x) \tag{21}\]

\[F(x)=\ x\big{(}U_{\alpha(CH)}-\overline{U}_{\alpha}\big{)} \tag{22}\]

\[U_{\alpha(CH)}=\ y\,\Pi\ +\ (1-y)(\ \Pi\ +2\ \pi) \tag{14}\]0

\[U_{\alpha(CH)}=\ y\,\Pi\ +\ (1-y)(\ \Pi\ +2\ \pi) \tag{14}\]1

Similarly, the expected utility function for non-suitable nodes, \(\beta\), for both cases of being selected as CHs or CMs can be defined by the following equations. \[U_{\alpha(CH)}=\ y\,\Pi\ +\ (1-y)(\ \Pi\ +2\ \pi) \tag{14}\]2

\[U_{\alpha(CH)}=\ y\,\Pi\ +\ (1-y)(\ \Pi\ +2\ \pi) \tag{14}\]3

The average revenue obtained by each \(\beta\) node is as follows:

\[U_{\alpha(CH)}=\ y\,\Pi\ +\ (1-y)(\ \Pi\ +2\ \pi) \tag{14}\]4

\[U_{\alpha(CH)}=\ y\,\Pi\ +\ (1-y)(\ \Pi\ +2\ \pi) \tag{14}\]5

The replicator dynamic equation for each node in the \(\beta\) class can be similarly obtained as:

\[U_{\alpha(CH)}=\ y\,\Pi\ +\ (1-y)(\ \Pi\ +2\ \pi) \tag{14}\]6

\[U_{\alpha(CH)}=\ y\,\Pi\ +\ (1-y)(\ \Pi\ +2\ \pi) \tag{14}\]7

\[U_{\alpha(CH)}=\ y\,\Pi\ +\ (1-y)(\ \Pi\ +2\ \pi) \tag{14}\]8

\[U_{\alpha(CH)}=\ y\,\Pi\ +\ (1-y)(\ \Pi\ +2\ \pi) \tag{14}\]9

Equation (24) indicates that \(x^{*}=0\ x^{*}=1\) can be obtained for \(\alpha\) class of nodes as stable strategies sets. As per the flow, the values of \(\Pi\) and \(\pi\) cannot be negative, therefore \(\Pi+3\pi-y(2\ \pi-\Pi)\) will always return a positive value. It shows that the evolutionary settlement of nodes from classes \(\alpha\) and \(\beta\) for being CHs or CMs can be formed. In the initial phase, the BS classifies nodes to be either \(\alpha\) or \(\beta\), based on their suitability for the cluster headship in their clusters. The utility function for both classes can be calculated by the previous equations already discussed in this subsection. All the nodes are intelligent and can adjust their performance in the network towards the candidateship of either CH or CM. The BS continuously tracks their performance and benefits them accordingly. The nodes that higher revenues are always selected as CHs. The revenue is controlled by the BS while analyzing their suitability in the network.