A Hybrid Genetic Algorithm With Bidirectional Mutation for Maximizing Lifetime of Heterogeneous Wireless Sensor Networks

Sleep scheduling is an effective mechanism to extend the lifetime of energy-constrained Wireless Sensor Networks(WSNs). It is often that the sensors are divided into sets with some constraints after plentiful sensors are deployed randomly, and then the sensors are scheduled to be activated successively according to the numbering of the sets. Many approaches divide the sensors into disjoint sets, which are not suitable for heterogeneous WSNs because of the waste of energy. In this paper, we propose a hybrid genetic algorithm which adopts greedy initialization and bidirectional mutation operations, termed BMHGA, to find a number of non-disjoint cover sets to prolong lifetime of heterogeneous WSNs, while subject to ensuring the full coverage of the monitoring area during the network lifetime. BMHGA adopts two-level structured chromosome to indicate the sensors and energy assignment to each set. A novel greedy method only uses little time to initialize the population that avoids time waste of random initialization. A new bidirectional mutation is proposed to keep multiplicity and global search. Through simulations, we show that the proposed algorithm outperforms the other existing approaches, finding the cover sets with longer lifetime by consuming less running time, especially in the large-scale networks. The experiment study also verifies the effectiveness of the proposed genetic operations and reveals the proper parameter settings for BMHGA.


I. INTRODUCTION
Wireless sensor networks(WSNs) consist of numerous wireless sensor nodes that are densely deployed in target area to monitor the physical or environmental condition, including building monitoring [1]- [3], health monitoring [4]- [6], object tracking [7]- [9], intelligent transport system [10], [11], etc [12]. Each sensor has three basic modules: sensing module, processor module, and transmission module. The sensing module at first senses specific information surrounding the environment with certain sensing range and the transmission module transmits the signal to a data center, such as a sink node, through radio link after processing the sensed data into The associate editor coordinating the review of this manuscript and approving it for publication was Gongbo Zhou . an electric signal by processor module. The above operations are powered by battery. Since WSNs are usually served for extensive and rugged circumstances, such as in the deep sea, arctic areas, and hazardous war zones, it is difficult to recharge batteries. Therefore, how to minimize the energy consumption of each sensor to extent the lifetime of the network is the foremost concern in WSNs.
Transmission module is a main unit contributing to the entire energy consumption of every sensor. In the module, different radio state consumes different energy. Minimum energy is consumed if the radio is in sleep state that there is no data to send or receive. Accordingly, sleep scheduling is motivated for the scenario as follows: a tremendous amount of sensors are randomly deployed such as throwing by aircraft. It is common as WSNs are used in unreachable area, the VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ sensors can not be configured artificially. Therefore, a portion of the sensors can already offer complete coverage and guaranteed connectivity of the area as dense deployment. The key point of sleep scheduling is to automatically and deliberately shut down subsets of nodes while remaining other nodes are alive with each given time interval [13]. The classic sleep scheduling methods usually divide the sensors into several disjoint sets with complete coverage and guaranteed connectivity, and the sets are activated successively [14]. In these methods, each sensor can only in one set that is alive with a given time. After the interval, even though there is remaining energy for the sensor, it can not be used anymore. The methods are suitable for homogeneous WSNs that assuming each sensor has same energy supply, the time interval of each disjoint sets is set as the lifetime of sensors. As a result, the whole lifetime of the network is the sum of periods of the disjoint sets. The sleep scheduling problem is transferred as finding the maximum number of disjoint sets named as disjoint set cover(DSC) problem. However, in realistic world, many applications are designed as heterogeneous WSNs [15]- [17] in which different sensors involved have different data processing capability, transmission capability and energy supply. Energy heterogeneity means that the nodes have different initial energy which is the most important characters because both computational heterogeneity and link heterogeneity will consume more energy resource [18]. In this situation, it is the energy waste if the sensors are divided into disjoint sets. For example, in Fig.1(a), assuming a unit time is a, each sensor may have different initial energy that is different number of units time.
The lifetime of s 1 , s 2 , s 3 , s 4 is 1a, 2a, 2a and 1a. Any two sensors can completely cover the target region. In disjoint sets cover problem, the network is divided into S 1 = {s 1 , s 2 } and S 2 = {s 3 , s 4 } for 1a time. The total lifetime of the network is 2a while there is still remaining energy 1a of s 2 and s 3 respectively.
In this paper, our objective is to find the optimal non-disjoint sets to maximize the lifetime of heterogeneous WSNs. In non-disjoint set cover(NDSC) problem, each sensor may be given different energy supplies and if the sensor has residual energy after a time duration in a set, it can be selected to other sets. As shown in Fig. 1(b), the non-disjoint sets are: S 1 = {s 1 , s 2 } for 1a time, S 2 = {s 3 , s 4 } for 1a time and S 3 = {s 2 , s 3 } for 1a time. The lifetime of the network is 3a which is 33% increase compared to the disjoint sets.
Compared with DSC problem, NDSC problem is more complex since a sensor can be assigned to multiple sets. It is nondeterministic polynomial (NP)-complete which has been proved in [19]. NDSC problem can be solved by approximation algorithms, however, the obtained solutions are not always optimal. Heuristic algorithms can also be applied to NDSC problem. Gentic Algorithm(GA) is a heuristic search algorithm that obtains the optimized results through simulating biological evolution [20], which is suitable for multi-objectives problems, especially the resource-constraint scheduling problems [21] with large search space and small number of feasible solutions. Its population can process a set of solutions and each individual can involve different objectives and constraints. Since the NDSC problem defined in this paper includes two objectives and two constraints and the scale of networks is great while the number of possible solutions is small, we prefer GA to solve the problem. However, the searching speed of the traditional GA is slow and it is easy to trap into the local optima. Therefore, a modified genetic algorithm is proposed in this paper, termed the Bidirectional Mutation Hybrid Genetic Algorithm(BMHGA). Given different initial energy and position of each sensor, the algorithm can find the non-disjoint sets to cover the target area fully and the sum of the lifetime of the sets is maximized. Compared with the existing works, the contributions of BMHGA are as follow: 1) For explicitly indicating the resource constraint and showing the schedules of each sensor, a two-level structured chromosome is designed in the paper. At a high level, each sensor is mapped to a gene. At a low level, there are genomes embodied in each 'high level' gene that is represented as a set of pairs, each specifying duration time for a different cover set.
2) An initial population of high quality can accelerate the population evolution of GA to reach a satisfactory solution rapidly [22]. Although the greedy algorithm makes a locally-optimal selection at each moment so that it cannot produce global optimized solutions, its advantages are their simplicity and efficiency [23]. Therefore, we initialize the chromosomes based on the feasible solutions that are obtained by a designed greedy algorithm to promote individual to evolve.
3) After greedy initialization, there are still a lot of redundant sensors in the individuals that need to be optimized. Thus, we propose a forward mutation that schedules the redundant sensors among the different cover sets without losing the coverage percentage of each cover set but increasing the total lifetime of the sets. GA is trend to the premature convergence to local optima. A backward mutation is presented to help skipping local optima when necessary. 4) Compared with the prior works, the proposed BMHGA can effectively extend the lifetime of the network with faster speed in different size of networks.
The BMHGA is executed by a central node that knows the number of sensors and their initial energy and location when deployment. The scheduling message is broadcast to the whole network after the scheduling scheme is computed. Then each sensor node would know when to sleep or activate. The scheduling can be based on the synchronization method proposed in [24], in which nodes are synchronized with their own clocks, sensors are able to interact with each other at the same physical time by periodical beacon broadcast.
The remainder of this paper is organized as follows. Section II describes the related works on this problem. The preliminaries and the problem definition are given in section III. Section IV illustrates the detailed implementations of the proposed algorithm. A series of experimental simulations are conducted and the results are analyzed in section V. Finally, section VI concludes the paper.

