Optimizing Residual Energy and Delay in WSN Routing using Particle Swarm Optimization

For reliable use of wireless sensor networks, energy, and delay optimization are equally crucial. Packets must therefore be routed via the path with the least amount of delay and energy consumption possible. For both clustering and non-clustering WSN scenarios, this problem remains an exploratory challenge. The optimization problem is presented here as a multi-objective problem in the clustering and non-clustering WSN contexts. A new energy model is presented for Wireless Sensor Networks (WSN) that has two more components: switching between transmission and reception modes and using the CSMA/CA protocol for packet transfer. This optimization problem is solved in two working environments: clustering and non-clustering, using a stochastic optimization technique particle swarm optimization (PSO) that uses particles to explore the search space. The proposed PSO-based approach increases WSN lifetime by 45% over ACO and twice as much as GA when compared to Genetic Algorithm (GA) and Ant Colony Optimization (ACO). The result additionally demonstrates the WSN's delay-tolerant routing in two operational scenarios. The proposed routing framework offers the potential for prolonging the lifetime of WSNs in many real-time applications, including area monitoring


INTRODUCTION
Routing refers to the method of directing data transmission from its origin to its intended endpoint.In wireless sensor networks, the primary goal of routing techniques is to establish a pathway between source node to the base station.Length of such a path bears paramount importance when it is required to optimize energy consumption.A long path with more participating intermediate sensor nodes consumes more energy than a shorter path with fewer intermediate nodes.The reason is straightforward from the observation that a longer path requires more delay for establishing the whole connecting path in which each sensor node sends or acknowledges some control signals for the wireless link setup between them.Hence, the shorter path, or more precisely, a minimal path, is an appropriate choice for less energy consumption [1].Energy consumption stands as the pivotal factor influencing the lifespan of sensor networks due to their reliance on battery power for most sensor nodes.Optimizing energy usage presents a formidable yet indispensable challenge in sensor networks, aiming to minimize energy consumption.The sensor nodes which are the core components of WSN have limited processing speed, storage capacity, and communication bandwidth [2].Natural computing solutions have arisen because of traditional or conventional computing techniques failing to meet real-world challenges [3].
In the study by Srivastava et al. [1][2][3], several clustering approaches are over-represented, while the non-clustering environment is mostly overlooked.In many real-time applications, designing sensor node clustering is often impractical within WSNs.The clustering of sensor nodes is either ineffective or challenging to implement, particularly with the emergence of recent techniques such as the Internet of Things.In this scenario, energy optimization must be pursued within a non-clustering WSN environment.WSN can assemble data and sense packages and deliver them to the base station via intermediate nodes known as hubs in a nonclustering setting.As a result, in order to preserve energy, the number of nodes should be reduced to a minimum.To put it another way, the problem can be thought of as a multiobjective problem with the purpose of lowering energy consumption by taking the shortest path.This paper's study aims to extend the lifespan of WSNs by introducing PSO-based routing frameworks for both clustering and non-clustering working models.The rest of the paper as: Section 2 elaborate the related work, Section 3 introduces the energy model and PSO-based algorithms utilized for optimizing the residual energy of WSN, and Section 4 presents the simulated results along with a discussion.Finally, Section 5 offers the paper's concluding remarks.

