Internet of Things Energy Efficient Cluster-Based Routing Using Hybrid Particle Swarm Optimization for Wireless Sensor Network

Specialized transducers in wireless sensor networks that offer sensing services to the internet of things devices have limited storage and energy resources. One of the most vital issues in WSN design is power usage, as it is nearly impossible to recharge or replace sensor nodes’ batteries. A prominent role in conserving power for energy-constrained networks is served by the clustering algorithm. It is possible to reduce network energy usage and network lifespan prolongation by proper balancing of the network load with Cluster Head (CH) election. The single-hop inter-cluster routing technique, in which there is a direct transfer from CHs to the base station, is done by the low energy adaptive clustering hierarchy. However, for networks with large-regions, this technique is not viable. An optimized Orphan-LEACH (O-LEACH) has been proposed in this work to facilitate the formation of a novel process of clustering, which can result in minimized usage of energy as well as enhanced network longevity. Sufficient energy is possessed by the orphan node, which will attempt to cover the network. The proposed work’s primary novel contribution is the O-LEACH protocol that supplies the entire network’s coverage with the least number of orphaned nodes and has extremely high connectivity rates. A hybrid optimization utilizing simulated annealing with Lightning Search Algorithm (LSA) (SA-LSA), and particle swarm optimization with LSA (PSO-LSA) Algorithm is proposed. These proposed techniques effectively manage the CH election achieving optimal path routing and minimization in energy usage, resulting in the enhanced lifespan of the WSN. The proposed technique’s superior performance, when compared with other techniques, is confirmed from the outcomes of the experimentations.


Introduction
A wide distribution of numerous sensor nodes within a specific area constitutes a Wireless sensor network (WSN). Processing data that is collected from the sensors for an area's event monitoring is the WSN's primary task. The data of the sensor nodes is transmitted to the Base station (BS) (also known as the "recipient"), WSN. The efficacy of various civil and military applications like disaster management, security, and surveillance of combat fields, is substantially affected by the WSNs. Even so, constraints on storage, processing, communication, and energy are the sensor nodes' limitations. The duration of time till the desired points or area are no longer covered is defined as a WSN's network lifetime. The network sensor nodes' unbalanced usage of energy or high utilization of power isa major factor in the network lifetime's reduction. The reason being that every sensor node's power supply is a battery which, because of the coverage [1] area's conditions, may be neither replaceable nor rechargeable. Due to this, prolongation of network lifespan can be achieved through the control and balancing of the network's energy usage. Therefore, the sensor nodes' energy usage must be accounted for by the networks' utilized algorithms.
The latest innovations in applications and services have resulted from the IoT's dominance. IoT components constitute numerous objects that are Internet-connected through wired and wireless networks. Data is sensed, collected, and transferred by the smart objects to fulfill users' diverse requirements. There can be communication between: (i) people and objects, and (ii) the objects themselves. There is the IoT's realization as a key solution for the acquisition of insight into the real world physical processes' diverse associated issues. Several deployment challenges have been posed by the IoT field's advancements in technology. A queried form or continuous methodology [2] can be utilized for the sensed data transmittal. But, for this to happen, the sensor nodes must communicate among themselves with energy efficiency. When there is the deployment of more objects in the IoT, the entire process will consume tremendous quantities of power. Hence, for making good use of environmental conservation and surveillance, decreasing operational costs, minimizing power usage, as well as lowering emissions and pollution, a prominent role is served in the IoT by green networking.
Network topology adjustments and regulation of the levels of nodal transmission power in the routing protocol will aid in the effective management of energy utilization. The minimization of the routing protocols' power utilization is aided by the clustering approach. There is an organization of the sensor nodes into clusters in a clustering architecture. Here, sensor nodes with smaller energies are employed for carrying out sensing tasks and for short distance-transfer of the sensed data towards their Cluster Head (CH). For removing correlated data from the cluster's members, a cluster's node is picked out as the CH. The CH's purpose is to minimize the amount of the aggregated data transferred to the BS. Extended network lifespan and energy efficiency enhancement is accomplished by the clustering approach [3] by minimizing the overall energy usage and balancing the nodes' energy usage during the network's lifespan. This approach also has the ability to mitigate channel contention as well as packet collisions, and hence, provide better network throughput under high load conditions. As a leading IoT technology, each sensor's limited sensing capability and battery capacity cause certain critical issues related to CH election, localization of nodes, and routing protocol planning in WSN. During its food search, the insect community's behaviour as its efforts to detect the optimal path of insects forms the basis for the Swarm Intelligence (SI) algorithm's [4] development. The extensibility, distribution, robustness, and adaptability of these algorithms make them compatible with the WSN's routing protocol requisites. Hence, there has been the development of numerous SI-based algorithms for routing protocols in WSN. The most frequently employed WSN routing protocol is the cluster routing protocol. This protocol's primary issue is the election of CH, which is, specifically, an NPhard problem. The feasibility of SI in resolving NP problems makes its implementation with few parameters quite applicable.
Furthermore, simultaneous CH detection in multiple clusters is facilitated by its multiobjective optimization capability. Although the positioning problem's resolution is generally done with the Global Positioning System (GPS), this method's high energy usage, as well as unavailability in certain specific areas, make it infeasible for WSNs. An error optimization problem is considered to be part of the complex optimization problem. Therefore, SI algorithms can be used for resolution of node localization as this issue is also treated as an error optimization problem.
In this research, hybrid SA-LSA and PSO-LSA approaches for IoT-based WSN are proposed. The remainder of the investigation is divided into the sections below. Section 2 delves into the related literary works. Section 3 describes the several strategies used in this study. The experimentation's results are discussed in Sect. 4, and the work is concluded in Sect. 5.