II. RELATED WORKS
The common approaches that sleep-scheduling protocols adopted for increasing the lifetime of the network are to divide the sensors into DSCs [25]. Cardei and Du [19] firstly proved the DSC problem is NP-complete. Deschinkel and Hakem [26] presented a near optimal algorithm with a lower bound. In [27], S. Henna constructed two disjoint cover sets in randomly deployed WSNs and presented an approximation algorithm. In [28], three kinds of algorithms named greedy game algorithms(GGAs) were proposed to solve the SET K-Cover problem in heterogeneous WSNs. However, these approximation approaches can not always find the optimal solution. Some researchers tried to use heuristic algorithms to find the optimal result. For example, Hu et al. [29] designed a modified genetic algorithm with forward encoding scheme(STHGA) and Mir et al. [30] adopted particle swarm optimization to maximize the lifetime of WSNs. The performance of the proposed approaches showed the heuristic algorithms are effective for solving the DSC problem.
In recent literatures, more sleep scheduling algorithms partition the network into NDSCs since NDSCs provide longer lifetime compared to disjoint cover sets [31], [32].
The methods of NDSC problem can be classified into three types: approximation methods, heuristic methods and bio-inspired search methods.
For the first type, Ding et al. [33] proposed a polynomial-time (4 + η)-approximation algorithm to extend the lifetime of WSNs based on Minimum Weight Sensor Coverage Problem. In [34], the target coverage with detection probability was considered and an approximation algorithm that has three main phases was presented. In the computation phase, the candidate coverage set of each target is calculated. In the selection phase, an independent coverage set is selected from every target candidate coverage set in turn. In the connection phase, a steiner tree algorithm is used to select some sensors as relay nodes that maintain the network connectivity.
Paper [35] formulated the master problem and subproblem of NDSC problem. Consequently a column generation based exact algorithm is proposed to solve the master problem and branch-and-cut method is adopted to reduce the computation.
Since the results of above methods are not always optimal and NDSC problem is also a NP problem, the heuristic algorithms are preferred. B.Diop etc [36] proposed a greedy algorithm that distributes sensors among disjoint sets and each set satisfies full target coverage. In [37], a centralized connected target k-coverage algorithm(CCTCk) and a distributed connected target k-coverage algorithm(DCTCk) were proposed. Two algorithms minimize the total number of active sensor nodes and guarantee that each sensor node is connected to a sink. A novel Energy Efficient Connected Coverage (EECC) scheduling was proposed to maximize the lifetime of WSNs in [31]. EECC elevates the coverage and connectivity ability of each sensor, considering its remaining energy and the sensor nodes which monitor the crucial targets are handled carefully as well the redundant coverage at critical points is avoided. In [38]- [40], the clustering method is used for prolonging the network lifetime. The adjacent sensors are clustered by self-organizing, and some of them are changed to sleep status. When an activated sensor is run out of energy, the neighboring available sensors are waked up to cover the data loss. The methods have good fault tolerance and performance. Since the frequent computation among the neighboring sensors, they are suitable for small-scale WSNs.
Besides the heuristic algorithms, the bio-inspired search algorithms are usually used to solve the NDSC problem. Zhong and Zhang [41] proposed an ant colony optimization method(mc-ACO) based sleep scheduling. mc-ACO constructs a first layer set and multiple successor sets by selecting the sensors to cover the uncovered area according to the pheromone. However, mc-ACO is not suitable for large scale networks and sometimes achieves premature convergence. Liao and Ting [42] adopted integer representation and designed a new fitness function that considers both the number of covers and the contribution of each sensor to covers. A local improvement method was also developed to enhance the performance on Set k-Cover problem. However, the algorithm is only used for target coverage problem. In paper [32], a novel gene coding to solve NDSC problem by using genetic algorithm(NDSC-GA) was proposed. Each gene is an array that includes the time periods of the sensors in the set. The length of a gene is the number of sensors in the network. In order to prolong the lifetime of network, NDSC-GA adopts random crossover and probability mutation for improving gene and creating new set. It takes much time to execute traversal operation, hence, NDSC-GA is not efficient when the number of sensors is large.

