FLAG: fuzzy logic augmented game theoretic hybrid hierarchical clustering algorithm for wireless sensor networks

Stability of the wireless sensor network (WSN) is the most critical factor in real-time and data-sensitive applications like military and surveillance systems. Many energy optimization techniques and algorithms have been proposed to extend the stability of a wireless sensor network. Clustering is a well regarded method in the research communities among them. Hence, this paper presents hybrid hierarchical artificial intelligence based clustering techniques, named FLAG and I-FLAG. The first phase of these algorithms use game-theoretic technique to elect suitable cluster heads (CHs) and later phase of the algorithms use fuzzy inference system to select appropriate super cluster heads (SCHs) among CHs. The I-FLAG is an improved version of FLAG where additional parameters like energy and distance are considered to elect CHs. Simulations are performed to check superiority of the proposed algorithms over the existing protocols like LEACH, CHEF, and CROSS. Simulation results show that the average stability period of WSN is better in FLAG and I-FLAG compared to other protocols, and so is the throughput of WSN during the stability period.


Introduction
Recent advancement in microelectromechanical systems (MEMS) and wireless technology have enabled production of low power, inexpensive, and mutifunctional tiny devices with inbuilt communication, computing, and sensing capabilities known as sensor nodes. These sensor nodes forms a collaborative settings called a Wireless Sensor Network (WSN) which collects useful information from a field of interest [2]. Wireless sensor networks gained tremendous interest in a wide variety of applications like disaster management, home automation, traffic control, environment monitoring, agriculture, health care, and military target tracking. Generally, sensors are equipped with irreplaceable, limited capacity batteries, and deployed in a hostile or harsh environment to collect required information. Major part of these sensor nodes energy drained in data transmission and receipt. Thus, an energy management of sensors plays an important role in prolong lifetime of the WSNs. There are many methods proposed to achieve energy efficiency of the WSNs. Among them, one of the most influential technique is clustering that divides the entire network into clusters. Each cluster has a cluster head (CH) and many cluster members. The cluster head is responsible for collecting data from its members, fuse it, and forward to the base station. Many state-of-the-art algorithms are proposed for clustering in WSNs.
Game theory is a branch of mathematics and heavily used to analyze the problem of economics, social science, and computer science. In recent past, It is employed to solve clustering, routing, resource allocation, and coverage optimization problems in WSN [35]. The first game theoretic algorithm proposed for clustering in WSN is called CROSS (Clustered Routing for Selfish Sensors). Here, each sensor node act as a player and each node plays clustering game with other players within the network to decide whether to be CH or not. Later, the authors in [34] proposed localized algorithm by considering clustering game within close neighbors.
In the proposed work, hybrid of game theory and fuzzy inference-based algorithms are proposed to improve the stability period of the network, named FLAG and I-FLAG. The FLAG protocol is a combination of CROSS and fuzzy inference system, where as I-FLAG is a hybrid of fuzzy inference system and improved version of CROSS protocol which considers energy of a sensor node and its distance to the BS as additional parameters.
The contributions of the paper are listed below: • An improved version of CROSS game theoretic protocol for CHs selection. • A fuzzy logic system is proposed to elect appropriate SCHs from CHs in FLAG and I-FLAG. • Residual energy, centrality, and distance to base station are considered as member functions to compute SCH election probability. • The proposed algorithms are compared with other clustering techniques like LEACH, CHEF, CROSS, and an improved CROSS.
The remaining parts of the paper is organized as follows. Section 2 discusses related work on clustering and state-ofthe-art techniques. The network and radio model are briefed in Sect. 3. The detailed discussion of the proposed model is presented in Sect. 4. Results and discussion are summarized in Sect. 5. Finally, Sect. 6 concludes the paper.