Related Works
With a focus on the conventional WSNs' issues like poor connectivity and low coverage, Wang [5] proposed an efficient and optimized WSN's design for dairy farming. Network nodes' implementation has taken into account two major issues in WSNs: connectivity and coverage. In WSNs, the PSO is in charge of node deployment optimization. Results show that the effective WSN coverage, obtaining a high convergence rate, and the elimination of the influence of a constant, the sensor nodes have the look and feel of optimization, and provide a fast and efficient implementation of a global optimization of the WSN system. In the meantime, the PSO algorithm is able to quickly identify the best elements that can be added to the network and to link them to the minimum number of nodes, resulting in a network that is both efficient and stable.
Genetic Algorithm (GA)-based clustering and PSO-based routing in WSN was utilized in the methodology presented by Anand and Pandey [6] for enhancement of the lifespan of a network. A GA will take into account energy and distance parameters for the election of the best CH. Data from the rest of the nodes are collected by this CH. Moreover, the PSO algorithm relies on optimal routing paths picked for each relay node for data delivery towards the BS. It is shown in the proposed procedure that the relay node will aid and enable communication between the sink and CH, which in turn, boosts the efficiency of energy. Eventually, the system will survive longer because of the improvement of the WSNs' Quality of Service (QoS). Outcomes of the simulated experiments demonstrated that, compared to other currently-used protocols, the proposed approach greatly raised the WSN's lifespan and minimized its energy usage.
The effective SA was exploited by Zhang et al. [7] for the proposal of a weighted Distance Vector (DV)-Hop technique. The effect of diverse known nodes on unknown nodes is initially identified by this algorithm, which will later weigh each known node's average distance. During this time, the adjacent nodes' average distance will be nearer to the network's real average distance. Eventually, the unknown nodes' location is found with the effective SA algorithm's utilization. The proposed positioning method was indicated to have higher precision when the outcomes of MATLAB simulations were analyzed.
Grey Wolf Optimization (GWO), a novel intelligent computing approach, was propounded by Zhang and Liu [8] for WSN localization. Running simulations confirmed this proposed approach's practicality and validity. There was a discussion about the convergence performance and localization outcome and comparison with the standard PSO algorithm. This work had also analyzed the proposed approach's localization performance when it was subjected to diverse anchor node proportions and diverse communication radii. It is demonstrated from the experimentation outcomes that the proposed approach can achieve higher accuracy in localization and can save cost as it can accomplish the same accuracy with fewer anchor nodes anda smaller communication radius.
A combination of the elite selection and niche sharing mechanism, known as the Elite Niche PSO (ENPSO), was proposed by Xu et al. [9] to develop the robustness and convergence rate of the algorithm. Simulations were used to draw comparisons between the ENPSO's energy cost-optimized and those optimized by GWO and SA. It is demonstrated from the outcomes that, when the number of nodes is 100 with 10% CHs, ENPSO's energy cost-optimized by 9.63% and by 19.54% compared to GWO and SA, respectively. It Indicates that the proposed ENPSO's performance is superior to that of the other two algorithms and that it has better robustness and swifter rate of convergence.
Zhang and Wang [10] proposed a unique, volatile, and bio-inspired cluster of regulation (EU-JOBS). A combination of the CHs, it is randomly initialized at the beginning of the contract, and the non-CHs are chosen as the partitioning of a set of principles. Then, the utility function can be used in the selection process, until the maximum time has been reached. In this paper, two designs of angles for the maximum energy in each node: a non-CHs shared network, because of the principle of the division is in proportion to the architecture of the network and the node's energy dissipation.Additionally, the Gini coefficient's introduction to the objective function in this work to balance the nodal energy load can help minimize node reduction and preserve the network coverage range. Based on the obtained results, further enhancement of the IoT's overall performance, network life cycle prolongation, and the ability to maintain more nodes alive over time is achieved by the proposed algorithm.
Large contributions have been made by hierarchical-based routing protocols towards minimum energy usage and, as a result, toward prolongation of the network lifespan. A Hybrid bio-inspired clustering-based Routing Protocol (HRP-CSSA) was proposed by Demri et al. [11], which utilized the Cuckoo Search (CS) Algorithm and the Simulated Annealing (SA) Algorithm. This proposed protocol would exploit the SA's benefit of avoiding getting captured in the local minima and the CS algorithm effectively in resolving global optimization. It is evident from the outcomes of the experiments that the HRP-CSSA achieves the best performance with regards to received data amount at the BS, network longevity, stability period, and energy usage.
Kadiravan and Sujatha [12] combined the Bat Algorithm (BA) of the functions and methods of using the TLBO algorithm to make a BAT-TLBO algorithm for the determination of the exact location of the network nodes. The BAT-TLBO method is evaluated on the basis of different scenarios of different anchor node density. The localization error of BA is 0.259, that of the Modified BA (MBA) is 0.541, and that of the BAT-TLBO is 0.219, according to the simulation results.Furthermore, the experimental results showed that the BAT-TLBO algorithm has higher localization performance in terms of computation time, enhanced localization success ratio, and resilience when compared to other algorithms.