III. PRELIMINARY AND PROBLEM DEFINITION
In this paper, we consider that each sensor has the same sensing range and communication range. The sensing area of each sensor is a circle with the radius R and the communication range is twice of sensing range that means a completely VOLUME 8, 2020 covered network is also connected [43], [44]. Therefore, the sink node can connect with each sensor through multihop communication in the completely covered network. It is responsible for scheduling the sensors and collecting the sensing data from sensors. We also assume the sensors execute fault-free operations in their lifetime. For evaluating whether the target field is completed covered, we use the grid-based method [45] to approximately estimate the sensing coverage of sensors. Assume the monitored area is divided into L × W virtual grids of uniform size, the sensing area of each sensor is calculated as the number of grids that are totally inside its sensing region. When a set of sensors are deployed in the target field, the whole sensing area of the set is D grids, the coverage ratio P of the set is approximately as in formula (1).
If P = 100%, the target area can be covered by the set of sensors completely. For example, in Fig.2, two sensors are deployed in the area that consists of 48 grids and each sensor covers 20 grids. The overlapping area of two sensors are 4 grids. Therefore, the sensing range of the two sensors is 38 grids and the coverage ratio is 38 48 . For monitoring the area, if all of the sensors in WSNs are activated, full coverage should be satisfied. Otherwise, the arrangement of sensors fails.
When the target field consists of L × W virtual grids, assume all the sensors are alive, each grid t i is covered by n(n ≥ 1) sensors s i 1 , s i 2 , . . . , s i n with initial energy supply e i 1 , e i 2 , . . . , e i n . The maximum time period l i that grid t i covered by the sensors can be computed by where i ∈ [1, L × W ], e i k is the initial energy of sensor s i k .
The grid with minimum value of l i which is the critical field will firstly lose being monitored, meanwhile WSNs can not fully cover the target area. As a result, the upper limit lifetime T of network is decided by For example, in Fig.3, the target area is divided into 4 grids t 1 , t 2 , t 3 , t 4 and there are 3 sensors s 1 , s 2 , s 3 . t 1 is covered by s 2 , s 3 , t 2 is covered by s 1 , s 3 , t 3 is covered by s 2 , t 4 is covered by s 1 . The initial energy of sensors s 1 , s 2 , s 3 is e 1 = 2, e 2 = 3, e 3 = 4. Therefore, the maximum time period of each grid is l 1 = e 2 + e 3 = 7, l 2 = e 1 + e 3 = 6, l 3 = e 2 = 3, l 4 = e 1 = 2. The upper limit lifetime of the network T = min(l 1 , l 2 , l 3 , l 4 ) = 2.
There are still several simple concepts should be defined firstly before the problem is formally defined.
Definition 2 (Residual Energy of Sensor): Suppose sensor s i with initial energy e i belongs to k sets S i1 , S i2 , . . . , S ik . The lifetime of the sets S i1 , S i2 , . . . , S ik is e i1 , e i2 , . . . , e ik . Therefore the residual energy e ir of sensor s i is calculated by

