Optimized Lifetime of Wireless Sensor Networks Through Metaheuristic Firey Based Cluster Head Selection Algorithm

: A wireless sensor network is a type of wireless ad-hoc networks, which is a collection of individual sensor nodes that are battery-operated devices and connected through ad-hoc and self-configuring connectivity. Therefore, the energy-saving of sensor node is a challenging design issue. Hence, the lifetime of a node is decreased. To enhance the network lifetime and optimal energy consumption, clustering is one of the best methods in WSN. While message transmission there is more distance between the cluster head and base station then more energy drained by the cluster head compare to the remaining sensor nodes in a particular cluster and if the energy consumption is more then automatically the network lifetime decreased. Therefore, this paper proposed an optimal metaheuristic firefly based cluster head selection protocol (FCH) by finding fitness value for selecting the best cluster head. This best-elected cluster head drains less energy as well as increase the network lifetime. In addition to the proposed FCH compared with two basic sensor networks algorithms low energy adaptive clustering hierarchy (LEACH) and Data transmission (DT). The FCH algorithm achieved better results than compared algorithms in terms of dead nodes, remaining energy, and alive nodes of the network.


Introduction:
In recent years, wireless sensor networks (WSNs) are using in various applications like battlefield, military surveillance, oceanography, forestry, temperature, pressure, humidity, etc. Due to its easy monitoring nature in the inaccessible environment. Wireless sensor networks are a collection of small battery devices are known as sensor nodes, which are distributed to observe environmental parameters such as temperature, pressure, etc., and connected to the base station to cooperatively pass their data to a primary location called destination [1][2][3]. The destination gathers the data from the sensor nodes and reports the same information to users through the Internet.
A sensor device consists of a radio transceiver that acts as both transmitter and receiver, an electronic circuit for providing an interface to the associated sensors, a microcontroller, and an energy source usually a battery [4]. Based upon the nature of the applications the size and cost of sensor nodes show a significant degree of variation. In various applications, sensor devices demand self-organization and infrastructure less network due to sensor networks inherit the features of the wireless ad-hoc networks for smooth monitoring and collection of information for different distinct events [5]. However, the sensor nodes restricted why because very few battery energy resources of deployed sensor nodes and which are communicate wirelessly in such a way that to keep the network lifetime as long as possible [6]. If sensor nodes are depleted at some position in the network, then the further transmission of information over the network will be stopped. To overcome this depletion of nodes as well as to enhance the network lifetime, there is a very important technique in sensor networks is a clustering technique. In this technique, the network segregated into the number of groups is called clusters . Once the whole network divided into clusters, a cluster head is select from each group to communicate with the base station and the remaining nodes are the cluster members. if the distance between cluster head (CH) and the base station is more, then more energy is drained by the cluster head compare to the remaining sensor nodes in a particular cluster and if the energy consumption is more then automatically lifetime of the network decreased and if the elected cluster head died very fast then the complete cluster disconnected from the network. So, look after selecting the cluster head node [7][8][9][10]. The clustering environment of wireless sensor networks shown in below fig.1.

Fig.1.clustering environment in sensor networks
This paper used one of the naturally inspired original metaheuristic algorithms that are the firefly algorithm with calculated fitness value for selecting the optimized cluster head. This proposed Firefly based cluster head selection with fitness value algorithm minimizes the distance from the base station by dynamic change of the cluster head with better fitness value. Therefore, improves the consumption of energy and enhancement of the life span of nodes in the network.
The remaining section of the paper includes section-I contains the related literature survey of the paper, section-II contains the functionality of the proposed algorithm, section-III contains the results and discussions of the paper and section-IV includes the conclusion and feature work of a paper.

Related work:
Khushboo Manohar et al, [4] given that the type of communication between cluster head and nodes by analysing the lasting energy of the node and compared the proposed technique for cluster head selection with the basic LEACH routing algorithm.
Yun Li, et al, [9] gives the idea of one of the wsn cluster routing protocol Low Energy Adaptive and adaptive and cluster hierarchy (LEACH). Which is performed in many rounds with a division of time and in each round all nodes interact with the cluster head with the predefined criterion. Therefore, this paper focuses on reducing the time of each round, to enhance the network lifetime and throughput.
Parul Bakaraniya et al, [12] given the "Kmedoids-LEACH protocol (K-LEACH) for clustered WSN". Which provided the balancing energy consumption of nodes by using MRE (Euclidean distance and maximum residual energy).which is used to select cluster head. Due to this, the network lifetime is enhanced and compared the proposed K-LEACH with the basic LEACH algorithm then the K-LEACH given the better performance results.
K. Syed Ali Fathima et al, [13] gives that an idea about Clustering techniques that can be used to communicate between the base station and cluster head. If the distance between the base station and cluster head is so far then more energy will be consumed due to this the network lifetime is reduced. To rectify this, the Particle swarm Optimization meta-heuristic technique is used to extend the lifetime of wireless sensor network and energy efficiency.
Vikram Singh et al, [17] given enhancement of the network lifetime by using particle swarm algorithm with mobile sink (MS) and rendezvous nodes (RN). Here mobile sink node is used for the reduction of energy consumption and RN nodes used as a storage point for the mobile sink. P. C. Srinivasa Rao, Prasanta K. et al, [19] proposed an energy-efficient cluster head selection algorithm based on particle swarm optimization (PSO-ECHS). Which is implemented with help of fitness function and particle encoding for selecting the better cluster head to enhance the lifetime of the network and less energy consumption. In addition, consider different performance parameters such as sink distance, remaining energy and intra cluster distance.