LITERATURE SURVEY
Patil et al. [4] proposed AADITHYA, a novel AEB-AODV (Available Energy Based AODV) and Ad-hoc On Demand Distance Vector routing protocols.Simulations show superior performance, but challenges include limited real-world validation and implementation complexity.Study by Singh et al. [5] identifies criteria for optimal energy use in sensor nodes.Results suggest extended battery life via genetic algorithm parameter selection, despite implementation challenges and scenario-dependent effectiveness.Guleria and Verma [6] developed a procedure grounded in Load-Balanced Cluster-Based Routing Protocol Utilizing ACO for optimal cluster head selection, outperforming others by considering residual energy in addition to the probability weight factor.Energy conservation achieved [7] by activating the radio only during broadcasting with a fault-tolerant MAC protocol and node scheduling.Enhanced efficiency, potential limitations in protocol complexity.Hu et al. [8] tackle unequal energy consumption in WSNs, addressing issues like uneven power usage and premature node death using two routing algorithms [9]: multipath and optimal routing.This paper by Li et al. [10], using ant colony principles for WSNs, optimizes energy consumption, enhancing load balance and stability.Prioritizing higher residual energy nodes extends network lifespan.The study of Arya et al. [11] compares Energy Aware Routing with and without ACO, finding ACO minimizes energy consumption as nodes increase, extending lifespan.The energy consumption in WSN was optimized with the Neuro-Fuzzy Inference System (ANFIS) in this work [12].The research work by Cao and Zhang [13] refined the stable election procedure (SEP) for extending the lifetime of WSNs in a variety of environments.Authors of this research work [14] proposed a collaborative approach for multiple requests in service-oriented WSNs.The proposed technique boosted service sharing and lowered energy usage in a WSN network.The enhanced energy optimization routing protocol improves upon PARPEW (predictive and adaptive routing protocol utilizing energy welfare) model in the study by Wang et al. [15] by addressing its drawbacks.It introduces a refined head selection method based on residual energy, reducing intracluster communication energy.Bojan and Nikola [16] proposed a method for reducing consumption of energy during data packet transmission in WSN by employing a genetic algorithm.Different techniques have been discussed by Bouazzi et al. [17] for the improvement of life time as well as energy in wireless sensor networks.A sleep algorithm [18] for nodes of a random wireless sensor network was proposed to reduce energy consumption.The CMIMO (Cooperative Multi-Input Multi-Output) technology was studied for intracluster communication.An approach has been proposed by Al-Khayyat and Ibrahim [19] that used Ant Colony Optimization and K-means clustering to deliver optimal routing without requiring infrastructure or individual nodes.The protocolooptimizes energy [20] in WSN through dynamic selection of high residual energy nodes using energy regions.Bahadur and Lakshmanan [21] introduced a meta-heuristic GA-based algorithm by using different parameters like selection, crossover, fitness function, and mutation.It provides an optimized result in network coverage instead of random deployment.In the study by Roberts and Ramasamy [22], the study combined the Golden Eagle Optimization Algorithm with enhancements to the Grasshopper Optimization Algorithm to introduce an improved cluster-based routing protocol named GEIGOA.Gunigari and Chitra [23] introduced an Energy-Efficient and Reliable Routing Protocol using genetic algorithm (GA).The HPSO-ILEACH hybrid method [24] optimizes cluster head selection in WSNs, enhancing load balancing, power efficiency, and network stability.Most techniques discussed so far use a traditional energy model, such as the power model [25,26], but in practice, energy consumption use is governed by rather than bound by the assumptions established in the power model.
This work adopts a different energy model for WSN.Further, the above-mentioned works presented clustering techniques to reduce energy consumption.The cluster head is picked at random or according to criteria such as least distance node, largest residual energy, and so on in these methods.On the other hand, distance-based clustering algorithms have been found to be more effective than other techniques.As a result, the challenge of energy consumption becomes a multiobjective problem, wherein energy conservation is achieved by selecting the best cluster head with both the shortest distance from the cluster center and the highest remaining energy.
The majority of the research works mentioned above are aimed at minimizing energy consumption in WSNs by proposing various energy-efficient clustering techniques.Depending on the situation, they frequently apply heuristic or meta-heuristic procedures to address single or many objective domains.Techniques like the Genetic Algorithm and its variations, as well as Particle Swarm Optimization, are examples of population-based methodologies.Although the Genetic algorithm typically fails to yield a global optimal solution, it is a popular choice among academics due to its simplicity and minimal number of required hyper parameters.When compared to Genetic Algorithms, Ant Colony Optimization requires significantly more hyper parameters to operate over the same issue area, but delivers a more competent optimal solution.While there are limited instances in the literature employing Particle Swarm Optimization (PSO), numerous research studies, including references [27,28], acknowledge PSO as a fast and efficient approach.Furthermore, PSO necessitates fewer hyper parameters than ACO.Consequently, PSO can serve as a strategy to reduce consumption of energy in application of WSNs with lower computational demands.The aforementioned concerns motivate us to research multi-objective residual energy minimization and its solution using PSO.
1.The study's major purpose is to find a more appropriate energy model for WSNs.
2. The residual energy maximization problem is formulated in two alternative working environments: clustering and nonclustering.
3. The particle swarm optimization-based technique is used for two different contexts.
4. It also provides a thorough examination of the simulated results.

