Synchronous Firefly Algorithm for Cluster Head Selection in WSN

Wireless Sensor Network (WSN) consists of small low-cost, low-power multifunctional nodes interconnected to efficiently aggregate and transmit data to sink. Cluster-based approaches use some nodes as Cluster Heads (CHs) and organize WSNs efficiently for aggregation of data and energy saving. A CH conveys information gathered by cluster nodes and aggregates/compresses data before transmitting it to a sink. However, this additional responsibility of the node results in a higher energy drain leading to uneven network degradation. Low Energy Adaptive Clustering Hierarchy (LEACH) offsets this by probabilistically rotating cluster heads role among nodes with energy above a set threshold. CH selection in WSN is NP-Hard as optimal data aggregation with efficient energy savings cannot be solved in polynomial time. In this work, a modified firefly heuristic, synchronous firefly algorithm, is proposed to improve the network performance. Extensive simulation shows the proposed technique to perform well compared to LEACH and energy-efficient hierarchical clustering. Simulations show the effectiveness of the proposed method in decreasing the packet loss ratio by an average of 9.63% and improving the energy efficiency of the network when compared to LEACH and EEHC.


Introduction
Wireless Sensor Network (WSN) finds extensive application in both civilian and military applications. It has been extensively used in target tracking, surveillance, monitor natural disasters, biomedical applications, habitat monitoring, and building management systems [1]. Sensor nodes in natural disasters sense/detect an environment to forecast disasters. In biomedical applications, sensor surgical implants monitor patient's health. In seismic sensing, sensors ad hoc deployment in a volcanic area detects earthquakes/eruptions [2]. WSN nodes use nonrechargeable storage device with restricted energy and in general replacing batteries is not possible. Thus, energy efficiency is an important issue, and designing power-efficient protocols is critical to prolong life of the sensors [3]. Typically WSNs monitor specific areas using sensors collect data and send to base station (BS). A typical WSN organized hierarchically is shown in Figure 1. In hierarchical structure, to save energy some nodes selected based on the objective function act as Cluster Head (CH) and aggregate data from its entire neighbor. The CH then sends the data to the BS and thus reduces network overheads to ultimately save energy in each node.
WSNs unlike traditional networks have their own design/ resource constraints which include limited energy, shorter transmission range, limited bandwidth, and minimal processing power in nodes. Based on the deployment scheme, network size varies with the environment. One of the most important activities in WSN is data aggregation which is the process of gathering data from multiple sensors, fusion of the data, and reduction of redundant transmission. Hierarchical techniques have been found to be quite effective in data aggregation.
LEACH randomizes rotation of nodes as CH and thus distributes energy load among network sensors evenly. The idea of LEACH protocol is that nodes become CH periodically with every period having two stages. The first stage is cluster construction and the next is data communication [4]. During the cluster formation each node selects a random number and compares with threshold values ( ). If the number is less than 2 The Scientific World Journal  ( ), then it is chosen as CH; else it remains as a regular node in that round. The threshold ( ) is given by where is the percentage of the Cluster Heads over all nodes. is the round number. is the set of nodes that have not been CH in the first 1/ rounds. Table 1 reviews popular hierarchical data aggregation protocols [5].
From Table 1 it can be observed that clustering objectives are varied with one of the key objectives being improvement in the network lifetime. Often a clustering objective facilitates meeting application requirements [6][7][8][9][10].
As LEACH depends on probability model efficiency in energy savings may not be obtained as CHs may be close to each other [11]. To overcome the disadvantages of LEACH many protocols have been proposed in literature to overcome the suboptimal solution. Various heuristic algorithms based on Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and Artificial Bee Colony (ABC) algorithm have been proposed.
In this work, investigations were carried out using the firefly heuristic. A novel firefly heuristic to avoid the local minimum problem is proposed. Firefly heuristic is based on the light intensity produced by fireflies. The intensity of light produced is mapped to the objective function and hence fireflies with low intensity are attracted towards fireflies with higher light intensity. In this work, a hybrid firefly algorithm, synchronous firefly algorithm, is proposed based on (i) ranked sexual reproduction capability of select fireflies, (ii) the fireflies created by this method having the best genes from the ranked fireflies.
The advantages of the proposed technique are (i) faster convergence, (ii) avoidance of multiple local optima.