Methodology
There is a discussion about the O-LEACH protocol, PSO, SA, LSA, SA-LSA, and PSO-LSA methods in this section.

Orphan Problem
After cluster formation, the nodes' random election of CH is concentrated in the work field's specific part. Due to this, nodes outside the network would not be covered (see Fig. 1) in the field's remainder part. The BS will not be sent values that were received by the Orphan nodes. The Orphan node problem necessitates identifying a solution to allow these nodes to join the network's remainder portion. Two possibilities are presented in the Orphan LEACH. In the first case, it is a cluster member, it can act as a gateway, creating a floating node in the cluster. Since it is a gateway node that can have multiple orphan nodes, it is considered to be 'the voice', CH. As a result, the exercise of the nodes can send messages to CH. CH leads to the aggregation of the data, and displays those messages, CH. In the second case, it refers to a non-secure area, where stranded ingredients are essential, and the number of members in the cluster is greater than the number of losses of the nodes, then a new one is created. "CH" will be the first to be node-to-arrive at the gate (cluster member). The CH's [13] similar role is served by the CH′.

Solution: Scenario 1
In-the-round, the environment should be secured by, CH, it, otherwise, CHs will not be able to cover it. Since the start of this command is located outside of the CHS area as  Figure 2 illustrates the following situation:

