# Network Lifetime Improvement through Energy-Efficient Hybrid Routing Protocol for IoT Applications
## 4 Proposed Hybrid PSOGA
### Proposed Hybrid-Based PSOGA Routing  
The proposed algorithm works with two important criteria--the selection of cluster heads using the trust mechanism and finding the routing path using the PSOGA. Details about the selection of the cluster head and cell headers using a trust-based mechanism are given in Section 4.4, and the set of routing paths using the PSOGA is given in Section 4.3. The parameters used in the algorithm description are given in Table 1.  
The algorithm for the proposed model is given in Algorithm 1 as follows:  
```
1. For \(i=1\) to number of grids  While Fch\(\
eq\) S  Generate \(V^{*}\) using zigzag method
2. BestScore = 0;
3. For \(i=1\) to Max_Iterations  For \(i=1\) to rows (\(V^{*}\))  Temp = \(V^{*}\)(\(i\), Na)  For \(j=1\) to length (Temp)  For \(k=\) Temp() extract score factors from Ir(Ni) End for  End for \(R_{score(i)}\)= Score(\(R_{score(i)}\));  End for \(G_{BestScore,\,index}=\) max (\(R_{score}\)); if \(L_{BestScore}>G_{BestScore}\) \(G_{BestScore}=L_{bestScore}\); \(SelR=V^{*}\)(index. );  End if  Update \(V^{*}\) using PSOGA Algorithm End for  End while  End for
4. Perform Communication between CH to sink using selected final route
5. Evaluate Network performance
6. Stop Algorithm

Figure 2: Flowchart for cluster head selection. In the proposed algorithm, Step 1 generates the random routes for each grid in the network. The process of determining the random route continues while the farthest CH is not equal to the sink node. Step 2 initializes the best score to 0. Step 3 updates the path V* determined in Step 1. For this, it uses the concept of the local score and global score. Step 4 initiates communication from the CH to the sink node through the path obtained in Step 3. The performance of the network is evaluated as per Step 5 to obtain the performance metrics, such as the longevity of the nodes, the network lifetime, the packet delivery ratio and throughput, and so forth. The most prevalent genetic algorithm (GA) and swarm intelligence technique (PSO) benefits are taken into account for getting a better convergence and path to improve the network lifetime. ## 5 Network Setup

The simulation was performed under the university's central server; the authors used multi-hop networks with various numbers of homogenous sensor nodes. The region under consideration was rectangular and divided into a number of grids. This is in line with the majority of the published literature wherein the deployed network is considered to be rectangular. The BS was located at the center or at one of the edges. A rectangular grid of sensor nodes was used for relaying packets and the model for transmission was considered to be fixed power transmission. In this scenario, the authors simulated different routing approaches, namely PSOGA (proposed), LEACH, and PSO. The simulation of different approaches enabled the authors to establish the efficacy of the proposed approach vis-a-vis state-of-the-art methods. As per the proposed method, the sensor nodes were assumed to have an initial fixed energy and the BS had unlimited energy. The BS also had knowledge of the deployed nodes. The basic structure of the network is shown in Figure 3, in which the number circled in each grid represents the CH, and the green cross mark represents the BS. This grid-based approach is popularly known for its features, namely uniformity in energy consumption, scalability, and simplicity [20; 33; 38]. However, there are some major challenges associated with a grid-based approach, such as the determination of the optimal number of grids for a particular scenario, a non-uniform grid size, and the improper selection of the CH [39]. These challenges further worsen owing to the dynamic behavior of WSNs. The authors of this paper primarily focused on developing a robust model that can handle various issues such as heterogeneity in node density, deployment area, and grid size [38; 40; 41].