Definition 3 (Lifetime of WSNs):
The sensors in WSNs are divided into c sets S 1 , S 2 , . . . , S c . Lifetime L T of WSNs is the sum of lifetime of sets.
The NDSC problem in this paper is defined as follows: Given a set S = {s 1 , s 2 , . . . , s N } of sensors are randomly deployed in an L × W field. Assume each sensor s i has initial energy e i and the identical sensing range R. The objective is to find c successive scheduling sets S 1 , S 2 , . . . , S c with the maximum lifetime L 1 + L 2 + . . . + L c of WSNs, satisfying: 1) each set S k = {s k1 , s k2 , . . . , s k|S k | } of sensors can completely cover the target area, where |S k | is the number of sensors that are assigned to the set S k .
2) as to any sensor s i , the total active time do not exceed its initial energy e i , that is where e iS k is the lifetime of set S k if s i is assigned to S k . If s i does not belong to set S k , e iS k = 0.

IV. PROPOSED ALGORITHM
To solve the NDSC problem, in this paper, we propose a hybrid genetic algorithm(BMHGA) which uses bidirectional mutations. In this algorithm, initialization with greedy techniques instead of random initialization is adopted for each chromosome, then adaptive crossover and multiple mutation operations are designed to accelerate the solving procedure. The chromosomes with highest fitness value are selected to next generation. The flowchart of the proposed algorithm is shown in Fig.4, where f records the best fitness value of chromosomes in the previous generation, i counts the number of generations that the best fitness value remain unchanged. Table 1 tabulates the notations used in this paper. The proposed algorithm is performed by the sink node. According the obtained computing results, the sink node will wake up the sensors successively.

A. REPRESENTATION OF CHROMOSOME
Since the multi-objectives and constraints are needed to be satisfied in the problem of the paper, the chromosome should include various information such as the cover sets, the corresponding sensors and their energy. The two-level structured chromosome is proposed in this paper. Since each sensor has a unique ID, at the high level of the chromosome, each gene is mapped to a sensor. Therefore each chromosome C m at the high level in the population is represented as where m = 1, 2, . . . , M . At the low level, each G mi is represented as a genome shown in (9) that the number of sets of sensor s i belongs to, and the specific sets with its lifetime are indicated.
where g ij is the scheduling number that means the sensors with the same scheduling number will form a set, |G i | is the number of total sets sensor s i is in. The benefit of the hierarchical genomic structure is the lifetime of the total cover sets and the corresponding scheduling scheme are contained in the chromosome so that it is easy to be evaluated.

B. GREEDY INITIALIZATION
Initially, in traditional GA, the individuals are usually generated randomly. However, in the case of this paper, we will use greedy policies for initialization. The first population is generated by a greedy algorithm. According to the method, at beginning, the grids in given field are marked as uncovered. There is a candidate set includes the whole sensors and the number of cover sets c = 0. Then the steps are executed as follows: 1)c = c + 1, and S c is initialized as an empty set.
2)A sensor from the candidate set that can improve the coverage percentage of the set S c is selected into the set S c , meanwhile the corresponding grids are marked as covered.
3)The second step 2) is repeated until the total grids are marked. The set S c is formed and the lifetime of the set S c is calculated. 4)Accordingly, the rest lifetime of sensor is updated. If the sensor is exhausted, it is removed from the candidate set. And the total grids are marked as uncovered.
5)Execute the above four steps in a loop until the sensors in the candidate set cannot cover the whole area.
Finally, the remaining sensors in the candidate set will form the S c+1 set which is an incomplete set.
A series of successive cover sets are formed by the greedy algorithm, therefore, the chromosomes are initialized from the result of the algorithm. The proposed greedy algorithm ensures the initial population is not entirely random and thereby the convergence is accelerated. Since the complexity of the greedy algorithm is polynomial O(c × N ), this initialization step takes little time to increase convergence speed significantly.
The whole initialization process is described as Algorithm 1, where function ClearGrids() marks all grids as uncovered, MarkGrids(s a i ) marks the grids as covered that is covered by sensor s a i . Function GetenCoverGrids(s n ) returns the number of the uncovered grids that sensor s n enables to cover. Function GetLifetime(S c ) calculates the lifetime of set S c , and function GetRestEnergy(s a n ) returns the remaining energy of sensor s a n .
After initialization, in each chromosome C h , there are c h complete cover sets and an incomplete set S h,c h +1 . After executing mutation and crossover, the coverage percentage of set S h,c h +1 rises higher. The lifetime of WSNs is increased when the incomplete set S h,c h +1 becomes a complete set.

