# Adaptive Node Clustering Technique for Smart Ocean under Water Sensor Network (SOSNET)
## 3 Meth Flame Optimizer  
Moths are insects that resemble butterflies. To date, about 160,000 species of moths have been identified. Moths are born as larvae, which convert to adult moths in cocoons. The fascinating aspect of moths is the way they navigate at night time. They always travel in the night using moon light. Their method of travelling is known as traverse orientation. In this method, moths always travel towards moon light having a fixed angle towards the moon. This is an effective method for traveling in a straight line. Similar methods can also be used by humans [38; 39; 40]. Suppose if a human wants to go towards the east and the moon is in the southern side of sky, the person can travel in a straight line if the person keeps the moon to his/her left side while moving. Despite the efficiency of transverse orientation, moths are deceived by artificial light and tend to fly spirally towards artificial light. The reason for this behavior is that transverse orientation works well only if the light source is far away. However, when an artificial light is encountered, moths try to maintain a straight angle towards it. However, since the artificial light is too close, it results in a deadly path for moths. At the same time, it can be said that moths always converge towards light. This is a very useful property, which is exploited mathematically, resulting in the moth flame optimizer (MFO) algorithm introduced in [41]. The future research directions have been discussed in [42; 43]. Similarly, future research avenues regarding mobile anchor node assisted localization for WSN are presented in [44]. Localization algorithms of UWSNs are summarized in [45; 46].  
MFO algorithm moths are treated as candidate solutions where the location of moths in space is considered as a variable for the problem. The moths can fly in either one or two dimensions or in any multi-dimensional space while changing their position. MFO is a population-based algorithm and an m \(\times\) n moth matrix can be generated from their set of positions, where m is the number of moths and n is the number of variables. A moth array can be created that will store the consequent fitness value of all the moths. This fitness value is the returning value of the fitness function of each moth. Similarly, two matrices are created for flames: the first matrix is like a moth matrix, whereas the other one is like a moth array. Both the matrices have the same degree as the matrices developed for moths. It is important to note that both moth and flame matrices are solutions with the difference being in the way that both are updated in each iteration. Moths are agents moving in the search space, whereas the flame provides the best position that moths have attained yet. We can deduce that the flames are the pins that are dropped by the moths while moving in the search space. Therefore, with each search operation the moth flies around a flame and will update it if it finds a better position. The moth will always find the best solution by adopting this mechanism [39; 40; 41].  
Figure 2 explains the SOSNET algorithm. During the initialization phase, each moth has a random position in an m \(\times\) n dimensional solution space, whereas fitness values are stored in a moth array. Similarly, a flame matrix and its corresponding array is generated. The flame matrix is used to store the best value of the moth found so far. The moths are moved in the solution space until an optimal solution is found, afterwards the search operation is terminated. This is followed by updating the moth position. The same operation is repeated until the optimal number of flames and correspondingly optimal position of each moth against its flame is obtained.