Setup Phase Extension Orphan-LEACH
The setup phase and the steady-state phase are displayed in Fig. 3. With this phase setup, the cluster is permitted to organize by taking the orphan nodes into account.  The initialization stage will include the election of CH nodes with a given probability depending on a node's local decision to become a CH. Once the clusters have been created, a timer is used to verify the existence of the Orphan nodes. When the CH receives a positive response, it will create two slots for the gateway (CH′): one for the gateway and one for the Orphan nodes (compression and aggregation of data). The CH assigns a slot to each member node, and utilising Time Division Multiple Access, the time is divided into unique periods (timeslots) for each node (TDMA). As a result, even though an individual node has channel access (that is, it can use the entire bandwidth channel), it can only transfer its data only during its allocated time intervals.
In group formation, the neighbouring nodes' messages are broadcast by the CH. The cluster membership is notified to the CH by the cluster member nodes. This will result in a cluster, the cluster members (Ports) that will receive messages from the loss of nodes, which requires the membership of the group. The gateway says the CH on the number of currently active nodes. CH is an orphan node, and the members of the cluster point out some of the TDMA slots for simultaneous transfer of your data. As a result, the number of orphan nodes must be equal to or less than the number of members in the cluster. The sequence of Orphan LEACH in the Setup Phase is described below.

Solution Scenario2
When the number of orphan nodes in a CH exceeds the number of cluster members, sub-clusters arise (as shown in Fig. 4). The sub-clusters include the CH′ and Orphan nodes. CH' is the name of the first Orphan node (CH′) with access to the gateway. The Orphan nodes' neighbour is informed of the CH's most recent status by the CH' itself. The CH′ is informed of the number of Orphan node slots available. The CH′ performs a similar function to the CH. The CH′ will compress the Orphan nodes' received data, and later, via a Gateway, this data is aggregated to a CH.

Steady-State Phase
During this phase, data collection is permitted. TDMA is used for data transit by the cluster's member nodes and orphan nodes during their slots. The CH′ collects data from members in the neighbourhood (gateway). Before sending the CH's result, the CH' (gateway) will integrate and compress this data. The CH′ (gateway) data will be in Slot 1, and the Orphan nodes' aggregated data will be in Slot 2. The CH will gather information from cluster member and orphan nodes, combine it, and send it to the BS.

Particle Swarm Optimization (PSO) Algorithm
Kennedy and Eberhart [14] described the PSO, which is modelled on the bird flocks' social behaviour. Every individual in a population is regarded as a multidimensional solution space's particles in this algorithm. The PSO will begin with the random initialization of a particle group in the population. Each particle represents a possible solution, whose fitness values are determined by where it is in the search space. The current global solution will be identified by every particle in the solution space travelling to the randomly weighted average of the best position.
Suppose that for an n-dimension objective search space, the population will comprise of s particles. The i particle's position and velocity will be X id and υ id , respectively, were, 1 ≤ i ≤ s, 1 ≤ d ≤ n. An objective function is used for the assessment of a particle's fitness. When a particle has a smaller fitness value, it will be nearer to the global solution than another particle. The i particle's historical personal best position where it had the smallest fitness is denoted aspbestid is, and the smallest of all pbest id , 1 ≤ i ≤ s, is denoted as gbest d . For every iteration k, Eqs. (1) and (2) are utilized to update each particle's velocity υ id and position as below: In these equations, the inertia weight that denotes the particle's inertia is indicated as ω, the acceleration constants are indicated as c 1 and c 2 , and random numbers that are uniformly distributed in [0, 1] are indicated as rand 1 and rand 2 .

Simulated Annealing (SA) Algorithm
SA is a metaheuristic algorithm that is utilized in materials. The SA employs the principle of not ruling out the worst-case scenario. This notion is quite useful because the result may not be the worst during the first few iterations [15]. Even though the criterion is not fulfilled by the solution, instead of rejecting the solution outright, it is rejected with a probability that is given in Eq. (3) below:

Energy change in Eq. (4) is indicated in Eq. (5) as given below:
In this equation, the fitness function's change is denoted as Δf, and the inverse of the Boltzmann's constant is elected as c. Given below is the resultant probability upon substitution of energy change in Eq. (5): Here, the energy levels' change is denoted as ΔE Boltzmann's constant is denoted as k B , The average value of the fitness function is T, which is the temperature for managing the annealing process, and c is the inverse of Boltzmann's constant.As a result, the probability expression can be written as an exponential function of the fitness function and the temperature difference.