C. EVALUATION & SELECTION
The chromosome indicates the full cover sets that WSNs are divided into and the lifetime of each set, therefore the c ← c + 1;S c ← {φ}; 5: for s n in S do 6: if GetenCoverGrids(s n ) > 0 then 7: S c ← S c + s n ; 8: MarkGrids(s n ); The larger the lifetime of WSNs is, the higher the fitness of chromosome is. If the lifetime of WSNs for two chromosomes is equal, the chromosome with a greater coverage percentage of the incomplete set is the better one. The population is sorted by fitness values, and then the chromosomes with the higher fitness are selected to the next generation.

D. FORWARD MUTATION
To search a better chromosome, there are two kinds of sensors should be scheduled.
1) Coverage redundant sensor: if a sensor in a set that can be removed without changing the coverage percentage of the set, we call the sensor is coverage redundant sensor. This kind of sensors should be rescheduled to other sets. Fig.6(a) shows the rescheduling procedure of coverage redundant sensors.
2) Lifetime redundant sensor: if the residual energy of a sensor is greater than 0, we call the sensor is a lifetime redundant sensor. It can be scheduled to other sets using the residual energy. Fig.6(b) describes the scheduling of lifetime redundant sensors.  In the mutation, K genes are checked randomly for each chromosome C h . If the related sensors are coverage/lifetime redundant, they are assigned to other cover sets in two ways. Firstly, if the redundant sensor is in a complete cover set, it is scheduled to the c h + 1th incomplete set. Secondly, if the redundant sensor is in the incomplete set S h,c h +1 , it is scheduled to one of c h complete sets, the specific number of the set is decided randomly. Fig.7 shows the redundant sensors in the complete sets are scheduled to the incomplete set S h,c h +1 , and the redundant sensors in the incomplete set S h,c h +1 are scheduled to one of complete sets. Since there is only one incomplete set for each chromosome, the first way of forward mutation can get the higher coverage percentage of incomplete set. The second way in forward mutation promotes the genetic diversity of chromosomes. This operation provides positive effect on evolutionary of individuals and thereby is termed forward mutation.

E. BACKWARD MUTATION WITH REPLACE OPERATION
When the highest fitness of chromosomes in populations gets stuck in a value, never to reach upper limit lifetime of network, the algorithm is trapped in the local optimum. The reason for this phenomenon is that there is no redundant sensor to be scheduled to the incomplete set. Thus, in this paper, backward mutation is designed to avoid the premature convergence. For the best chromosome in current population, if its fitness value is constant for G m generations, backward mutation is performed under two scenarios.
When there exists an incomplete cover set in a chromosome, since the coverage percentage of incomplete cover set is less than 1, even to the best chromosome, there still are grids without being covered by sensors. Draw a circle with radius 2R centered on the center of a random uncovered grid t u . For the incomplete cover set, the sensors within the circle are rescheduled back to random complete cover sets. Then replace operation is executed by rescheduling a coverage redundant sensor in a complete cover set that covering the grid t u to the incomplete set. For example, in Fig.8, there are 4 sensors s 1 , s 2 , s 3 , s 4 in an incomplete cover set and an uncovered grid t u . As shown in Fig.8(a), s 1 , s 2 , s 4 are in the circle that is centered on the center of grid t u with radius 2R. Then, s 1 , s 2 , s 4 are rescheduled back to the complete sets randomly and there is only one sensor s 3 in the incomplete set as shown in Fig.8(b). In Fig.8(c), after replace operation there are two sensors s 3 and s 5 in the incomplete cover set and s 5 can cover the grid t u . s 5 is a coverage redundant sensor which is rescheduled from a complete cover set. Fig.9(a) illustrates the scheduling directions in the situation.
If there is no incomplete cover set in the best chromosome C h that means P c h +1 = 0. The backward mutation reschedules the sensors in the last complete cover set S h,c h back to other complete cover sets randomly, such as shown in Fig.9(b). Every sensor in set S h,c h of chromosome C h has 50% chance to be rescheduled back. After backward mutation, the cover set S h,c h becomes an incomplete cover set.
In the first situation, the uncovered grid becomes being covered through the replace operation and the complete cover sets are changed by swapping the sensors. In the second situation, the combination of the complete cover sets that results in local optima is broken. As a result of backward mutation, all local optima can be avoided. Though the coverage percentage of the incomplete cover set or the last complete cover set may decrease after the mutation, that is also the reason why we call the mutation as backward mutation, the coverage percentage can rise when the forward mutation is executed again. The procedure of the backward mutation is shown in Algorithm 2, where function UncoveredGrid(C m ) picks an uncovered grid t u from the incomplete cover set S m,c m +1 in chromosome C m , function Distance(s n , t u ) calculates the distance between sensor s n and grid t u , function isRedundant(s n , S m,g mni ) checks if sensor s n is coverage redundant in set S m,g mni .

