# Network Lifetime Improvement through Energy-Efficient Hybrid Routing Protocol for IoT Applications
## 4 Proposed Hybrid PSOGA
### PSOGA-Based Routing Algorithm  
The genetic algorithm uses its individuals to find the local solution that feeds the PSO. The PSO is only able to find the global solution since the process of finding the local solution, that is, the local best solution, is accomplished by the GA. The main aim is to reduce the premature convergence by the PSO that falls in the local optima. Hence, to obtain a developed solution, we mainly considered the formation of the local solution by the genetic individuals or chromosomes. Here, each individual represents a potential solution. Furthermore, in the GA, each particle is regarded as an individual chromosome, and the swarm refers to the entire population.  
The PSOGA starts with the process of generating random individuals while considering the total iterations as a parameter for the algorithm. The population aims to provide solutions to the route planning, and the solution is considered in a distributed manner over the whole IoT network. The initial population is allowed to pass through the GA in its initial iterations. This helps in reducing the route selection score, as the GA performance entirely depends on encoding the solutions in particles and chromosomes. In addition, it considers the measurement of the fitness function, population size, and the total number of iterations. Such parameters are adjusted after the evaluation of the GA on the initial trails. The PSO starts its operation after obtaining the local solutions by the GA during the initial iterations. The PSO uses particles to find the global solutions that represent the overall solutions in finding the optimal routes. The steps are as follows:  
* Step 1: Initialize a swarm of particles with a random position and zero velocity.
* Step 2: Evaluate the objective values of the particles.
* Step 3: Evaluate the fitness function value for each particle.
* Step 4: Determine the local and global best solution.
* Step 5: Until the termination condition is reached, update the velocity and position of each particle, and update the local and global best solution.
* Step 6: Arrange individuals in decreasing order of fitness function value and find the \(M\) best particles.
* Step 7: GA Evolution--reproduce _Pop_size-\(M\)_ (performing subtraction) and GA individuals, and implement crossover and mutation operators to create _Pop_size-\(M\)_ particles.
* Step 8: Combine and form _Pop_size_ individuals.
* Step 9: End.  
The application of PSOGA is followed by updating the V* (see Table 1). Further, equation (4) is used to evaluate the route score, followed by a zigzag scan that starts in the upper-left corner of the grid. It sequentially scans the diagonals of the grid to determine the route score. Once the evaluation has been done, the CH communicates the same to the neighboring grid. The same pattern is followed subsequently for the remaining grids. The present work was focused on static WSN nodes. In case a CH fails, there is a packet drop in the network; all the parameters will be reset and the re-election of the CH will begin.