Lightning Search Algorithm (LSA)
Nature's phenomenon of lightning has influenced the development of the new metaheuristic algorithm known as LSA. The main concept of this method is a generalisation of the hypothesis, which is linked to the step leader propagation mechanism. The LSA uses projectiles, which are a collection of rapid particles that traverse the search space in the form of a step leader's binary tree structure.Evolutionary algorithms' utilized terms such as "chromosome", "individual," or "particle" share similarity with this concept of the projectile.
The following [16] elucidates the three projectile types incorporated by the LSA.
• Transition projectiles The step leaders' initial population is formed with these projectiles. Numbers that are randomly chosen from the standard uniform probability distribution are utilized for these projectiles' generation. This distribution's probability density function f(x) is as per Eq. (6) below: • Space projectiles There are updates and evolution of these projectiles such that one of them turns into the leader. Equation (7) is utilized to carry out the update mechanism.
In this equation, the new space projectile is denoted as p s j , the old space projectile is denoted as p s i , and a function that will generate numbers randomly from the exponential distribution is denoted as exprnd. The exponential distribution's probability density function is offered by Eq. (8) as below: The assumption for the μ used in Eq. (8) is that it is the distance D between the lead projectile p L and the p s i , as indicated in Eq. (9) below: • The lead projectile The best solution to projectile's representation. Update for this projectile will be by Eq. (10) as below: In this equation, the updated lead projectile is denoted as p L new The old lead projectile is denoted as p L , and a function which will generate numbers randomly from the normal distribution with a mean μ and a standard deviation parameter σ is denoted as normran (μ, σ). Equation (11) will offer the normal distribution's probability density function. The σ parameter is utilized as a kinetic energy E k variable, which will decrease exponentially with the iteration's progression, as indicated in Eq. (12). While the total number of iterations is denoted as T, the current iteration's number is denoted as t.
The old projectiles are replaced with newer space and lead projectiles, and new channels are built only if their energy (quality) is higher than the old one. The LSA's second distinguishing feature is its forking process. In this process, an additional channel (a projectile in a different direction) is generated as a symmetrical copy of a successful projectile.The production of a new projectile p j is described by Eq. (13), where the upper and lower boundaries are represented by a and b. Following that, the quality of information is assessed. The better of the two bullets is preserved in the population, while the other is removed (channel elimination). This method is used on LSA with a very low success rate.

Proposed SA-LSA Algorithm
LSA is regarded as the primary process in the hybrid SA-LSA algorithm. For the SA mechanism's introduction, LSA is included in the crossover and mutation operations for the population's further optimization. A new crossover operation is to select a certain number of people for each iteration, the introduction of a managed pool, on the basis of the likelihood of a Pc and a crossover. A two-point crossover is also done in random order on two of the men on the bank, with the same number of sub-units. In addition, the size of each unit is adjusted to a lower probability of Project change. The simulated annealing will be used to see whether or not they may be a sub-race of people who have been created by crossbreeding and mutation at the site of their parents.
There are two parts to the hybrid SA-LSA algorithm's implementation. At first, there is a generation of a better group focused on global search by the LSA algorithm's evolution. Secondly, SA is carried out by applying the crossover and mutation operations, which is focused on local search, for further enhancement of the solution's accuracy. The following [17] is the methodology of the SA-LSA: Step 1 Initialization of the LSA's population, iteration, and channel time, as well as crossover and mutation probability.

Step 2
Eq. (6) generates step leaders at random. The design of the multilayer microwave absorber is represented by the encoding of transition projectiles by binary strings.

Step 3
The projectile energy E sl is evaluated.

Step 4
The main loop is now activated. The absorber's worst step leader, best step leader, and current best maximum reflection coefficient have all been updated.
Step 5 The bad channel (solution) will be eliminated and replaced with the best if the maximum channel time is reached. If not, proceed to Step 6.

Step 6
The projectiles' direction is updated. Later, there is the ejection of space and lead projectiles through the utilization of Eqs. (7) and (10) for sub-projectiles' generation.

Step 7
The sub-projectile energy E P is evaluated.

Step 8
If E P < E sl, there is an update of the projectile position and energy and the occurrence of forking. Else, the original position is retained. Upon forking, two symmetrical channels are produced at the fork, and for entry into the next generation, only the better channel is chosen.

Step 9
There is the execution of the crossover operation, followed by the SA's execution.
Step 10 There is the execution of the mutation operation, followed by the SA's execution.
Step 11 If the maximum number of repetitions is reached, the result is considered the absorber's optimal design parameters. If not, return to Step 4 and begin looking for the next generation.