F. ADAPTIVE CROSSOVER
Crossover operation selects two individuals as parents to create new individuals. It aims to produce better chromosomes from old ones. The idea behind adaptive crossover [46] is that the crossover probability of each chromosome is determined by its genome and is evolved with it. Firstly, a chromosome C i is selected randomly from current population as a parent. For each chromosome C j , the matrix variance V ij with chromosome C i is calculated by (11) where G in is the gene that belongs to chromosome C i , |G in | is the number of sets that sensor s i belongs to, g ink is the set number. The chromosome C j with the greatest V ij is considered as the other parent. According to the method, only two parent chromosomes with maximum difference between them are chosen so that the genetic diversity of their offsprings is guaranteed. If all the chromosomes in the population tend to have the same genetic coding, the algorithm tends to converge. Therefore, in this case, the crossover operation will be stopped.
For inheriting the genetic material from the better of two parent chromosomes, the crossover probability is calculated as if F m = F max and P c m +1 > 0 then 3: t u ← UncoveredGrid(C m ) 4: for n := 1 → N do 5: if Distance(s n , t u ) < 2R then 6: for i := 1 → |G mn | do 7: if g mni = c m + 1 then if sensor s n covers grid t u then 15: for i := 1 → |G mn | do 16: if isRedundant(s n , S g mni ) then 17: g mni ← c m + 1 18: end if 19: end for 20: end if 21: end for 22: else if F m = F max and P c m +1 = 0 then 23: for n := 1 → N do 24: for i := 1 → |G mn | do 25: if g mni = c m and Rand(0,1)=1 then 26: g mni ← Rand(1,c m − 1) 27: end if 28: end for 29: end for 30: end if 31: end for where p better is the probability of selecting the gene from the better parent while p other is the probability to select a gene from the other parent. F better is the fitness of the better parent chromosome.
The formula (12) indicates the parent chromosome with higher fitness will maintain more genes to the offspring. If the parent chromosome is the best member in current population, the whole individual will become an offspring.

V. EXPERIMENTAL STUDY
In the simulation environment, N sensors are randomly deployed in a two-dimensional L × W area. Each node has its x and y location that randomly generated as integer values in [0,L] and [0,W ]. The sensing range of each sensor is R and the initial energy e i of sensor s i is also generated randomly as an integer value in [1,E max ], E max is the maximum value of initial energy of sensors in the network. All cases are run by a computer with an Intel i7-7700 3.60GHz CPU.