Methodology:
Sensor devices are thin individual radio transceiver devices that are easily deployed in difficult environments and communicate cooperatively, but here the major challenging issue is energy consumption, which is depending on the distance between communicating source and destination nodes. So for providing the energy-efficient data transfer between the nodes we have few optimized meta-heuristic algorithms used for proper cluster head selection for better communication with efficient energy communication. Direct transmission, ant colony optimization, particle swarm optimization and firefly algorithms are considered powerful metaheuristic algorithms [10,11]. This paper used the firefly algorithm and for this firefly algorithm applied fitness value in each round for the better selection of cluster head with better fitness value and the data communication takes place to the base station.

Implementation of the firefly-based cluster head selection:
Firefly is one of the Metaheuristic optimized algorithms that act as a natural behaviour of fireflies and which is used to solve the optimized continuous problems and it works based on glittering behaviour of fireflies [14] and three assumptions: 1. Fireflies can attract each other irrespective of gender. 2. Fireflies with less brightness will be moving towards the more brightness of the fireflies as the fireflies' attractiveness is correlative with the brightness. 3. The value of the brightness related to the objective function. In this algorithm, the attractiveness and intensity of the light are two major parameters. So, here the intensity of light for a particular solution is given by is the intensity of flashing of firefly x and f(x) is an objective value of a particular firefly x. whereas the brightness and attractiveness of a particular firefly inversely proportional to the distance from a light source is given by Where I0 the intensity of source light, r is fireflies distance and γ represents the absorption coefficient of light. The firefly attractiveness can be calculated as Where β0 is an attractiveness at distance r = 0 and the above equation can be written as β (r) = β0/(1+γ r 2 ) Here i and j are the distance between any two fireflies is given as The less attractiveness of firefly moving towards more attractiveness of firefly is given as Where β0 is a distance between attractiveness of fireflies at r=0, α is a randomization parameter, k is a randomly taken number from Gaussian distribution and xi, xj are the distance between two fireflies i and j.

Cluster head selection:
Initially, the network is formed with the given number 0f nodes and the nodes are distributed randomly by using a random function [16]. After deployment of the nodes, initially, based on the given clustering probability, k number cluster heads selected randomly and then clustering will be completed and data communication takes place. Here the nodes energy imagined as the light intensity of fireflies in the firefly algorithm and the movement of the firefly similar to the location of the cluster head movement. Here the clustering follows the firefly algorithm property that is the less energy nodes of the clustering attract towards the higher energy nodes of the clustering. The optimized cluster head (CH) selection takes place in rounds. In the very first round, the cluster head selection takes place energy-based switching and the dead nodes are initialized to zero and computed energy of each node. Suppose, if node energy gets zero then the dead node count incremented by one and based on the given probability the cluster head CH is selected and then compute the distance between the cluster head and each node [17]. Nodes, which are getting less distance to a particular cluster head, then assign those nodes to that particular CH. After cluster assignment, each node energy compares with CH. If node energy is higher than the CH then that node is eligible for CH. This concept is the same as the firefly algorithm and then the fitness value is computed for elected cluster head by using.

Fitness value =
Here, k indicates the number of the cluster head, n signifies a number of cluster nodes, ECH (k) is the cluster head energy, dCH-BS denotes the path from cluster head to base station, dik denotes the distance from member nodes to cluster head and The above process is repeating up to maximum possible rounds that is the clustering is iterated till the maximum number of rounds and fitness value of the cluster current optimization round stored along with previous optimization round [18]. the fitness value of the clusters and then stored fitness values are arranged in decreasing order and select the better fitness value cluster head and after selecting the better cluster head, the data communication takes place between all nodes and their respective cluster head and then CH collect data from all nodes and aggregates and transfer to the base station and after that, all nodes update their energy by calculating energy consumption by using first-order radio model and then go for next step [20][21]. This process repeats until reach the maximum iterations.

