# Multi-Gateway-Based Energy Holes Avoidance Routing Protocol for WSN
## 6 Proposed Algorithm
The energy consumed in transmission of \(k\) bits between \(i\)th node and the cluster head of the \(k\)th cluster is given by using the Equation (7) as follows:

\[E_{t}\left(|v_{k}^{i}\cdot v_{k}^{\text{ch}}|\right)=k(E_{elc}+\varepsilon_{ amp}\times d_{i\mid v_{k}^{i},\,v_{k}^{\text{ch}}\mid}^{\text{ch}}) \tag{16}\]
* As there is direct communication between CH and its member nodes, the energy consumed by a single cluster member node in the cluster is given by: \[E_{k}=\left\{(v^{i},v^{j})\middle|\left(v^{i},v^{j}\in V\right)\wedge\left(L_{ xy}^{\text{min}}\leq\left[L_{xy}\left(v^{i}\right),L_{xy}\left(v^{j}\right) \right]\leq L_{xy}^{\text{max}}\right)\wedge\left(E_{t}^{\text{min}}\leq E_{ t}\left(v^{i},v^{j}\right)\right)\right\}\]0 (17)

If there are \(c\) member nodes in the \(k\)th cluster, the total energy consumed in the cluster is given by using the Equations (2), (3), (7) and (17) as follows:

\[E_{k}=\left\{(v^{i},v^{j})\middle|\left(v^{i},v^{j}\in V\right)\wedge\left(L_{ xy}^{\text{min}}\leq\left[L_{xy}\left(v^{i}\right),L_{xy}\left(v^{j}\right) \right]\leq L_{xy}^{\text{max}}\right)\wedge\left(E_{t}^{\text{min}}\leq E_{ t}\left(v^{i},v^{j}\right)\right)\right\}\]1

where, \(E_{t}(|v_{k}^{\text{ch}},GW^{m}|)\) is the energy consumed in transmission from the CH of the \(k\)_th_ cluster to the gateway node of \(m\)th region. * The total energy consumed by all the clusters in the \(m\)th region is given by: \[E_{k}=\left\{(v^{i},v^{j})\middle|\left(v^{i},v^{j}\in V\right)\wedge\left(L_{ xy}^{\text{min}}\leq\left[L_{xy}\left(v^{i}\right),L_{xy}\left(v^{j}\right) \right]\leq L_{xy}^{\text{max}}\right)\wedge\left(E_{t}^{\text{min}}\leq E_{ t}\left(v^{i},v^{j}\right)\right)\right\}\]2 (19)
* The total energy consumption of the area depends upon the energy consumption in cluster regions, sink region, and the gateway regions. The nodes in the gateway region (GR) and sink region (SR) consume energy only in the transmission of their packets. The energy consumed by a node in the \(g\)th gateway region is given by:

\[E_{k}=\left\{(v^{i},v^{j})\middle|\left(v^{i},v^{j}\in V\right)\wedge\left(L_{ xy}^{\text{min}}\leq\left[L_{xy}\left(v^{i}\right),L_{xy}\left(v^{j}\right) \right]\leq L_{xy}^{\text{max}}\right)\wedge\left(E_{t}^{\text{min}}\leq E_{ t}\left(v^{i},v^{j}\right)\right)\right\}\]3

where, \(v_{g}^{i}\) and \(GW_{g}\) are the \(i\)th normal node and gateway node of the of the \(g\)th gateway region, respectively. The total energy consumed by all the normal nodes in the gateway region is given by:

\[E_{k}=\left\{(v^{i},v^{j})\middle|\left(v^{i},v^{j}\in V\right)\wedge\left(L_{ xy}^{\text{min}}\leq\left[L_{xy}\left(v^{i}\right),L_{xy}\left(v^{j}\right) \right]\leq L_{xy}^{\text{max}}\right)\wedge\left(E_{t}^{\text{min}}\leq E_{ t}\left(v^{i},v^{j}\right)\right)\right\}\]4

If there are \(n\)s (normal sensor) nodes nodes in the sink region, then the energy consumed in transmission by a normal sensor nodes to the sink region is given by:

\[E_{k}=\left\{(v^{i},v^{j})\middle|\left(v^{i},v^{j}\in V\right)\wedge\left(L_{ xy}^{\text{min}}\leq\left[L_{xy}\left(v^{i}\right),L_{xy}\left(v^{j}\right) \right]\leq L_{xy}^{\text{max}}\right)\wedge\left(E_{t}^{\text{min}}\leq E_{ t}\left(v^{i},v^{j}\right)\right)\right\}\]5

where \(v_{SR}^{i}\) is the \(i\)th normal sensor node within the SR and the _sink_ node is the destination sink.