Particle Swarm Optimization for Wireless Sensor Network Lifespan Maximization

Despite the deployment of wireless sensor networks in diverse fields (health, environment, military applications, etc.) for tracking or monitoring, several challenges, such as extending the lifetime of the network under energy constraints, still need to be resolved. Lifetime is the operational time of the network during which it can perform dedicated tasks and satisfy the application requirements. The energy constraints dictate that the energy consumption of sensors should be minimized since in most cases the sensors are battery-powered. Various methods have been proposed to work around this problem using scheduling approaches. In this paper, particle swarm optimization-based scheduling was designed and implemented to maximize the lifetime of wireless sensor networks formulated as a Non-Disjoint Sets Cover (NDSC) problem. The experimental findings show that the proposed approach is extremely competitive to the state-of-the-art algorithms, as it is able to find the optimal and best-known solutions in the instances investigated.


INTRODUCTION
Wireless Sensor Networks (WSNs) are a type of wireless and ad hoc network.WSNs combine sensing, processing, and networking over miniaturized sensor nodes (often hundreds or thousands).They are typically deployed to monitor large or hazardous areas [1].WSNs offer some significant advantages, including the fact that they are less expensive to deploy than wired networks.Sensor nodes can be added and withdrawn with ease.Furthermore, the node's location can be modified without rewiring.Finally, WSNs can be configured into different network topologies (star, tree, mesh, etc.).Despite the distinct features of WSNs, particularly their simplicity and effective cost, they have an anomalous character related to their resource restrictions in terms of computing power and energy.In fact, in most cases, the sensor nodes are powered by batteries.Manual configuration, maintenance and battery replacement are often impossible.So, to overcome these energy constraints and to save energy consumption and therefore extend the network lifetime, many methods have been proposed, such as optimal deployment, clustering, multi-hop routing, data aggregation, energy harvesting, and sleep-wake scheduling [2][3][4].Much research is conducted in the direction of scheduling sensor activities.The deployed sensors are divided into a number of sensor sets each of which can cover all the targets and can send all the sensed data to the base station.These sensor sets can be disjoint or non-disjoint and are activated successively one by one.In each round, only one set is active.Only sensors in the active set are used to collect data from the surrounding environment and to relay them to the sink, whereas all the other sensors go into energy-saving sleep mode.Thus, each node or a cover of nodes should save as much power as possible by turning off the radio transmission when there is nothing to transmit.The process of clustering sensor nodes into cover sets and scheduling them to maximize the lifespan of the network belongs to the NP-hard problems.This kind of problem can be solved using either exact methods, like linear programming and branch-bound or metaheuristics, namely genetic, invasive weed optimization, and Particle Swarm Optimization (PSO) algorithms [4][5][6][7][8].The former approach requires an exponential computation time depending on the size of the problem to be solved, while the latter tries to obtain good solutions (not necessarily optimal) in a reasonable time.We focused on utilizing PSO since it has been proved to be effective in tackling a plethora of problems and it has not been investigated enough in extending the lifetime of WSNs.
In this paper, a PSO algorithm is used to solve WSN lifespan maximization problem, formulated as a non-disjoint set cover problem.