Proposed PSO-LSA Algorithm
The various benefits of PSO include quick convergence speed. However, it also has certain drawbacks like premature convergence and easily getting trapped in the local optima. The quick rate of convergence is an advantage of the classical LSA. However, low capability for resolving multimodal optimization problems, poor accuracy of the solution, premature convergence, and easy fall into local optimum are some of its drawbacks. There is a proposal for a hybrid PSO-LSA method for improvement of the LSA's search performance. The proposed hybrid PSO-LSA algorithm's flowchart is illustrated in Fig. 5.

Results and Discussion
The      Figure 7 shows that the PSO-LSA has a lower average end-to-end delay for 200 nodes by 6.06 percent, 6.06 percent, and 3.07 percent, 7.41 percent, 9.75 percent, and 5 percent for 400 nodes, 6.25 percent, 5.99 percent, and 3.85 percent for 600 nodes, 5.6 percent, 4.98 percent, and 1.96 percent for 800 nodes, and 6.74 percent, 5.64 percent, and 2.82 percent for 1000 nodes when compared with LSA, O-LEACH and SA-LSA respectively. Figure 8 shows that the PSO-LSA has a lower average packet loss rate for 200 nodes (6.25 percent, 7.31 percent, and 4.91 percent), 6.71 percent, 5.67 percent, and 2.19 percent for 400 nodes, 5.91 percent, 4.52 percent, and 2.07 percent for 600 nodes, 6.75 percent, 6.5 percent, and 3.01 percent for 800 nodes, and 5.88 percent, 5.51 percent and 2.93 percent for 1000 number of nodes when compared with LSA, O-LEACH and SA-LSA respectively. Figure 9 depicts that the PSO-LSA has higher lifetime computation by 2.02% and 2.02% for 100 number of rounds, by 5.46% and 3.24% for 200 number of rounds, by 17.5% & 13.49% for 300 number of rounds, by 22.86% and 15.17% for 400 number of rounds, by 93.33% and 37.84% for 500 number of rounds, by 118.51% and 29.33% for 600 number of rounds and by 138.46% and 66.67% for 700 number of rounds when compared with O-LEACH and SA-LSA respectively. The PSO-LSA has higher lifetime computation by no change for LSA, respectively.

Conclusion
WSN routing's primary design issue is coverage. Lower orphan nodes are used in this protocol to enhance the network's reliability as well as connectivity. More data is made available at the BS with values gathered by orphan nodes. This allows for a more informed application decision and a quicker answer. For homogeneous WSNs, the O-LEACH routing protocol can be enhanced to reduce isolated nodes and improve sensor network connectivity. Proposals of the hybrid SA-LSA and PSO-LSA techniques are given in this work for the minimization of the isolated nodes. Based on nature's lightning discharge phenomenon to the Earth, the classical LSA algorithm has a quick rate of convergence and also explores better solutions through replication of the lightning bifurcation process. Falling of the LSA into the local optimal solution is avoided through the SA's utilization. The algorithm has higher computational accuracy by adding crossover and mutation operations prior to SA's introduction. When compared to other heuristic algorithms, thinner and less reflective absorbers are obtained by the SA-LSA algorithm. As the standard LSA suffered from poor convergence accuracy, there was the addition of a PSO technique for its accuracy improvement. PSO is an evolutionary computation technique that is SI-based, which does not utilize evolution operators like crossover and mutation. Its benefits like simplistic operation and local minima avoidance, make it an efficient global optimization algorithm. Experimental outcomes demonstrate that the PSO-LSA has higher number of clusters formed by 6.45%, 6.45% & 6.45% for 200 number of nodes, by no change, 8% & 3.92% for 400 number of nodes, by 4.76%, 7.23% and 2.35% for 600 number of nodes, by 2.1%, 6.45% and 4.25% for 800 number of nodes and by 2.15%, 4.34% and 2.15% for 1000 number of nodes when compared with LSA, O-LEACH and SA-LSA respectively. In future work, the hybrid SA-LSA algorithm can solve this multi-objective problem and compare it with other algorithms to verify its performance. To implement various other meta-heuristic algorithms and to improve the computational complexity.