Related work
Most famous clustering algorithm LEACH [6] ensures that every node plays the role of cluster head within a set time interval. Since all nodes turns to be CHs in rotation basis and therefore energy consumption is evenly distributed among nodes. However, random rotation leads to uneven distribution of the CHs, and this leads to faster energy drain in certain nodes. As a improvement, LEACH-C (LEACH centralized) [5] algorithm is proposed. Here, each sensor node sends its location and energy information to the base station. Using Simulated Annealing algorithm and global information of nodes, BS selects optimal CHs. Since the algorithm expects each node to send information to the BS in every round, it causes lot of overhead and not suitable for larger networks. The Authors in [36] proposed HEED algorithm, which selects CHs periodically using residual energy and degree of nodes. The increase in network scalability and lifetime by supporting scalable data aggregation is observed in HEED compared to LEACH. However, it creates an isolated node in the network. A distributed energy efficient clustering (DEEC) algorithm is proposed in [26]. In this work, election of CHs based on ratio between residual energy of sensor node and average energy of the network. A stable election protocol (SEP) for heterogeneous wireless sensor networks is proposed in [29]. This algorithm increases stability of the network and ensures reliability of the sensor networks for a longer time. Advancement in Artificial Intelligence(AI) has brought a different approach towards getting the solution to science and engineering problems. These include meta-heuristic algorithms [7,[17][18][19], Fuzzy logic based algorithms [1,3,20], and game theory based algorithms [9,12,35].
Few of the meta-heuristic algorithms for clustering are described in [7,10,11,22]. The genetic algorithm based clustering algorithm is proposed in [7]. In [10], the authors used differential evolution algorithm for clustering. The authors in [11] proposed Biogeography-based optimization algorithm for clustering. This technique uses residual energy and distance to the base station for fitness function design. In [22], the authors adopted Biogeography-based optimization for clustering. This algorithm elects appropriate CH using residual energy, distance to base station, and distance to its member nodes. The authors in [4] proposed a hybrid meta-heuristic model for selecting load balanced cluster heads. In this work best features of Differential evolution and Artificial bee colony algorithms are exploited to get appropriate CHs. Further, Artificial bee algorithm is adopted for the dynamic re-localization of the mobile sink.
Many work in the literature adopts fuzzy logic technique for clustering. The authors in [8] proposed a fuzzy logic based CHEF algorithm. The algorithm considers remaining energy and local distance to select CHs. The sum of the distance from all the neighbor nodes within the radius Q is referred as local distance in the algorithm. The authors in [21] proposed an unequal clustering approach using Fuzzy logic. Here, local density and distance to the base station are used as input to the fuzzy system to select competitive radius for cluster size. In DUCF [3] distance to base station, remaining energy, and node degree are used as input to the fuzzy inference engine in clustering process. In [14], the authors proposed a fuzzy logic based distributed clustering algorithm. This algorithm is designed by considering energy efficiency and coverage requirement of the network. It handles the hot spot problem by forming unequal sized clusters such that more CHs are available near to the BS. The authors in [1] proposed a fuzzy-based unequal clustering algorithm. The algorithm uses residual energy, distance to BS, and density as fuzzy input variables; Competition radius and rank as fuzzy output variables.The work in [31], uses fuzzy logic for clustering by considering residual energy in CH, distance between CH and BS, and degree of CH. The authors in [23] adopted Fuzzy C-means algorithm for clustering in WSN. The authors in [13] adopted fuzzy logic to compute competition radius which decides the size of cluster for an elected CH. The work considers distance to BS, residual energy, and node degree as fuzzy input variables to decide competition radius. The authors in [28], proposed a Bacterial foraging optimization (BFO)-fuzzy method for multi-path routing. The work in [24] adopted fuzzy logic system for unequal multihop clustering to extend lifetime of the network. The work in [15], uses fuzzy approach for unequal clustering. The authors consider energy level, distance to BS, neighbor density, and neighbor cost to decide cluster head and cluster radius. In this work, the authors used first two parameters for cluster head election and cluster radius computation, but last two parameters for cluster radius determination. In [16], the authors used a hybrid of flower pollination algorithm and fuzzy logic for clustering. Each node residual energy, node centrality, and distance to BS are used as input parameters to the fuzzy logic system for computing fitness of each node to elect appropriate CH. The authors in [27] adopted fuzzy based clustering technique for effective load balancing and three tier multi-hop routing technique. In [20], the authors proposed a fuzzy logic integrated hierarchical LEACH algorithm. The algorithm consider mobility of sink, residual energy and centrality of CH to elect appropriate super cluster heads (SCHs), which is responsible for collecting data from CH and forwarding to the BS. In the work [32], named FuzzyLEACH, the authors considered residual energy and position of sensor node as fuzzy descriptors to elect appropriate CH. In [33], the authors improved the work of [20] by proposing optimal LEACH clustering algorithm for electing right CH, and used the energy average of CHs as a additional fuzzy input member function to elect appropriate SCH. Various game theoretic based clustering algorithms are proposed for WSNs. In [9], a first game theoretic algo-rithm is developed, followed by a work in [34], a localized game theoretical clustering algorithm (LGCA). An improved version of LGCA is proposed in [12] by adding energy component to select appropriate CHs. The authors in [35], proposed a Hybrid, Game Theory based and Distributed clustering (HGTD). In this work, residual energy and the number of neighboring potential CHs are considered to elect final CHs. The authors in [25], proposed a coalition game theory based hierarchical routing protocol to ensure uniform energy consumption across the network. The authors in [30], proposed an energyefficient clustering in mobile wireless sensor network using game theory. Here, a heterogeneous clustering game model is developed, in which predicted remaining energy, distance to base station, distance between nodes, and mobility speed of nodes are considered to compute probability inorder to elect right CHs. Comparisons between few selected protocols and their goals are summarized in Table 1 .

Network model
The proposed network model consist of homogeneous nodes having equal energy, same sensing, and communicating capabilities as shown in Fig. 2. Initially, CHs are selected using game theoretic algorithm [9]. Secondly, SCHs are selected among CHs using fuzzy logic. The working procedure for proposed model is similar to the work in [20,33].

Radio model
The radio model adopted from [6] for communication and computation energy dissipation and it is shown in Fig. 1. The multi path fading channel (d 4 power loss model) is employed whenever distance between sender and receiver is more than threshold value d 0 ; otherwise, the free space model (d 2 power loss model ) is employed as shown in Eq. 1. Therefore, energy required to transmit l-bit of information over distance d from sender to destination is calculated as follows Here, E ele is the energy dissipated per bit by the transmitter or receiver circuitry. The constants ε f s and ε mp are amplifier characteristics of free space channel and multi path channel respectively. The variable d is the distance between transmitter and receiver; The variable d 0 = ε f s ε mp , distinguishes two types of path loss model.
The amount of energy dissipated by the receiver after receiving l-bit data packet is calculated as follows: Here, E D A is the energy dissipated by the CH for aggregating a one bit information.

Assumptions
• All sensor nodes in the network are homogeneous and having same initial energy, memory, and communicating capabilities. • Sensor nodes and base station are stationary after deployment. • Cluster setup phase is similar to the LEACH or CROSS algorithm to select appropriate cluster heads.

Fig. 2 An instance of network model
• Elected cluster heads notify their residual energy, distance to base station and centrality to BS. • After receiving information from CHs base station employs fuzzy logic inference system to select SCHs. • Election of SCHs probability is decided on three input parameters residual energy, distance to base station, and centrality of CHs. • Association of member nodes with cluster nodes and association of cluster nodes with super cluster nodes are established according to their distance metric as described in LEACH. • The data transmission in the network happens in the steady phase of the network. Firstly, from sensor nodes to CHs and secondly, CHs to SCHs, and finally from SCHs to Base station as shown in Fig. 2.
The proposed FLAG and I-FLAG hybrid hierarchical clustering models are divided into cluster heads selection phase and super cluster heads selection phase. Table 2 shows all the definitions of variables and acronyms that are used in this article.

Cluster heads selection phase
In this phase, an existing CROSS and an improved version of CROSS game theoretic protocol are used. According to the definition of game theory, clustering game(CG) of WSN with N nodes, A actions, and U utility function are represented with three tuples as CG (N , A, U ). where tuples N , A, and U denote the player set, strategy set, and payoff set of the game respectively. Suppose sensor nodes adopt pure strategy to play the clustering game, then the strategy space or action profile has two choices; either node is declared (D) to be cluster head or not declared (N D) to be cluster head. With regard to utility, if none of the sensor nodes select strategy D, then utility for each sensor node will be 0. Sensor node payoff will be v, if atleast one of its neighbor sensor node is declared to be cluster head and such cluster head payoff will be v −c, since it plays the role of forwarding packets to the base station. Suppose there are only two players, then the Table 3 gives utility values of the two player game. Therefore, in general the utility value for any Table 3 Utility for two player clustering game player i which plays action a i from action profile set A in a N player game will take the following form such that a j =i = D The payoff or utility value v i for player i when it choose action N D, and if atleast one other player choose action D can be computed as follows [35] v i = l Ecm i (4) where l is the size of the data packet and Ecm i is the energy drain to transmit the packet to its respective CH [35], and can be computed as follows Here, R is the average radius of each cluster. Suppose node i chooses the action D, then its utility value is computed as follows [35].
where c i is the overhead of a node for becoming CH, Dr i is the node degree of a palyer i, and Ech i is the energy drain for node i for becoming CH [35]. Its value is obtained as follows From Eqs. (4) and (6), c i value can be calculated as follows Equation (8) takes the form by denoting w i = c i v i , as follows To avoid the w i value to be negative, a parameter w min is introduced, and w i is obtained as follows.
Suppose the sensor node i that chooses the action D with probability p i and the action N D with probability q i = 1 − p i . Then, there exists an equilibrium probability p i based on mixed strategy nash equilibrium as discussed in CROSS protocol [9], and is formally defined as follows Along the above equation we use residual energy and distance of the node to the base station to get appropriate probability for cluster head selection. The new improved version of CROSS for cluster head selection can be expressed as follows (12) where β ∈ (0, 1) is a weight factor, E i is the remaining energy and the E o is the initial energy of a node i respectively. The variables d i and d max are distance between node i and BS and distance to the farthest alive node to the BS respectively .

Super cluster heads selection phase
In this phase, Fuzzy inference System (FIS) is employed to elect appropriate SCHs from set of CHs.
FIS is a data base generally employed to handle uncertainties and imprecise information in the system. It consists of member functions and fuzzy rules. There are three types of FIS: Mamdani, Sugeno, and Tsukamoto. The Mamdani FIS is a popular and widely adopted technique in different applications because of its intuitive characteristic and simple structure [31].
The main components of FIS are Fuzzifier, Fuzzy rules, Inference engine, and Defuzzifier as shown in Fig. 3.
In first step, crisp set inputs are transformed into fuzzy sets using membership functions, and the process is known as fuzzification. In second step, The fuzzy inference engine uses "IF-THEN" rules to map fuzzy input sets for fuzzy output sets. At last, fuzzy outputs are transfered to crisp values, and the process is called defuzzification.
Input membership function variables considered for FIS are residual energy, distance to base station, and centrality of CHs.
-Residual Energy of CH (R energy ): Selection of higher residual energy CH node to be SCH prolongs the stability of the network.
-Centrality of CH (C H centralit y ): This value corresponds to position of CH in compared to its neighbors with in the entire network. CHs with low centrality values have given high priority than the CHs with high centrality values.
The FIS input membership functions for SCH selection with their linguistic variables are given in Table 4.  Table 5 and Mamdani FIS is employed to handle uncertainty of selecting appropriate SCHs. There are 27 rules containing all combination of 3 input variables. The member function of the output fuzzy variable called probability having 9 combinations of linguistic values as shown in Fig. 7. The trainagular member ship function is used for all input and output vari-  (3) 13 Medium (1) Average (1) Close (0) Rather medium (5) 14 Medium (1) Average (1) Reachable (1) Medium (4) 15 Medium (1) Average (1) Distant (2) Lower medium (3) 16 Medium (1) Far (2) Close (0) Rather medium (5) 17 Medium (1) Far (2) Reachable (1) Medium (4) 18 Medium (1) Far (2) Distant (2) Lower medium (3) 19 High (2) Near (0) Close (0) Very high (8) 20 High (2) Near (0) Reachable (1) High (7) 21 High (2) Near (0) Distant (2) Rather high (6) 22 High (2) Average (1) Close (0) Very high (8) 23 High (2) Average (1) Reachable (1) High (7) 24 High (2) Average (1) Distant (2) Rather high (6) 25 High (2) Far (2) Close (0) Very high (8) 26 High (2) Far (2) Reachable (1) High (7) 27 High (2) Far (2) Distant (2) Rather high (6) ables. The final value for probability is defuzzified to crisp value using centroid method. The centroid is computed as follows where μ(x i ) is the membership value for the point x i in the universe of discourse. The surface view of input/output of membership functions with fuzzy rules are shown in Figs. 8, 9 and 10. In the proposed SCH election technique, no errors are introduced while computing residual energy, base station distance, CH centrality, and SCH election probability. However, if the algorithm runs on same data and same parameters multiple times, then there could be a chance of different node become CH and SCH due to a random number. It is also very essential note that the election of secondary cluster head is based on secondary cluster head election probability and a generated random number. In each iteration, a random number is generated like in LEACH or CROSS, If the generated random number is less than the secondary cluster head probability, then CH node is elected as SCH. Otherwise, it acts as a CH node. Therefore, tie among CHs never arise to become SCH in the proposed methods. The complete flow of the proposed scheme is depicted in Algorithm 1.

Results and discussion
Experiments are carried out using MATLAB R2019a software to evaluate and compare the performance of proposed protocols with the existing protocols like LEACH [2], CHEF [8], and CROSS [9]. To conduct experiments 200 sensor nodes are randomly placed on 100m × 100m field with the base station location at coordinate (50, 50). All sensors are homogeneous and the initial energy of each sensor is set to 0.5Joule. The sensed data size by each sensor is identical and equal to 4000 bits. The energy consumption for trans- Associate CHs to SCHs using distance metric Aggregate the data received from its CHs at SCHs Send fused data to BS end end itr = itr + 1 end mitter (receiver) electronic is set to 50nJ/bit. The energy drain for data fusion is set to 5nJ/bit/message. The energy model parameter values are adopted from [5,9]. All simulation parameters used in experiments are mentioned in Table 6.
Two hybrid clustering protocols for WSN are designed by augmenting fuzzy logic to basic CROSS and improved-CROSS to increase the stability of the network. Figure 11 shows lifetime of the network. It is observed that the first node dies faster in other protocols compared to FLAG and I-FLAG, besides the network performance is better in proposed protocols until 10% of nodes die in the network. Network stability period, stability period throughput, and network lifetime are tabulated in Table 7.
The network lifetime of I-FLAG is better than LEACH, CHEF, and I-CROSS, however it underperforms over CROSS because of its even energy drain distribution among nodes of the network. And hence it prolongs the death of the first node in the I-FLAG. Figure 12 depicts the average energy drain   Figures 13 and 14 represents the number of alive nodes and dead nodes of the network respectively. In the initial period of the network, number of alive nodes are more and the number of dead nodes are less in both FLAG and I-FLAG as compared to other protocols. The network stability period comparison is shown in Fig. 15. The graph demonstrates that the stability period of FLAG is 26.2%, 21.84%, and 1.08% better than LEACH, CHEF, and CROSS respectively. Similarly, the stability period of I-FLAG is 26.62%, 22.29%, and 1.08% better than LEACH, CHEF, and I-CROSS respectively. The network throughput during stability period is depicted in Fig. 16. It is observed that the throughput of FLAG during the stability period is 26.10%, 21.78%, and 0.9% better than LEACH, CHEF, and CROSS respectively. Similarly, the stability period throughput of I-FLAG is 26.57%, 22.28%, and 0.84% better than LEACH, CHEF, and I-CROSS respectively. The energy parameter and distance parameter plays a vital role in selecting CH and hence the SCH. It infers that the network stability period of I-FLAG is outperforms over all other protocols.

Conclusion
Hybrid hierarchical protocols named FLAG and I-FLAG are proposed in the paper to extend network stability. Two main phases of these protocols are CH election phase and SCH election phase. The CH election phase is achieved through a game-theoretic protocol and SCH election phase is achieved through a fuzzy inference system. The simulations are carried out to verify the superiority of the proposed protocols.
The results show that the network stability period of FLAG is better than LEACH, CHEF, and CROSS. The network sta- Network throughput at stability period (bits) 10 5 Fig. 16 Protocols Vs network throughput at stability period between the nodes makes message drops and requires retransmission and affects overall energy efficiency of the network. Therefore, one could consider a method which elects CHs and SCHs based on minimum sensing and communication interference nodes to increase network stability of the network. The proposed work does not consider the effects of faulty nodes and link failure due to environmental factors on stability of the network. As a future work, one could develop more sophisticated model to handle these scenarios.

Author Contributions
The authors proposed hybrid hierarchical artificial intelligence based clustering techniques, named FLAG and I-FLAG. The first phase of these algorithms use game-theoretic technique to elect suitable cluster heads (CHs) and later phase of the algorithms use fuzzy inference system to select appropriate super cluster heads(SCHs) among CHs. The I-FLAG is an improved version of FLAG, where additional parameters like energy and distance are considered to elect CHs. Simulations are performed to check the superiority of proposed algorithms over existing protocols. Simulation results show that the average stability period of WSN is better in FLAG and I-FLAG as compared to other protocols.

Declarations
Conflicts of interest Authors declares that they does not have any conflicts of interest.