Related Work
Hussain et al. [12] presented a wide taxonomy on CH selection techniques in WSN with comparative analysis. Hu et al. [13] proposed a multihop heterogeneous cluster-based optimization algorithm (MHCOA) which reduces the number of CHs, saving an average of 16.7% network energy with minimal end to end delay. Peng et al. [14] presented an energy-efficient prediction clustering algorithm to reduce energy consumption when broadcasting in clustering phase and prolong network lifetime. Bencan et al. [15] proposed an energy-heterogeneous clustering scheme (EHCS) which allows variations in the initial energy of the nodes based on the distance to sink to avoid the energy-hole problem. Optimization techniques for cluster formation and CH selection using PSO, GA, and ACO have been extensively proposed in the literature. Kuila and Jana [16] proposed PSO based CH selection technique with a multiobjective function considering energy consumption of the CHs and delay in forwarding the data packets. In the proposed system, each particle's dimension is equal to the number of sensor nodes in the network. Natarajan et al. [17] applied LEACH and PSO for optimal selection of energy-aware clusters and CHs. Ma et al. [18] proposed Dual Cluster Heads using Niching Particle Swarm Optimization (DCH-NPSO) which generated two CHs per cluster: Master Cluster Head (MCH) and The Scientific World Journal 3 the Slave Cluster Head (SCH). Ma et al. [19] proposed Adaptive Assistant-Aided Clustering Protocol using Niching Particle Swarm Optimization (AAAC-NPSO) to improve system lifespan and data delivery by optimizing energy dissipation in the networks. Shankar et al. [20] discussed an optimal radius algorithm and hybrid PSO algorithm for selection of CH to extend the lifetime of the network. Ali and Shahzad [21] studied PSO, ACO for routing overhead, route optimality, and energy consumption. Simulation results conclude that PSO and ACO based protocols are efficient routing optimization approaches for WSNs.
Rana and Zaveri [22] proposed an integrated approach of CH selection and routing in two-tier WSN using GA based CH selection with A-Star algorithm based routing to extend life of WSN. This approach leads to significant improvements in the network lifetime over other techniques. Peiravi et al. [23] proposed a multiobjective two-nested Genetic Algorithm (GA) based clustering for optimizing the network lifetime for different delay values. Kuila et al. [24] proposed a GA based load balanced clustering algorithm for WSN. Gupta et al. [25] presented GA based routing (GAR) to optimize the distance travelled by the data to reduce energy consumption. New routing schedules were calculated by the proposed GA based on the current network state. Cheng et al. [26] presented Dynamic Load Balanced Clustering Problem (DLBCP) and a dynamic GAs based solution to solve the dynamic network optimization requirements.Özdemir et al. [27] employed Multiobjective Evolutionary Algorithm based on Decomposition (MOEA/D) to optimize clusterbased WSNs. The proposed technique improved coverage and network lifetime compared to NSGA II.
Karaboga et al. [28] presented a novel energy-efficient clustering mechanism, based on Artificial Bee Colony algorithm to prolong the network lifetime. Kumar and Kim [29] proposed a new Efficient Learning Automata Based Cell Clustering Algorithm (ELACCA) for WSNs. Hoang et al. [30] proposed a harmony search algorithm for development of centralized cluster-based protocols by minimizing the intracluster distances between the cluster members and their CHs.
From literature it can be seen that GA, PSO, and ACO have been extensively used for CH selection. Though GA has good global search characteristics, convergence is poor. Representation of weights in PSO is done arbitrarily and hence search is limited to either global or local space. In this work, it is proposed to investigate the firefly metaheuristic which finds optimal global solution with fast convergence even under multiparameter optimization strategy.
Yang [31,32] demonstrated that though PSO achieves better global optima for various test functions for multimodal optimization than GA firefly algorithm is superior to both PSO and GA in terms of both efficiency and success rate. Similarly, Łukasik andŻak [33] demonstrated the superiority of firefly algorithm in continuous constrained optimization tasks when compared to PSO. Fister Jr. et al. [34] reviewed the use of firefly algorithm in various application domains. The authors conclude that the firefly can efficiently handle multimodal problems, has fast convergence, and is effectively used for general, global, and also local search heuristic.  Figure 2: The first-order energy model.
= ( 1 , 2 . . . , ) can be defined by The objective of the heuristic algorithm is given by where ( ) is the th objective to be minimized for the problem.
In this work, three quality of service parameters, packet loss rate, end to end delay, and remaining energy, are considered to build the objective function as a minimization problem.

Methodology
The first order energy model for energy consumed when communication occurs between two nodes is shown in Figure 2. For distance between two nodes, the transmitter energy consumption [34] for transmitting bit is given by The energy consumed by the receiver is given by In the above equations, transmitting and receiving 1 bit data's energy consumption is denoted by elec . fs , amp represent the coefficients of energy consumption for different channel propagation models. 0 is a threshold value denoted as 0 = √ fs / amp , to distinguish free-space path loss model from a multipath fading model. Energy consumption for integration of data packets of bit is expressed as DA ( ) = * * DA , where DA is energy consumption for integration of data of 1 bit.