II. RELATED WORKS
This section reviews the related work on scheduling sensor activities to maximize network lifetime under application requirements that include target coverage.Lifetime is the operational time of the network during which it is able to perform the dedicated tasks while the coverage is a measure of the physical space the sensors are able to observe.Authors in [9] presented a greedy algorithm for solving the maximum lifetime coverage problem and the energy consumed in the sleep/active schedule.An empty blacklist is created when constructing a new set cover.Iteratively, a minimal energy sensor, which is not present in the blacklist and covers at least a new target is chosen.When there are many sensors with minimal energy, the selected sensor will be the one that covers the largest number of new targets.Unfortunately, this approach is not suitable for homogeneous networks.Authors in [10] suggested an improved cuckoo search algorithm that partitions sensors into a maximum number of NDSC with a sensing range that can be adjustable.Each cover provides k-target coverage to maximize the lifetime of the WSN.After calculating the upper bounds of the maximum number of NDSC, the authors find the covers that will be scheduled and activated one by one.Unfortunately, the k-target coverage consumes more energy than the single-target coverage.Authors in [11] proposed the bidirectional mutation hybrid Genetic Algorithm (GA) to find the maximum NDSC that completely covers all the targets and maximizes the lifetime of the WSN.This algorithm differs from the traditional GA in the chromosomes representation and in the use of a greedy technique for initialization rather than the random initialization.Also, a novel bidirectional mutation was utilized to speed up the convergence.The proposed algorithm is suitable for heterogeneous WSNs that contain sensors with different levels of initial energy.Authors in [12] recommended an exact method (LP formulation) and two polynomial-time greedy heuristics for target coverage problem in Directional Sensor Networks (DSNs).Their aim was to balance between maximizing DSN lifetime and fault tolerance.They provide optimal solutions when using linear programming but with high cost.However, at a lower cost, with the use of heuristics, the solutions obtained were suboptimal.Authors in [13] proposed two methods to extend the lifetime of WSNs adopting the NDSC approach rather than DSC.First, they used the binary coverage relations matrix to sort the randomly deployed sensors nodes and to find the binary relations that link sensors and targets to construct a maximum number of non-disjoint set covers.These obtained covers are scheduled utilizing an exact method and a GA with a novel gene coding to get a nearoptimal solution in reasonable time.The exact method gives the optimal solution, but requires a lot of computational time.Also, the metaheuristic employed is not efficient in a network that has a large number of sensors.Authors in [14] suggested a column generation method that finds the maximum NDSC to extend the lifetime of WSN.It is an exact algorithm that seeks to discover valid covers by a new integer linear programming model.The process is repeated iteratively and stopped only if there is no column with a positive reduced cost.The computation cost is decreased through the use of a branch-andcut method.This reaches the best solution, but it is costly.Authors in [15] recommended a novel scheduling called Energy-Efficient Connected Coverage (EECC).EECC increased the level of coverage and connectivity of the sensors.It considers the remaining energy of each sensor and tries to avoid redundant coverage of critical points in the monitoring area.Unluckily, EECC was only effective with homogeneous WSNs containing sensors with the same initial energy.Authors in [16] proposed a novel local wake-up scheduling based on ant colony optimization.They constructed a first layer which contains a set of active sensors that completely cover the targets.Then, they manufactured multiple successor sets to mitigate the problem that some sensors in the first layer set run out of energy.This approach is effective, but it is suitable only for small and medium-scale networks.
Complexity theory classifies most scheduling problems as NP-hard [5].This justifies the use of meta-heuristics (approximate methods), which provide acceptable (not necessarily optimal) solutions in a reasonable time.In this paper, PSO is used to solve the problem of randomly deployed sensors network lifespan maximization formulated as a scheduling problem.PSO has been proved to be an effective method for many optimization problems, and in some cases, it does not suffer from the difficulties experienced by other metaheuristics.

III. PROBLEM FORMULATION
The issue of WSN lifetime optimization based on the maximum number of NDSCs and their optimal scheduling belongs to the NP-hard family [5].It presents two difficulties.The first one is the assignment of each sensor to a cover set, and the second one is the scheduling of these cover sets to optimize the network lifetime.Data, constraints, and objectives of WSN scheduling problem are defined below.


represents a set of sensor nodes.A sensor node is labeled as ( = 1, … , ).


represents a set of targets.A target is labeled as ( = 1, … , ).


can monitor a subset of targets ( ) ∈ located in its coverage range .
 Each target could be monitored by a subset of sensors ∈ .
 A collection of elements of denoted is a cover for the subset of targets denoted ( ) if it can sense all the targets of ( ) ∈ .
 is considered as a cover if ( ) = .
 Each sensor node has an initial energy .
 ( ) is the total energy consumed by during a period of time .