Results and discussions:
For simulation, the purpose used MAT lab simulation tool, distributed 100 nodes in 100 m * 100 m area randomly with the location of the base station at (50, 50), set the probability to select a cluster head to 0.1. (Minimum probability) and taken simulation variables given in table 1. The tables and graphs below are given the comparison analysis of LEACH, DT and proposed firefly-based cluster selection algorithm with 100 nodes and 2000 rounds for dead nodes, residual energy and alive nodes. Table 2 specifies the number of dead node values of three algorithms round wise and fig.2. given the lifetime of the network in terms of a dead node with the number of iterations. The performance of the FCH algorithm in terms of dead nodes compare with LEACH and Direct Transmission. In the case of DT algorithms after 200 rounds 13 nodes are dead, the death node count increase with increasing the number of rounds and after 1300 iterations, all nodes are last (dead). In the LEACH algorithm, after 1100 rounds three nodes are dead, and after 1900 iterations, complete nodes are dead. In the case of the proposed firefly-based cluster head algorithm (FCH), after 1600, iterations 59 nodes are dead and after 1900 iterations, all nodes are dead. Therefore, the Firefly-based cluster head selection algorithm outperforms compare to LEACH and DT algorithm. Table 2. Dead node counts values of three algorithms with the number of rounds. DT  FA  100  0  0  0  200  0  13  0  300  0  43  0  400  0  59  0  500  0  67  0  600  0  72  0  700  0  82  0  800  0  90  0  900  0  95  0  1000  0  98  0  1100  3  99  0  1200  17  99  0  1300  35  100  0  1400  47  100  0  1500  55  100  0  1600  67  100  59  1700  74  100  69  1800  91  100  69  1900  100  100  100  2000 100 100 100 Fig. 2. Dead node counts in-network with the rounds Table 3 specifies the total remaining energy of nodes of three algorithms for round wise and fig.3.given the Network residual energy with the number of iterations. The Initial Energy of the nodes are 0.5J and there are 100 nodes. FCH algorithm compares the alive nodes with Direct Transmission (DT) and LEACH algorithms. It is observed that the lifetime of nodes was increased in the Firefly based cluster head selection algorithm when it is compared with LEACH and Direct Transmission less energy was consumed. In the case of Direct transmission, after 1300 rounds the energy became zero and in the case of LEACH and FCH, the energy become zero after 1900 rounds but compare to LEACH in the firefly-based cluster selection algorithm consumes less energy and contains maximum remaining energy.   Table 4 specifies the alive nodes of the three algorithms with the number of iterations and fig. 4. shows the active (Alive) Nodes with the number of iterations. Firefly algorithm compares the alive nodes with LEAH and Direct Transmission (DT) techniques. It is observed that nodes lifetime was increased in the Firefly algorithm when it is compared with LEACH and Direct Transmission. In the case of Direct transmission, the start of the decreasing of live nodes after round 200.in the case of LEACH, the live node decreases from round 1100 and in the case of the firefly-based cluster head selection algorithm live node decreases from round 1600. So that the lifetime of the network enhances with this proposed algorithm.  ROUNDS  LEACH  DT  FA  100  100  100  100  200  100  87  100  300  100  57  100  400  100  41  100  500  100  33  100  600  100  28  100  700  100  18  100  800  100  10  100  900  100  5  100  1000  100  2  100  1100  97  1  100  1200  83  1  100  1300  65  0  100  1400  53  0  100  1500  45  0  100  1600  33  0  41  1700  26  0  41  1800  9  0  31

Conclusion:
Clustering plays a vital role in a wsn to enhance the lifetime of the network and optimal energy consumption of nodes. Each cluster member node dispatches their information to the cluster head and the cluster head gather all cluster member nodes information, process and then forward it to the central base station. While message transmission there is more distance between the cluster head and base station then more energy drained by the cluster head compare to the remaining sensor nodes in a particular cluster and if the energy consumption is more then automatically the network lifetime decreased. In this work, to achieve energy efficiency a new meta-heuristic Firefly based cluster head selection algorithm (FCH) proposed by using fitness value. To get the optimal cluster head, CH should be elected based on the remaining energy of every node. Therefore, network lifetime is increased and energy efficiency is optimized. The evaluated proposed technique compared with LEACH and Direct Transmission (DT). The proposed technique performs better than these two clustering approaches. This model can further be improved by hybridizing these metaheuristic algorithms. To achieve better results to optimize the energy utilization and to enhance the network lifetime in wireless sensor networks.

Declarations:
Funding: Not Applicable

Conflicts of interest: Availability of data and material: Not Applicable
Code availability: custom code.

Authors' contributions:
CH. Figure 1 clustering environment in sensor networks Figure 2 Dead node counts in-network with the rounds Figure 3 The remaining energy of the network with the rounds Figure 4 Alive nodes of the network with the rounds