## 4 Stepwise Process Enclosed in Proposed Research
### First Stage: Design of Optimal Routing Protocol
#### 4.2.3 Election of Grid Organizer Based on Salifish Optimization  
Generally, in the case of a grid structure, every node is deployed randomly, and each node has a unique identification number. The nodes within the specified grid are referred to as grid associates. A grid organizer is selected to equalize the load in every grid. The elected node functions as a grid organizer for a particular period. Once the period of time for that particular node is terminated, the old grid organization selects the new grid organizer based on the selection process criteria. The old grid organizer broadcasts the new grid organizer to its grid associates. The two significant criteria considered for choosing the grid organizer are distance and leftover energy. The distance between a particular node and  
\[c\left(a,b\right) =c_{1}\,+\,c_{2}\,d(a,b)\,\beta \tag{4}\]  
Equation (4) represents the mathematical expression used to calculate the energy utilized by the node during data transmission. C1 and C2 denote the constant value that keeps changing based on the wireless network application, and \(\beta\) represents the path loss constant. c(a,b) signifies the estimation of the energy utilized by the sensor and d(a,b) represents the distance between the sensor nodes. These two criteria are considered objective functions in the sailfish optimizer. The natural behavior of sailfish and its optimization characteristics are discussed in the following section. * Natural Behavior of sailfish  
The prey for these sailfish is smaller fish, such as sardines, attacking groups such as grey wolves. Certain behaviors of sardines, such as acceleration and maneuverability, are considered quite challenging for sailfish while hunting these sardines [31]. Attacking sardines, sailfish attempt a slashing motion by injuring many sardines or else hits a single sardine and makes it inactive. The injured sardines are detached from the driving school and are easily captured by the sailfish. The sailfish keep their bodies stable by keeping their pelvic and dorsal fins more erect. Additionally, they change color to communicate with other sailfish. The behavior of both sailfish and sardines was modeled and used to frame an optimization algorithm. * Advantages of sailfish optimizer over other methods. 1. Determining the distance between sensor nodes is faster. 2. Grid organizer selection is easier. 3. By grid selection criteria and shortest path establishment, energy consumption is less, thereby increasing the lifetime of the network. The steps enclosed in the sailfish optimizer are described as follows. * Steps Enclosed in sailfish Optimization  
The sequence of steps included in sailfish optimization starting from initialization until hunting prey is given below. * Step 1: Initialization  
The sailfish were considered as candidate solutions, and the variable related to the problem was considered the sailfish's position in the search space. The mathematical expression used to represent the sailfish population, and their position is given by (5). \[\text{SF}=\left\{\text{sf}_{1},\,\text{sf}_{2},\,\text{sf}_{3},\,\ldots\text{ sf}_{n}\right\} \tag{5}\]  
Based on this initialized population, the fitness function of each sailfish is computed using the following expression given in (6):  
\[\text{fitness\,function}=\text{f}(\text{sf}_{1},\text{sf}_{2},\text{sf}_{3}, \,\ldots\text{sf}_{n}) \tag{6}\]  
Subsequently, the population of sardines, along with their fitness function, was elucidated similarly. * Step 2: Elitism  
In this algorithm, the best solution of sailfish is saved in each iteration, and is referred to as the elite. This elite sailfish is taken as the fittest sailfish and can defend the acceleration and maneuverability of the sardine during capture. Furthermore, the position of the injured sardines in every iteration is also saved to select it as the best goal for an attack. The positions of the injured sardines and elite sailfish are denoted as \(Z_{\text{injureS}}^{\text{i}}\) and \(Z_{\text{eliteSF}}^{\text{i}}\) respectively.