A. COMPARISON WITH OTHER ALGORITHMS
In this section, we compare BMHGA with other algorithms, including STHGA [29], mc-ACO [41], NDSC-GA [32] and EXACT algorithm [35]. Table 2 shows a comparison in aspects of assumptions and goals among the algorithms above. We can find that the goal of BMHGA is different from other algorithms.
The algorithms are designed for NDSC problem except STHGA, which is a classic algorithm that is proposed to solve DSC problem under the assumption that each sensor has the same initial energy(a unit energy). However, STHGA can be modified easily for the problem defined in the paper through a preprocess, in which if a sensor with multiple units energy, it can be regarded as multiple sensors all with a unit energy. For example, a sensor with 3 units energy is regarded as 3 sensors with a unit energy at the same location. After the preprocess, the genetic operations of STHGA can function normally just the size of WSNs increases.  Table 3 investigates the time complexity and space complexity of above mentioned algorithms, where the J is the number of iterations for each algorithm. The running time is relevant to the network scale. The time complexity of traversing N sensors is O(N ). BMHGA is a hybrid algorithm consists of greedy initialization and genetic operators. The computational complexity of greedy algorithm in initialization step is O(c × N ) that has been mentioned in section IV. In each generation, the running time is O(K + N ) that mainly consumed by the forward mutation and evaluation. Since the parameter K ≤ N , the time complexity of each generation is O(N ). From the Table 3, we can find that, for BMHGA, NDSC-GA and STHGA, the time complexity of each generation is O(N ) respectively that the algorithm which executes less generations will be faster. mc-ACO also adopts the greedy method at initialization, so the time complexity is the sum of two parts. Each iteration of mc-ACO is solvable in exponential time. Besides, time complexity O(N !) reflects that using the EXACT algorithm to get the best solution is the most costly. The space complexity of NDSC-GA is O(N 2 ) since the specific structure of individual. The algorithms, mc-ACO and EXACT, yield an O(N ) space complexity. Because the size of chromosome is dynamically determined by the number of assigned sets for each sensor, BMHGA and STHGA is solved in O(E max × N ) space. Usually, E max is smaller than N , the space complexity is O(N ) for the above two algorithms.
In the experiments, the parameter configurations of these algorithms are according to the corresponding references, which are shown in Table 4. For NDSC-GA, the population size M is set as 50 and the number of prescribed groups is set as P = N /10. The parameters of mc-ACO are the number of artificial ants M , exploitation rate q 0 , pheromone decay coefficient ϕ, global pheromone update coefficient ρ and heuristic coefficient β. The population size M , scheduling coefficient K 1 and K 2 , mutation probability µ and mutation generations g m are set in STHGA. For the proposed BMHGA, if there is no other declaration, the population size M is fixed at 3, the interval for performing backward mutation G m is 1, and the parameter K = 1 10 N . Since the processes and time complexity of these algorithms are extremely distinct, for a fair comparison, a maximum running time(maxRT) is used as the stopping criterion, except EXACT algorithm. If the lifetime of WSNs achieves T (the upper limit lifetime of the network), the algorithm also stops. All algorithms are executed 100 times for each case, with maxRT being 1 minute(60,000ms).
To evaluate the performance of different algorithms, firstly, a set of 13 cases with different number of sensors and different size of monitoring field in Table 5 are conducted. Table 6 lists the results obtained by the five algorithms on each case, including the average time(Time) in microsecond(ms) used for meeting the stop condition in each run, the success rate(ok) and the mean results(Mean). In all the cases, our proposed algorithm consistently reaches the superior performance than others, which implies that our algorithm can fast evolve to better chromosome and converge towards global optima quickly. The main reason is that our genetic operations especially the mutation operations can fully exploit the diversity of the chromosome and effectively avoid local optima. It is to be noted that, the proposed BMHGA produces   significantly better results than other algorithms on the cases 10 − 13. These results verify that, even in large-scale WSNs, the proposed genetic operations can enhance the performance of GA powerfully.
We further compare BMHGA with the four evolutionary algorithms by varying the sensing range. Fig.10 depicts the experimental results including consumed time and success rate. Fig.10(a) reports that BMHGA outperforms other algorithms and its running time is not affected by the increasing sensing range. It can be observed that the running time of STHGA and NDSC-GA is increasing when using greater sensing range. This is principally because the lifetime of network is increasing with the increasing R that takes more generations to find out all the complete cover sets. For mc-ACO, the consumed time is in a relatively stable state that given R ≤ 17, but the time is much larger than others when R = 18, 19, 20. From Fig.10(b), we can deduce the reason behind this is that, under the cases that R = 18, 19, 20, it is difficult for mc-ACO to find the optimal solution within the maxRT.

B. INVESTIGATION OF PARAMETERS
There is a main parameter K in the BMHGA, which is the number of sensors selected to be mutated in forward mutation. This section investigates the relationship among the number of sensors N , the number of selected sensors K in mutation operation and the consumed time of BMHGA. Furthermore, the suitable value of K is revealed here.
The running time of BMHGA under the search scenarios with the two varying parameters is reported in Fig.11. Comparing the running time with respect to different parameter values, it can be found that the time increases as N increases and K decreases. The BMHGA costs a lot of time to obtain the optimal result when K = 5, especially in the scenario that N = 500 and K = 5, the most time is consumed. This observation proves that the forward mutation plays an important role in searching optimal result. Meanwhile, from the figure, we can also find that the running time rises gradually when the number of sensors becomes larger. However, if the selected genes becomes more, the algorithm will be accelerated as more genes are changed in the chromosome without fitness value falling.
In addition, BMHGA is tested with K ∈ [5, 400], respectively, with the other parameter N being fixed. Fig.12 illustrates that the plot of the running time is generally partitioned to three phases. At start there is a very sharply decline and the least time is reached when K is equal to a certain value, e.g. K l . Then, the algorithm keeps a stable performance between the lowest point, e.g., K l and a certain K value, e.g., K i . When K exceeds the K i value, the running time slowly increases as K rises. We further compare the performances of 8 cases and note that as N increases, greater the range of second phase becomes and much slower the raise in running time for third phase is. This indicates that setting K in the range of [K l , K i ] can provide a good performance   for the algorithm, and meanwhile, the boundary values of the range, i.e., K l and K i , are depended on the number of sensors N . By observing these plots, approximately K = 1 10 N is recommended in this paper.
Besides K , the interval of backward mutation G m and the number of chromosomes M in a population are discussed. In Fig.13, the search speed of using different G m on different K and N is depicted and compared, where the vertical axis is the executing time to obtain the optimal result. The parameter G m decides the frequency that the backward mutation is performed. When using a large G m , the algorithm can be trapped in a local optimum for a long time, which is not efficient.
When using a small G m , if the K is too small, the algorithm takes long time to achieve a local optimum and executes backward mutation frequently, which is also not efficient.
From Fig.13, it can be observed that, in different scale of WSNs, when the values of K are great enough such as K ≥ 1 10 N , setting G m as 1 can help improving the search efficiency of BMHGA. Therefore, G m = 1 is recommended to be suitable setting.
The effect of different M on the performance of BMHGA is plotted in Fig.14, where the horizontal axis is M and the vertical axis is the running time(Time). It can be observed that the proper range of M is [2,4] for each case. A larger M will lead to more time needed in the process for each generation. When K is smaller than 20 and M = 2, since the diversity and the number of chromosomes of a population is decreased, more generations are required to obtain a optimal result. Hence, M = 3 is regarded as the proper value.
What's more, from the Fig.13 and Fig.14, we can find that the plots are almost overlapped in each case when K > 1 10 N . It demonstrates the correctness of the proper K setting that K = 1 10 N .

