# An Energy Efficient Routing Approach for IoT Enabled Underwater WSNs in Smart Cities
## 3 Motivation for U-(ACH)\({}^{2}\): Underwater Implementation of (ACH)\({}^{2}\)
#### Network Model
\(E0\) denotes the normal node, while \(E0(1+a)\) denotes the advance nodes. Here, \(\alpha\) time more energy is assigned to the advance nodes. The probability of normal and advance nodes are computed. After the computation of probabilities, the energy of the node is computed to identify whether it is alive or dead. Afterwards, the total energy of the node is computed. The count is incremented from node 1 to node 2 and so on until no dead node is found. Afterwards, the E_avg and K_opt values are computed. Like other schemes here, CH-election and selection will not be called, because, in SEP-ACH\({}^{2}\), only CH is responsible for transmitting the data. If the sensor node lies near to the sink node, still normal node is not allowed to send data directly to the sink node. Due to this nature of SEP-ACH\({}^{2}\) scheme, the network's lifetime is sharply decreased at a very high speed. ```
1:procedureCH_Election
2:cluster \(\gets 0\)
3:\(N\leftarrow\) no. of nodes
4:while\(cluster!=k\_opt\)do
5:for\(i=1:1:N\)do
6:ifS(i).\(E>E\_avg\)then
7:ifTemp <= \(\frac{P}{1-P*mod(r,round(1/P))}\)then
8: add node in c
9:endif
10:endif
11:endfor
12:endwhile
13:endprocedure
14:
15:procedureCH_Selection
16:\(c\leftarrow\) Number of elected clusters
17:for\(c=1:1:c-1\)do
18: calculate \(dis(c,c+1)\)
19:if\(dis>10\)then
20: select node as CH
21: calculate \(dis(CH,sink)\)
22:else
23: select node as normal node
24: remove from elected cluster set
25:endif
26:endfor
27:endprocedure
```  
**Algorithm 4** CH election, selection. For CH-election, initially cluster variable is assigned 0 value and the number of nodes is considered in a way, as already considered. For a node to become CH, its residual energy needs to be more than the average residual energy of the network, if the condition satisfies, then the sensor node is elected to be a CH. The CHs are elected until the K_opt value is reached, as shown in Algorithm 4. For selection, the distance from all of the elected nodes towards every next node is computed, if the distance is greater than the specified value i.e., 10m then the elected node is selected as CH or in alternative case elected node again becomes a normal sensor node. For each round, election and selection process executes. DEEC-ACH2 is a Heterogeneous WSN that comprises of two or various sorts of sensor nodes having different energy levels as shown in Algorithm 5. Initially, the number of nodes and rounds is specified for simulation. Next, the energy of the node is computed to identify whether it is alive or dead. Afterwards, the total energy of a node is computed. The count is incremented from node 1 to node 2 and so on until no dead node is found. The DEEC-ACH2 convention depends on a two-level heterogeneous WSN in which the sensor nodes are equipped with normal E0 and advance Ea energy levels. The normal energy of the network is given as  
\[Ea=T\_\_\text{Energy}*(1-r/rmax)/n \tag{1}\]  
After computing E_avg, we need to compute K_opt in order to create the number of desired clusters. Toward the start of each round, the choice with regards to whether the nodes are CH is chosen by the limit bound. The limit bound is suggested, as below. It is imperative to take note of that ideal likelihood (P(i)) is somewhere in the range of 0 and 1, which is the part staying in the opposite of the P(i) with r. This is the reason mod is utilized. This leftover is deducted by 1 and Temp is determined. if S.E > E_avg then  
\[\frac{P}{1-P*mod(r,round(1/P))} \tag{2}\]  
otherwise zero. Next, CH-selection code is called to compute the distance. For a node, to select CH, if the distance from the sink node is less when compared to the distance from the cluster, then a node will directly send its data packet to the sink node. This is how DEEC-ACH\({}^{2}\) works. In subject to the system's performance, the list of metrics for evaluation purposes are considered, which are as follows:  
The first metric is the Stability period, which is the timestamp since the creation of network till all the nodes alive.