# Adaptive Node Clustering Technique for Smart Ocean under Water Sensor Network (SOSNET)
## 4 SOSNET-Proposed Methodology  
CAMONET [38] is an MFO based algorithm for clustering applied in vehicular ad hoc networks (VANET). We believe that the same solution can also be extended to UWSN. CAMONET basically finds the optimal number of clusters required in a given network. Due to its evolutionary capabilities, it finds the best solution for both continuous as well as discrete variable problems. Another promising aspect of this solution is that it is a computationally inexpensive operation that makes it a suitable candidate for UWSN. In [38] we have implemented CAMONET in a VANET environment. In the current scenario, SOSNET, we create a grid of n \(\times\) n number of sensors in a geographical area. All the sensors are given a suitable ID in a mesh type network. These nodes are considered as moths. A matrix, based on Euclidean distance, is generated that provides distances of all the nodes. These moths are the basis on which we create our search space. Certain parameters are used for forming this search space: these include dimensions, and lower and upper bounds. This is followed by checking the fitness of moths by using their locations in the search space. This is an iterative process that results in the creation of a fitness matrix; after each iteration, the generated values are stored in this matrix, which are arranged in ascending order. Thus, this matrix provides the lower fitness value of moths. By combining moth position and fitness value we obtain the best score of the flame. This is used for updating the moth position. A linear decreasing factor 'x' is used to converge this to an optimal solution. Through this same convergence we can get the optimal number of clusters required for effective communication based on given parameters. The pseudo code of SOSNET in presented in Algorithm 1. Once the clusters are formed, the next phase is to select the cluster head (CH). Selection of the CH depends on many parameters, such as transmission range, residual energy of node, node density, grid size, and load balance factor. Weights have been assigned to all these parameters in the fitness function. This selection is carried out by using a fitness function, which is an important part of our algorithm. Selection of the best CH will increase cluster life time and will ultimately result in saving network energy. SOSNET calculates the fitness value by using the following Equation (1):  
\[\centering Fitness=\frac{W1\times\mathit{Energy_{Resi}}}{(W2\times\mathit{avg_{ dis}})\Big{(}W3\times\mathit{delta_{diff}}\Big{)}}.\@add@centering \tag{1}\]  
In the above equation, \(\mathrm{Energy_{Resi}}\) is the residual energy of the node, whereas \(\mathrm{avg_{dis}}\) is the average distance towards neighbor nodes and \(\mathrm{delta_{diff}}\) is the difference. This \(\mathrm{delta_{diff}}\) is used as load balancing factor (LBF). \(\mathrm{W_{1}}\) is the assigned weight for energy whereas \(\mathrm{W_{2}}\) is the weight for average distance and \(\mathrm{W_{3}}\) is the weight assigned to delta difference. In an ideal scenario, all the clusters should have an equal number of members. However, this is difficult to achieve in a real-world scenario due to changes in sensor positions as a result of ocean currents and other factors. Delta difference is used to calculate the  
Figure 2: Proposed SOSNET flowchart. deviation from an ideal degree to a node's movement from its neighbors and is calculated by following Equation (2):  
\[\text{Delta}_{\text{Diff}}=\text{ABS}\;(\text{Ideal}_{\text{Degree}}-\text{ Node}_{\text{Degree}}). \tag{2}\]  
```
1.START
2.Deploy nodes randomly in 2D grid
3.Each node broadcasts its position
4.Generate mesh topology among all nodes while keeping node IDs as vertex. 5.Calculate distance of each node from other nodes and associate these values to the edges in mesh topology. 6.Initialize Moth Position MP and create search space.