# Robust Evolutionary-Game-Based Routing for Wireless Multimedia Sensor Networks
## 4 EGR Protocol
### CH Election Process Using EG Theory  
In this section, we elaborately discuss the process of optimal CH election using EG. Being a CH decreases the energy level more than being CM. Being a CM will increase the lifetime of a node. Being a CH decreases the lifetime of a node; however, if all nodes decide to remain CM, the network will lose the cluster-based functionalities. The EG designed and formulated to elect CHs had three essential components. It is modeled as: EG (\(P\), \(S\), \(U\)), where \(P\), \(S\), and \(U\) represent a set of players, set of strategies, and utility function, respectively. \(P\) consists of sensor nodes that act as players of the game. \(P=\{p_{1}\), \(p_{2}\), \(p_{3}\),..., \(p_{n}\}\); where \(p_{1}\), \(p_{2}\), \(p_{3}\),..., \(p_{n}\) are sensor nodes in the cluster. These nodes in set \(P\) are classified into two subsets:  
\[P=NH\cup NL, \tag{5}\]  
where \(NH\) is a set of nodes that have higher level of residual energy as compared to a certain energy threshold (\(E_{T}\)), \(NL\) is a set of nodes that have lower remaining energy as compared to \(E_{T}\), \(NH\)\(\subset\)\(P\), and \(NL\)\(\subset\)\(P\). The strategy set \(S\) has two elements:  
\[S=\{T_{CH},T_{NCH}\}, \tag{6}\]  
where \(T_{CH}\) represents the strategy of being a CH and \(T_{NCH}\) represents the strategy of not being a CH. As mentioned earlier, \(U\) presents the utility function. The basic function to calculate the utilities can be presented by the following equation:  
\[U_{i}=R_{i}-P_{i}, \tag{7}\]  
where \(i\) represents the node we are calculating the utility of, and \(R_{i}\) and \(P_{i}\) are the reward and penalty for node \(i\), respectively, based on the action it chooses while playing the game. Using Equation (7), the complex utility functions for nodes falling under \(NH\) and \(NL\) sets will be formulated. In EG, formulating the evolutionary stable strategy (ESS) is an important step. The ESS ensures that different species in a population co-exist together and do not threaten each other by increasing the extinction probability through selfish choice of strategies. For the game designed in our protocol EGR, ESS for CH election game is \(T_{CH}\) for nodes in the \(NH\) subset and \(T_{NCH}\) for nodes in the \(NL\) subset. If the rate of nodes in set \(NH\) to become CHs (selecting the \(T_{CH}\) strategy) is \(\rho\), the rate of them to become CMs (selecting the \(T_{NCH}\) strategy) is \((1-\rho)\). This condition is also true for nodes in set \(NL\). Therefore, the rate of nodes in set \(NL\) to become CHs (selecting the \(T_{CH}\) strategy) is \(\eta\) and the rate of them to become CMs (selecting the \(T_{NCH}\) strategy) is \((1-\eta)\). Based on these assumptions, the expected utility for nodes in set \(NH\) to become CHs by selecting the \(T_{CH}\) strategy is expressed as follows:  
\[U_{NH(CH)}=\eta\alpha+(1-\eta)(\alpha+2\delta)=\alpha+2\delta-2\delta\eta, \tag{8}\]  
The utility of nodes in \(NH\) to become CMs by selecting the \(T_{NCH}\) strategy is:  
\[U_{NH(NCH)}=\eta(\alpha-\delta)+(1-\eta)(-\delta)=\eta\alpha-\eta\delta-\delta +\eta\delta=\eta\alpha-\delta. \tag{9}\]  
Therefore, the total revenue for nodes in \(NH\) is expressed as:  
\[\overline{U_{NH}}=\rho(\alpha+2\delta-2\delta\eta)+(1-\rho)(\eta\alpha-\delta). \tag{10}\]  
In EG, the change of rate of players' action is called replicator dynamics. After mathematical analysis, the replicator dynamic equation for nodes in \(NH\) is obtained by the following equation:  
\[F(\rho)=\frac{d\rho}{dt}=\rho\big{[}U_{NH(CH)}-\overline{U_{NH}}\big{]}=\rho( 1-\rho)[\alpha+3\delta-\eta(2\delta-\alpha)]. \tag{11}\]Similarly, the equations to calculate the utility for nodes in _NL_ is formulated.