PROPOSED PSO-BASED RESIDUAL ENERGY OPTIMIZED AND DELAY TOLERANT ROUTING FRAMEWORK FOR WSN
The WSN comprises '' sensor nodes deployed under certain assumptions, as outlined below: (i) All selected nodes are assumed to remain stationary after deployment.
(ii) Two distinct types of nodes are: nodes for environmental sensing, sink or base stations positioned at the middle of the WSN.
(iii) Sensors are assigned unique identification (ID) numbers and have similar remaining energy levels.
(iv) Assume that all links between nodes are symmetric.Within the WSN, an energy model is designed at the physical layer to calculate energy losses in every sensor node during the other sensor nodes communication.

Energy model of wireless sensor network
Let us consider that the WSN consists of n numbers of randomly distributed nodes over an area of A m 2 .Initially, each sensor node has the same amount of energy i.e.   (  ), where,   is the i th sensor node.Sensor node incurs energy consumption for the following reasons: 1.The sensor node either sends its own packets or forwards the packets of other nodes.If size of each packet is  and the number of packets transmitted by each node is   , total energy consumed to send   can be expressed as: Similarly, the energy consumption for receiving   number of packets is written as: Considering the above-mentioned factors, the consumption of energy by every sensor node can be expressed as: The rest energy of each sensor node at time (t) can be calculated as: The total residual energy (  ) of n number of sensor nodes can be calculated from Eq. ( 4) and is presented below: The transmitted packets by the sensor nodes must follow some specific paths to reach the base station.Such paths are represented by means of the nodes and the link connecting them.Mathematically, these paths can be expressed as a conjunction of the different wireless links i.e. ℎ =∧ ,=1 ≠ (  ,   ) where,   is the base station.
To optimize each sensor node's energy, it is required to minimal the transmission paths i.e., it contains a smaller number of nodes than other paths.Thereby ensuring that a smaller number of nodes become the intermediate nodes during the transmission.Further, transmitting packets through minimal paths minimizes the network delay, which is a function of the following parameters: 1. Delay due to wireless link establishment between two sensor nodes.2. Transmission time between the sensor nodes 3. Delay due to store and forwarding among nodes.

Optimization of residual energy for non-clustering environment
In a non-clustering environment, each node sends its packets to its nearest neighbour for further transmission.Consequently, the probability of a neighbouring node serving as an intermediate node during packet transmission remains uniform across different neighbour nodes.Therefore, for reducing overall energy consumption is to choose the shortest paths between each sensor node and the base station.It can be represented as |ℎ|  , where 'p' denotes the total number of paths and |path| indicates the length of the path.
Maximization of residual energy of WSN can be formulated mathematically, as Maximize   (7) Subject to constraints 1 ≤  ≤  (10) In the above-mentioned problem, the constraint (8) ensures a minimal path for transmission of packets within the source node and the destination.The total energy consumption by the WSN at any particular time (t) must have an upper bound   , which is represented by constraint (9).Once, the upper bound is achieved, no further maximization of total residual energy is possible.Constraint (10) is trivial in nature.