B. Constraints
 Each target is covered by at least one sensor of .
 A sensor can be included into at most one set cover in the case of Disjoint Set Cover (DSC).
 A sensor can be included into more than one cover in the case of Non-Disjoint Set Covers (NDSC).

C. Criteria
 We have to maximize the lifespan, which is the time elapsed until all the available sensor nodes do not succeed to satisfy the targeted requirements.It can be expressed as [17]:

D. Example
To illustrate the benefit of using NDSC instead of DSC, let us assume that the three targets (Target 1 , Target 2 , and Target 3 ) in Figure 1 can be monitored by three sensor nodes (Sensor 1 , Sensor 2 , and Sensor 3 ).Example of topology of three targets monitored by three sensors.
Sensor 1 covers Target 1 and Target 2 .Sensor 2 covers Target 1 and Target 3 , and Sensor 3 covers Target 2 and Target 3 .If all the sensor nodes were to be activated simultaneously, then the network lifetime would be equal to the standard lifetime ℎ of a single sensor.By dividing the sensors into disjoint sets, the resulting network lifetime would still be ℎ , since for this topology a disjoint algorithm can only produce one cover set (e.g. "#$ = % $ " , $ " & ' or "#$ & = % $ " , $ " ( ' , or "#$ ( = % $ " & , $ " ( ' ).However, if a sensor node in Figure 1 can be part of two cover sets, then the network lifetime can be extended.By creating three non-disjoint cover sets (see Figure 2), each one activated for 0.5 × h hours, the total network lifetime can be extended to 1.5 × h (see Figure 3), assuming that the energy consumption during the sleep mode is negligible.Three obtained non-disjoint cover sets.
From the above observation, a sensor node can spend part of its energy within one cover and another part within another.So, finding the optimal lifespan requires solving two subproblems: (1) finding the optimal number of NDSC and (2) maximizing lifespan by scheduling.This problem belongs to the NP-hard family and that is why metaheuristics are considered in solving it.This paper aims to develop a new PSO-based method that can efficiently find the maximum number of NDSC for a set of sensors that can be effectively to prolong the WSN lifespan.

IV. PROPOSED APPROACH
Given that metaheuristic algorithms are competent in finding the best solution in an acceptable amount of time for especially hard problems, the following NDSC-based PSO is proposed to figure out the optimal number of non-disjoint cover sets and then to schedule them in order to maximize the lifespan of the network.

A. Particle Swarm Optimization
PSO was inspired by the social behavior of fish and birds.Each particle of the swarm (individual solution in a population), which is a candidate solution for the optimization problem, performs an individual search (cognitive search) and a global search to minimize an error function.PSO is built on the concept of progressively evolving a swarm of possible solutions to an optimization problem.Each particle has a position denoted by ) ∈ * + , = 1, … , , where is the number of particles (swarm size), and a velocity to determine and move to the next particle denoted by , ∈ * + .Every particle has also a fitness value to evaluate its quality.During the search process and over each iteration , the particles move and update their velocities and positions according to (2) and (3) [18]: ) -. = ) -+ , -. ( where / is the inertia weight, and & are the cognition learning and the social learning rates, respectively, and & are uniformly random numbers in the range of 40,16, 1 -and 3 -are the best personal and global solutions, equivalently, ) -. is the modified position of the 78 particle, and is the current iteration.

1) Coding
The first step in using PSO to solve any optimization problem is to map between the particle position of the swarm evolution concept and the special case of the investigated problem.For a set of sensors used to monitor a set of targets, the input of the PSO algorithm is the coverage relation matrix, which explains the targets ( ) from that are covered by each sensor from The sum of the monitoring periods will be equal to the network lifespan.Figure 4 represents the structure of a given particle.Fig. 4.
A particle coding.

2) Initialization
The particle swarm (or population) can be either generated using a random initialization or can be issued from an output of any other heuristic method.

3) Position and Velocity Update
At each iteration , the position and velocity of every particle (i.e. a potential solution of the considered optimization problem) are updated according to (2) and (3).

