Improvement of LEACH based on K-means and Bat Algorithm

Keywords— Low-energy adaptive clustering hierarchy protocol, Bat algorithm, Energy efficiency. Abstract— A low-energy adaptive clustering hierarchy (LEACH) routing protocol has been proposed specifically for wireless sensor networks (WSNs). However, in LEACH protocol the criteria for clustering and selecting cluster heads (CHs) nodes were not mentioned. In this paper, we propose to improve the LEACH protocol by combining the use of K-means algorithm for clustering and bat algorithm (BA) to select nodes as CHs. The proposed routing algorithm, called BA-LEACH, is superior to other algorithms, namely PSOLEACH, which using particle swarm optimization (PSO) to improve LEACH. Simulation analysis shows that the BA-LEACH can obviously reduce network energy consumption and optimize the lifetime of WSNs.


I. INTRODUCTION
The WSNs consist of sensor nodes (SNs) with limited energy, SNs collect environmental parameters and transmits information to the base station (BS). In WSNs, routing protocols aim to optimize the energy use of SNs. Several routing protocols were proposed of which LEACH was the first and most commonly used hierarchical routing protocol (Singh et al., 2017). In the LEACH protocol, SNs are clustered, each cluster randomly selects one SN as CH, and the clusters perform the function of collecting and transmitting data to the BS via CH. By the way, LEACH can extend the life of the network, reducing the energy consumption of each node. However, the LEACH protocol does not consider the current node energy and random selection of CHs can easily lead to uneven energy consumption between network nodes, shortening the network life. Recent LEACH improvement clustering routing protocols for WSNs will be proposed based on CH selection and cluster formation methods., many of which reduce energy consumption in the LEACH protocol; others consider the energy consumption balance (Cui et  The bat algorithm (BA) is a new stochastic optimization technique based on bat behavior. This algorithm has been successfully used to solve various kinds of engineering problems (X. Yang, 2014; X. S. Yang, 2010). BA better than PSO optimization in terms of speed of convergence, robustness, and accuracy (X. S. Yang, 2010).
In this paper, the BA-LEACH routing algorithm based on BA and K-means algorithm is proposed. The rest of this paper is organized as follows: In Section 2, we review the background of the LEACH convention and BA. Section 3 uses BA for CH selection optimization. Section 4, we verify the proposed improvements through simulation

Low-energy adaptive clustering hierarchy
LEACH protocol was the first hierarchical wireless sensor routing protocol, which was proposed by Wendi B. Heinzelman in 2002 (Heinzelman et al., 2002). Fig.1 shows the architecture of LEACH LEACH operation is divided into several rounds, each consisting of two phases: set-up phase, CHs selection processed and steady-state phase, the CH for each cluster receives and aggregates the data from cluster members and then transmits the aggregated data to the BS. CH selection is performed at the beginning of each round. Each sensor node decides independently of other senor nodes whether it will claim to be a CH or not, by generating a random number between 0 and 1 comparing with a threshold () Tn. The node is elected as a CH at current round if the number generated is less than a certain threshold () Tn. The threshold value is computed using (1) n is the number of nodes, P is the denoted percentage of the node to be selected as CHs, r is the round for which cluster the head is selected, and G is the set of nodes that have not been accepted as CHs in the last 1/ P rounds. After choosing the CH node, the entire network is informed by broadcast.

Bat Algorithm
Bat algorithm proposed by Xin-She Yang in 2010, which utilizes the behavior of nature bats [5]. This algorithm shows its superior capabilities when applied to the problem of global optimization. The BA is summarized as follows: In BA, the position and velocity of the t th − bat at the iteration ( 1) t + are given by (2): where  is a uniformly distributed random vector in the is the best solution after the t th − iteration. To avoid falling into local optimization, a new solution for each bat is created around the most optimal solution chosen by (3) In which   0,1   and t A is the average loudness value of all bats at t th − iteration. During the optimal search process, the loudness and the emitted pulse rate are updated according to equations (4) where 01   and 01   are constants.

Fitness function
In WSNs using the LEACH protocol, energy consumed when transferring from i th − sensor node (SNi) to CH node is determined by (2) where Tx E is transmitter energy per node, k is number of bit per data packet, mp  is amplification energy when distance from a sensor node to CH is greater than threshold where DA E is data aggregation energy, ( ) Our aim is to select the central node so that the total energy consumed during transmission and receiving data in the cluster is minimal. Furthermore, the energy transmitting and receiving data between sensor nodes were highly dependent on the distance between them. Therefore, we proposed the fitness function for selecting CH node as follows: ( )

Improved LEACH based on K-means and Bat algorithm
The BA is applied to determine SN as CH so that energy consumption and the total distance is minimum. In this algorithm, each bat has a position ( , ) dd X x y with a velocity of movement is i v . The position of each bat is evaluated by the fitness function, and the best position is the one that best matches the requirements of the problem.
In the problem of finding the CH node in a cluster of sensor nodes, each network node in a cluster is considered as a bat with hypothetical coordinates in two-dimensional space with corresponding travel velocity i v . The K-means algorithm is used for clustering, which aims to partition N sensor nodes into K clusters in which each SN belongs to the cluster with the nearest mean (cluster centers or cluster centroid). Combining K-means and BA algorithm to improve LEACH, called BA-LEACH. The pseudo-code of BA-LEACH is described as (2).  This section describes the various parameters in scenario simulation and the results of the proposed protocol. A 500 x 500-dimension field is taken for conducting the experiment. All sensor nodes are uniformly dispersed in the above-mentioned sensor field and it is supposed that the BS is located in the corner of the sensor field. The parameter settings of simulation as described in Table 1.

V. CONCLUSIONS
In this paper, an energy-efficient routing algorithm for WSNs has been proposed which considers selective clustering of CH nodes. By using the K-means algorithm for clustering, using BA to select SN as CH node leads to