Optimization of residual energy for Clustering Environment
The clustering of sensor nodes provides many benefits including less overall energy consumption by WSN [28].However, considering the energy consumption model, a sensor node can be a cluster node if the ratio of its energy consumption and its residual energy must be greater than some threshold value (T).Otherwise, the node gradually becomes dead node and this significantly reduces the overall performance of the WSN.Mathematically, it can be expressed as: For each cluster (Ck), the inter distance between the sensor node and the cluster head (CH) can be expressed as (  , ), where,   ∈   .The sum of these distances is: The average distance between the sensor node and the clustering head is calculated as: If there are k numbers of clusters, the minimum average distance can be computed as: By using Eqs ( 5), ( 11) and ( 14), the maximization problem can be formulated as: Particle swarm optimization technique consists of a predefined number of particles (np).Each particle (Pi) provides a solution to the optimization problems defined in (7) and (15).The particles have their own position (Xi,j) and velocity defined within the search space of dimension(D).The positional vector of each particle is defined as: Similarly, the velocity of each particle can be represented by a D-dimensional vector   . = { ,1 ,  ,2 ,  ,3 ⋯  , }, 1 ≤  ≤   (17) The above-mentioned mapping of PSO for solving WSN routing problem can be explained by taking a two-dimensional search space.Thus, each particle has a location in this space with appropriate X and Y coordinate values.For example, P0(100,50) provides the location of particle P0 with 100 and 50 as its X and Y coordinate values.Similarly, the velocity of each particle can also be explained in two-dimensional space.
The fitness function is used to evaluate each particle to ensure the quality of the solution.The best solution obtained for each particle is called its PBesti while the best solution among the particles is termed as Gbest.The particle updates its position and velocity with respect to the Pbest value.This updating process continues till get the optimal result.The velocity and position of each particle is updated by the following equations: where,  1 ,  2 are the random numbers between 0 and 1, w is weight parameter, And  1 ,  2 are the weight factors.
In this study, each particle symbolizes a path originating from a sensor node (or cluster head) to the base station.The quantity of particles (np) corresponds to the number of sensor nodes, maintaining a one-to-one mapping relationship between sensor nodes and particles.

Proposed PSO based routing algorithm for nonclustering environment
The PSO-based routing algorithm in a non-clustering environment comprises the following three key steps: 1. Initialization of particles 2. Derivation of the fitness function 3. Update velocity and position of each particle The number of particles is equal to the number of sensor nodes.Each particle's position and velocity are initialized to values generated randomly from a uniform distribution.The dimensions of the particles are consistent and equal to the number of particles (np) in the population. Thus, where, 1 ≤  ≤   Similarly, the velocity of each particle is initialized as: 1. Derivation of fitness function Maximization of residual energy of WSN can be achieved by allowing the sending of packets through the minimal paths.Thus, the problem is multi objective in nature where residual energy is maximized while the length of the traversal path is minimized.It is intuitive to believe that a shorter path is associated with shorter delay as compared to a longer one.
By using Eqs.( 7) and ( 8) the fitness function (F) can be written as where, α is control parameter to maximize the residual energy (  )while (1-α) minimizes the path length and hence the network delay.Normally, α lies between 0 and 1 i.e. 0 < α < 1.

Update of particles' velocity and position
The velocity and position of each particle is updated in every iteration by the Eqs (18) and (19).The particles having the new position and velocity are evaluated by the fitness function defined in (20).Accordingly, the   , ℎ 1 ≤  ≤   and GBest are calculated by using the Eq. ( 20).The updation rules for updating   and GBest are presented below: GA and PSO are selected [29] and accordingly, the parameters of GA and ACO are set for simulation purposes (Table 1).

Genetic Algorithm
Population size Cross over rate Mutation rate 100 0.9 0.1  The residual energy of the sensor node becomes zero after roughly 70 iterations in the case of GA, but the residual energy of the node becomes zero after around 220 iterations in the case of ACO, as shown in Figure 1.The suggested PSO algorithm, on the other hand, can run for up to 260 iterations before the residual energy of node zero is reached.