Proposed Firefly for Cluster Head Formation.
Firefly algorithm metaheuristics work on the principle of the flashing lights of fireflies. The intensity of the light helps a firefly swarm move to brighter and attractive locations which can be mapped to an optimal solution in the search space. The algorithm standardizes some of the firefly characteristics and can be listed as follows: (i) Each firefly can be attracted to another irrespective of their sex. (ii) The brightness produced by the firefly is directly proportional to its attractiveness and between two fireflies, the firefly with higher brightness attracts the one which has lower brightness. A firefly moves randomly if it is not able to find a brighter neighboring firefly. (iii) In the mathematical model, firefly's brightness is based on the objective function.
Firefly metaheuristic is chosen for its capability of providing optimal solutions for multiobjective problems. In this work, a novel fitness function considering energy, end to end delay, and packet loss rate is proposed and given by where is the number of dropped packets. is the total number of packets sent. is the remaining energy in node .
init is the initial energy. is the end to end delay.
is the maximum allowable delay.
The cluster formation and CH selection in firefly are given in Algorithm 1.
In firefly algorithm [30], variation of light intensity and the formulation of the problem in terms of attractiveness are crucial as the objective function is encoded into it. The light intensity is calculated using ; the fixed light absorption coefficient and the light intensity can be computed based on distance such that where 0 is the original light intensity. Approximating using Gaussian law we have The attractiveness of a firefly is given in where 0 is the attractiveness at = 0.
In the proposed synchronous firefly algorithm, the fireflies are ranked and the best fireflies selected using tournament selection. The selected fireflies reproduce among themselves by crossover and mutation. An example of the proposed technique is shown. Table 2 shows the partial solution for the best fireflies obtained using tournament selection.
After crossover and mutation, the reproduced fireflies are given by Table 3.
The new solutions are added to the firefly pool and the next iteration of the firefly is continued.

Parameters for Network Simulation.
The performance evaluation of the proposed algorithm was carried out using MATLAB. The base station is located 50 meters away from (0, 0) of the network. The base station is assumed to have infinite power source: (i) Nodes are static and do not change location after deployment.
(ii) All nodes have uniform energy at the time of deployment.
(iii) Base station is located outside the network area.
(iv) Each node has a unique ID.
(v) The transmission power in the node varies based on the distance between the communicating devices. Table 4 shows the simulation parameters used in this work.

Result and Discussion
Simulations were carried out using LEACH, EEHC, firefly, and synchronous firefly algorithm. LEACH was used to compare the proposed algorithm due to its popularity in the literature and being a random method. Table 5 tabulates   the simulation results of packet loss rate and end to end delay for various clustering techniques. Figures 3-5 show the results number of clusters formed, lifetime computation, and remaining energy, respectively.
The proposed hybrid firefly algorithm minimized the packet loss rate by 2.27% when compared to firefly based clustering with 225 nodes and by 39.74% when compared to LEACH with 450 nodes. The proposed hybrid firefly algorithm minimized the end to end delay by 6.42% when 6 The Scientific World Journal  compared to firefly based clustering with 450 nodes and by 8.69% when compared to LEACH with 150 nodes. Figure 3 shows number of clusters formed for various clustering techniques for different number of nodes. It is observed that the proposed algorithm increases the number of clusters hence reducing the energy consumption significantly. Figure 4 shows the lifetime computation in the form of percentage of nodes alive for various clustering techniques when the number of nodes used is 225.
The proposed hybrid firefly algorithm increased lifetime by 66.67% when compared to firefly based clustering in 400 rounds and by 66.67% when compared to LEACH in 600 rounds. Figure 5 shows the remaining energy computation for various clustering techniques when the number of nodes is 225. The proposed hybrid firefly algorithm has an overall average remaining energy of 88.37% when compared to firefly based clustering in 500 rounds and by 28.57% when compared to LEACH in 600 rounds.

Conclusion
This work proposed a novel firefly based clustering protocol to select Cluster Head in WSNs. LEACH protocol needs the user to specify probability for use with a threshold function to determine whether a node will become a CH or not leading to NP problem. In the proposed hybrid firefly algorithm, the best fireflies selected using tournament selection are allowed to reproduce among themselves by crossover and mutation. The proposed method achieves faster convergence and avoids multiple local optima. Simulation results demonstrate the efficiency of the proposed method in decreasing the packet loss rate by 15.4% to 39.74% when compared to LEACH and by 6.16% to 30.66% when compared to energy-efficient hierarchical clustering. The proposed hybrid firefly algorithm also increased the lifetime of the network. Future work can be carried out to investigate the impact on increasing specific quality of service parameter.