4) Fitness Evaluation
For each particle, the fitness value is the sum of the whole period multiplied by the period k.It can be mathematically formulated as in (1).

5) Termination
The simplest condition of termination is to let the PSO simulation stop once it reaches a maximum number of iterations, which is predefined before starting the optimization process.

V. NUMERICAL RESULTS
The algorithms were coded implementing python programming language on Widows10 and with i5 8th gen processor.

A. PSO-based Method for finding the NDSC
This study simulated a set of randomly deployed sensors = 10, 20, 30, …., 500, which have a constant sensing range equal to 3 and are used to monitor 5 targets in a 10 × 10 area.The hyperparameters of PSO are = & =2 and / =0.75.A different number of iterations and population sizes were investigated to find the NDSCs.Table I presents the number of NDSCs found engaging different small numbers of sensors utilized to monitor 5 targets, with number of iterations = 20 and population size = 500.It can be clearly noticed that the number of non-disjoint cover sets increases when the number deployed sensors increases.Table II depicts the number of NDSCs for a large number of sensors used to monitor 5 targets, number of iterations = 20, and population size =500.Through the previous table it can be observed that the number of non-disjoint cover sets increases when the number of deployed sensors raises and especially when this number exceeds the range of hundreds (100, 200, 300,…500).Table III presents the effect of the population size on the results (using the same number of iterations = 20).It can be detected that the number of non-disjoint cover sets increases when the number of particles used in the swarm raises.This can lead to the conclusion that the number of the non-disjoint cover sets can be maximized, but this can influence the execution time of PSO.Table IV provides the running time (ms) for different numbers of sensors with a different number of iterations.It can be spotted that for a fixed size of population, runtime raises when the number of deployed sensors increases.In the same direction, when the number of sensors were fixed and the size of the swarm was varied, the runtime increases.

B. PSO-based Method for finding the Optimal Scheduling
Table V compares the results obtained by the proposed NDSC-PSO approach and those provided by NDSC-GA and the exact method (ILP) on the same eight instances [13].In Table V, it can be observed that the results obtained by the proposed NDSC-PSO approach are better than those acquired with the NDSC-GA method.Indeed, the findings of NDSC-PSO reached the optimal solution for all the considered instances.

VI. DISCUSSION
After the conduction of many experiments, some conclusions can be drawn:  To improve the acquired results, the swarm size could be enlarged, at the cost of execution speed.
 The second finding concerns the effect of the number of sensors deployed on the complexity of the problem being addressed.
 NDSC-PSO outperforms other effective approaches known in the literature.
The first and second observations can be considered obvious.The third one is the main contribution and the most important finding of the current study.In fact, in all instances tested in this work, the NDSC-PSO reaches the maximum lifetime.This result can be further generalized by testing other new instances that address the same kind of problem (WSN), but with different constraints and objectives (e.g.sensor type: fixed, mobile, random, homogeneous, heterogeneous, fully/partially connected, mono/multi criteria problem, etc.).

VII. CONCLUSION
In this paper, a NDSC-based PSO was investigated and integrated into a scheduling approach to maximize the lifespan of WSNs.The experimental results were implemented in the case of random deployment of sensor nodes.The obtained outcomes were compared with those derived through an method, namely the ILP model, and those acquired via a metaheuristic, namely NDSC-GA, known in the literature.For all the cases considered, the NDSC-PSO approach outperformed NDSC-GA and provided results close to those of ILP.The experimental findings are very encouraging as the proposed method is able to discover the best network lifetime for the studied instances.A more comprehensive study should be conducted on a larger number of cases.Further research could focus on additional constraints of the sensor network, such as the mobility and heterogeneity of nodes.Another future aim would be to test the usage of a fully adaptive PSO algorithm called TRIBES or the hybridization of PSO and other heuristics.

Fig. 1 .
Fig. 1.Example of topology of three targets monitored by three sensors.