Ant Colony Optimization
The graphical representation (Figure 2) demonstrates that the proposed PSO-based technique consistently produces the best results.In comparison the methods GA and ACO, the proposed strategy maximises life span.The alive nodes can survive for 260 iterations, which is significantly longer than the other two optimization strategies, ACO and GA  To carry out the simulation, 100 number of sensor nodes are randomly placed in 100×100 m 2 target area.Five number of energy efficient clusters are created among these nodes by using method.Three different distances are taken as parameters to select the cluster node while rest parameters are same as mentioned in [29].The PSO based algorithm is used to maximize the residual energy for each case (Figures 5 and  6).
The above result shows that the energy consumption is always greater through the maximum distance of nodes in comparison to the average and minimum distance.Minimum distance consumes less energy during transmission.

Delay tolerant routing for WSN
The proposed method uses a minimal path (MP) or minimum node distance for routing the packets to the base station.In contrast to this, if packets are allowed to travel in normal routing, the amount of energy consumption is much higher than that consumed by the proposed routing strategy.This is intuitively to believe that the delay associated with minimal path or minimum node distance requires less time delay as compared to any other path or any longer node distance.The energy consumption in both the cases i.e. delay tolerant and normal routing is compared in Figure 7 and Table 2. From this comparison, it is obvious to claim that the proposed method provides a longer life span to WSN.The proposed algorithm 1 i.e., PSO_Routing_NCE() is simulated over three areas of interest such as 1000x1000m 2 , 750x750m 2, and 500x500m 2 varying the number of sensor nodes as 50,100 and 200 respectively.The result is presented in Figure 8.The observation from this figure is quite straightforward as the lifetime of WSN depends directly on the number of sensor nodes and inversely on the area of deployment.
Further, the proposed algorithm 1 i.e., PSO_Routing_NCE (Non Clustering Environment) is simulated over different values of c1 and c2 (Figure 9).This figure shows that different values of c1 and c2 have very little impact on the result as the search is mainly carried out in a space containing different paths from the sensor nodes to the base station.This in turn ensures the proposed algorithm to be robust and very little sensitive to the external environment.

CONCLUSION
This paper proposes two efficient modified Particle Swarm Optimization (PSO) algorithms for residual energy optimization in WSN under both clustering and non-clustering scenarios.Comparing the suggested PSO-based methods to similar GA and ACO-based approaches, our results show to outperform in terms of extending the lifespan of WSN.The proposed algorithms are simulated over different network environments.As the proposed routing framework is delay tolerant while maximizing the residual energy, it can be suitably used across many real-time IoT applications like smart homes, smart cities, healthcare systems, and smart manufacturing to name a few.The presented works in this paper can be extended to address the dynamic routing problem of IoT networks.

Figure 1 .Figure 2 .
Figure 1.Residual energy maximization by proposed method, method based on GA and ACO

Figure 4 .Figure 5 Figure 6 .
Figure 4. Residual energy maximization by proposed method considering three different paths In order to analyze the impact of path length on routing among the sensor nodes as well as the base station, twenty number of sensor nodes are randomly distributed in a target area of 100x100 m 2 .The residual energy of WSN is

Figure 7 .Figure 8 .
Figure 7. Energy consumption by normal routing vs routing through MP (Delay tolerant) 4.5 Simulated results across different network configurations and parameters

Figure 9 .
Figure 9. Simulated results across different parameters Transmission of information to the base station (  (  )) 2. Reception of information (  (  )) 3. Switching from transmission to reception mode or vice versa(   (  )) 4. Execution of CSMA/CA protocol to transmit each packet (  (  ))

Table 2 .
Energy consumption by normal routing vs. routing through minimum distance (Clustering environment)