C. EFFECTS OF GENETIC OPERATIONS
In BMHGA, greedy initialization is used for construction of an initial population that can speed up searching for better chromosomes. Forward mutation is the basic operation for improving the value of fitness. Backward mutation is able to escape from local optima, where the replace operation is   designed for the incomplete cover set. In order to demonstrate the effectiveness of the proposed genetic operations, we compare the performances of BMHGA with default settings, without greedy initialization and without replace operation and without backward mutation that is shown in Table 7. The four algorithms are tested through executing the NO.1-9 cases in Table 5. Though the former three algorithms can gain the optimal results with 100% success rate, the convergence speed of BMHGA with default settings is always fastest. It validates that greedy initialization and replace operation can speed up the process of searching to get optimal results. The last algorithm obtains global optimal solutions in two cases. The success rates of case 1 and case 9 are 80% and 100% respectively. It is evident that backward mutation can jump out of local optima with great efficiency, and hence can support the global search.
To further observe the effect of the density of the network on the backward mutation and greedy initialization, we compare the fitness values of initial chromosomes and average executing times of backward mutation using vary redundancy rate. In the paper, the redundancy rate η is calculated by where e i is the initial energy of sensor s i . As illustrated in Table 8, the redundancy rate η decreases as the number of sensors N decreases with L × W = 20 × 20, R = 8, T = 100. The fitness value of the initial population F init , the executing times of backward mutation(Backward) and the average running time(Time) are related to the redundancy rate η. Since the density of sensors in the area reduces, the number of complete cover sets obtained by greedy initialization decreases, whereas more backward mutation operations are needed that means the probability of being trapped in local optima increases. This observation proved that the complexity of the problem depends on the redundancy rate. A small η will make a hard search, which would result in local optima and hence increase the executing times of backward mutation(Backward). On the other hand, when η is a large value, the global optima results can be obtained quickly. Moreover, this conclusion can be further verified by comparing the running time(Time) of cases with different η.

VI. CONCLUSION
In the paper, we have designed a modified genetic algorithm BMHGA for extending the lifetime of heterogeneous WSNs. Different from the previous works, BMHGA uses the two-level structured chromosomes to represent solutions. The benefit of this chromosome is the specific scheduling of each set and the detailed energy assignment of each sensor are reflected in each chromosome. A greedy method is designed to produce an initial population. This method only costs O(c × N ) time complexity but can accelerate the searching speed greatly. The novel mutation operations involving forward mutation and backward mutation are developed. The forward mutation can guarantee the diversity of chromosomes and the backward mutation can help jumping out of local optima effectively. Simulations results are verified that BMHGA is superior in the solution quality and computation speed to other methods on different size of networks, in particular, the advantages of BMHGA are even more obvious in large-scale networks.
As part of our future work, we will further investigate the heterogeneous WSNs. Since there is still possibility for reducing the time complexity of the greedy initialization, in the future, we will seek a method which has faster convergence speed so as to apply the proposed algorithm to larger scale network. Moreover, BMHGA may be modified to consider the sensors with different sensing ranges and different transmission range. And to be practical for more application scenarios, improving the fault tolerance of the algorithm is necessary. Another direction is based on BMHGA, to design a new algorithm for energy-efficient area coverage in 3D WSNs.