1 Introduction

A Wireless sensor network (WSN) comprises of the sensor nodes which are the autonomous devices, spatially distributed over an area for monitoring the physical phenomena. These nodes sense their environment, fetch data and forward the processed information to the base station (BS). These sensor nodes usually have limited memory storage, energy and data processing capabilities but have wide applications in military, habitat monitoring and object tracking [1]. Reducing the energy consumption which is the major performance criterion, could be done by selecting a special set of nodes known as cluster heads, which are allowed to communicate with the base station. These cluster heads aggregate the data sent by each node and then forward it to the base station. Although clustering reduces the energy consumption, but a major drawback is associated to this theory, that is, the energy consumption of the system is concentrated over these cluster heads only [4]. The solution to this problem is LEACH [2], which uses the probability model for localized clustering. The idea behind LEACH which makes it a success is that each node is given a chance to be selected as the cluster head periodically and iteration comprises of two stages. The first one is electing the cluster head and second one to be the data communication. The selection of cluster heads relies over the probability of the most ideal cluster heads which is decided by the networks. Since the sole basis of the LEACH protocol is the probability model, some cluster heads might lie very close to each other or could be located at the edge of the WSN [2] because of random selection of cluster heads. So a viable solution is needed which could maximize the energy efficiency and extending the network lifetime. Fuzzy logic systems [3], which manages and manipulates the linguistic variables or parameters could be used as an option. These systems are based over the linguistic rules which blend or combine different linguistic variables to produce the fuzzy output.

1.1 Ant Colony Optimization (ACO)

Ants have been successfully applying their routing scheme in finding the shortest path from their nest to the food source for many years [16]. Ants follow the pheromone trails laid by other ants and this process is known as stigmergy. Mapping of the behavior of ants to the computer systems is known as ant colony optimization (ACO) which is a swarm intelligence based technique [5]. The limited energy, processing capabilities and memory, requires efficient resource management. Energy efficiency is considered to be the major performance criterion and much of the energy is wasted in routing of data from the sensor nodes to the base station which is considered to be a combinatorial problem, and ACO could be an alternative for solving this problem [16].

1.2 Fuzzy Logic

Fuzzy logic deals with the reasoning which involves approximate data rather than precise crisp data. Since, most of the things in the real world are inexact or imprecise, so fuzzy logic relates to the real world in a better way as compared to the classical theory information [17]. The fuzzy information representation helps in effectively representing the model of reality. Fuzzy inference system (FIS) comprises of four components namely, the fuzzifier, the fuzzy inference machine, the rule base and the defuzzifier. In fuzzy logic, the numeric data is expressed in the form of linguistic variables whose values could be words or sentences in natural or artificial language. These linguistic variables provide an efficient method for representing as well as manipulating the vague and imprecise concepts [18]. The crisp data could be converted to the linguistic input using fuzzifier, which can be represented using the membership functions. The fuzzy machine infers the result with the help of rule base, which combines or collaborates the linguistic variables. The result set which is obtained is generally in the form of fuzzy sets, so they need to be converted to the crisp data so that they can be implemented by the external system [19]. This process is done by defuzzifier. Appropriate cluster-head selection can significantly reduce energy consumption and enhance the lifetime of the WSN. In this paper, a fuzzy logic approach to cluster-head election is proposed based on two descriptors–residual energy and proximity distance along with ACO for routing the data packets to base station.

Rest of the paper is structured as follows: Sect. 2 describes already existing algorithms related to the fuzzy logic and the ant colony optimization in WSN. Section 3 consists of the Radio Model used in proposed approach. Section 4 has the description of proposed approach. Further in Sect. 5 simulation results are portrayed and finally the research is concluded in Sect. 6 along with the future work that could be carried out.

2 Related Work

2.1 LEACH (Low-Energy Adaptive Clustering Hierarchy)

LEACH [14] is a cluster based technique which involves selection of the cluster heads among all the nodes randomly in such a way that each of the node gets chance to be selected for the job. The LEACH algorithm is performed in rounds or iterations where each iteration involves two phases, that are the setup phase and the transmission phase [14]. The setup phase, involves the selection of the cluster heads and associating other nodes around these cluster heads forming clusters. Transmission phase involves, transmission of data by each node to their respective cluster heads which aggregates and transfers it to the base station. LEACH proves to be better in terms of energy savings and network lifetime on comparing it with fixed clustering and other conventional algorithms [14]. LEACH has also got some drawbacks too, which are: Random selection of cluster heads which does not consider the energy consumption, no uniform distribution of cluster heads, not suitable for large area and densely deployed networks.

2.2 NORIA (Network Role-Based Routing Intelligence Algorithm)

NORIA [10] is a routing algorithm which supports effective resource utilization for WSN [6, 8] and significantly improves the energy efficiencies and data rates. NORIA selects the node with better resources to be the data router which forwards the data of the neighboring nodes. It uses the capabilities of fuzzy logic system to improvise the decision making process, reducing the number of packets and gateways while keeping the routing time as low as possible. This algorithm uses the parameters or linguistic variable of itself as well as of its neighbors to inference the fuzzy result. On the basis of the output produced by the fuzzy logic system, routing decisions and role assignment decisions are taken. This methodology saves global energy and transfers data packets to the nodes in better state.

2.3 EAUCF (Energy-Aware Unequal Clustering with Fuzzy)

In EAUCF [11], the process of election of cluster head is similar to the one which is done in LEACH algorithm. It uses the fuzzy logic for computing the tentative cluster head competition radius. It takes the proximity distance of the node to the base station and its residual energy as the two fuzzy parameters. This methodology reduces the size of the cluster when the cluster head lies near the base station; consequently this approach proves to be better when first node dead (FND) and half node dead (HND) are considered. But LEACH performs well when last node dead (LND) is taken into account.

2.4 CHEF (Cluster-Head Election Mechanism Using Fuzzy Logic)

In CHEF [12], the procedure of cluster head selection is performed using the fuzzy if–then rules. The two linguistic parameters which are taken into account for the selection are the energy and the proximity distance. This algorithm performs better as compared to the fuzzy logic based approach which only takes the node with high energy and locally optimal node to be the cluster head. It also performs better than the LEACH algorithm when stability period is taken into account.

2.5 Pegasis

PEGASIS [13], is considered to be an extension of LEACH. But, unlike the LEACH algorithm, no formation of multiple cluster heads is done. In this approach, transmission and reception is done among the neighbor nodes. Hence a chain like formation is made for the data to be transferred to the base station. The node at the vicinity of the base station is only allowed for transferring the data to the base station. The annealing algorithm is the basis for the selection of the chain. PEGASIS has been further developed to Energy Balancing PEGASIS and the Hierarchical PEGASIS.

2.6 Energy Efficient Ant Based Routing (EEABR)

EEABR [15] is similar to the ant based routing, in fact an improvised version of it. While selecting a path during routing, this algorithm also considers the residual energy level of the nodes along with the proximity distance. The main drawback of the basic ant routing was storing the identity of each neighboring node in the routing table, which usually required large storage memory. This problem is solved by EEABR [15], which store the information only about the last two nodes, which significantly reduced the memory requirement. EEABR [15] proved to be better than the basic ant based routing (BABR) and the improved ant based routing (IABR) on the grounds of energy efficiency, minimum and average energy of the nodes. But this algorithm possesses a drawback of delay in data packet delivery.

2.7 Many-to-One Improved Ant Routing (MO-IAR)

Many-to-one improved ant routing (MO-IAR) [7], is a two phase algorithm. The first phase involves establishment of the shortest path. The second phase involves the routing of data. This methodology uses the proactive congestion control mechanism for minimizing the loss of packets while routing. There is a presumption in this methodology that the location of the destination as well as the neighboring nodes is known to the sensor.

MO-IAR [7] proved to be better on comparing it with the FF, SC and FP algorithms in terms of average latency and number of collisions.

2.8 AntChain

AntChain [9], is an efficient algorithm, which minimize the delay and also optimizes the energy consumption which is a major performance criterion. AntChain [9] presumes that the identities and the respective locations of the nodes are known in advance. This information helps in transmitting the data packets efficiently.

AntChain is proved to be a better algorithm in comparison to its counter parts LEACH [14] and PEGASIS [13] on the grounds of energy efficiency.

3 Energy Model Analysis

The energy dissipation model used in the proposed approach is shown below in Fig. 1. Each sensor node consists of a transmitter and receiver having some transmitter and receiver electronics. Energy is dissipated when nodes transmit and receive data.

Fig. 1
figure 1

Energy dissipation diagram

When the sensor node transmits k-bit data by its transmitter, the energy dissipation is:

$$ E_{Tx} \left( {k,d} \right) = E_{elec} *k + \in_{fs} *\,k*\,d^{2} \quad if\,d\, <\, d_{0} $$
(1)
$$ \quad = E_{elec} *k + \in_{mp}\,*\,k\,*\,d^{4} \quad if\,d\,\ge\,d_{0} $$
(2)

When the sensor node receives k-bit data packet, the energy dissipation is

$$ E_{Rx} \left( k \right) = E_{elec} *k $$
(3)

Eelec is the energy dissipated to run the electronics circuits

  • k is the packet size

  • Efs and Emp are the characteristics of the transmitter amplifier

  • d is the distance between the two communicating ends.

The radio characteristics and energy due to electronics are:

$$ E_{elec} = 50\,\,{\text{nJ}}/{\text{bit}} $$
$$ E_{fs} = 10\,{\text{pJ}}/{\text{bit}}/{\text{m}}^{2} $$
$$ E_{mp} = 0.0013\,{\text{pJ}}/{\text{bit}}/{\text{m}}^{4} $$

In addition to above energy dissipations, CHs also dissipates energy in data aggregation. The data aggregation energy EDA has the value of 5 nJ/bit/signal.

4 Proposed Approach

There are various soft computing approaches which could be used for extending the lifetime of the wireless sensor network by optimizing various processes like cluster head election and routing of data packets. In fuzzy logic, the fuzzy system works over the fuzzy data which are fuzzified crisp data so that the fuzzy rules could be effectively applied in order to produce the fuzzy output. Here, the fuzzy rules works at the core of the fuzzy system and hence defines the effectiveness of the system. In ACO algorithm Ant agents are placed on the source node which iteratively produces the solution by using probabilistic approach and the pheromone value (which defines the goodness of path) of optimum path from source to sink. This process continues until the final termination condition is achieved, i.e. all the nodes are dead in the system. In the proposed approach fuzzy logic optimizes the cluster head selection procedure which was earlier done randomly in LEACH that leads to some cluster heads might lie very close to each other or could be located at the edge of the network. This problem results in transfer of redundant data transfer and wastage of efforts and energy in sending that redundant data information. Further the ant colony optimization is used for the routing of data from the sensor nodes to the base station. The proposed approach is processed in two phase the setup phase and the steady state phase as in LEACH. The cluster head is chosen by the FUZZY inference system. In WSN routing algorithm the packets has been send from source node to the base station i.e. source to sink. In the proposed Ant based approach the nodes are placed as Ant agents. The proposed approach has completely superseded the LEACH algorithm which can be clearly seen from the simulation results. The brief description of the setup phase and the steady state phase of the proposed approach is as given:

4.1 Setup Phase

4.1.1 Fuzzy Logic Control

The fuzzy model are composed of different blocks which are fuzzifier, fuzzy rule base, fuzzy inference engine and the defuzzifier which converts the fuzzy output to crisp data. These different blocks are responsible for various processes which need to be implemented for solving a problem using fuzzy logic:

  1. 1.

    Fuzzifier: The crisp data cannot be directly processed by the fuzzy machine so it requires a fuzzifier device which converts the crisp input data to fuzzified data which is then feed to the fuzzy inference system.

  2. 2.

    Fuzzy rule base: These are the if–then statements which manipulate the linguistic variables and produce the fuzzy output.

  3. 3.

    Fuzzy inference engine: This block is responsible for manipulating the linguistic variables taken as the input, based on the fuzzy rule base.

  4. 4.

    Defuzzifier: The output produced by the fuzzy inference engine is fuzzy, but most of the real world entities are meant to work over crisp data. So, the fuzzified data needs to be converted to the crisp data using defuzzifier. In our approach we have used the centroid method to find out the solution.

4.1.2 Knowledge Representation

The setup phase involves the selection of cluster heads, which is done using the fuzzy logic. The proposed approach implements the fuzzy logic using the FIS editor which is a GUI based tool that makes it easier to explore the features of fuzzy logic [17]. In the proposed approach two input fuzzy descriptors namely proximity distance and residual energy has been used to calculate the fuzzy cost.

  • Proximity distance: Distance of each node to the Base Station.

  • Residual energy: Remaining energy of the sensor nodes.

When the proximity distance and the residual energy of the nodes are passed to the fuzzy inference system (FIS), they are converted to the fuzzy sets and represented using the membership functions. These membership functions are represented as shown below in Table 1:

Table 1 Fuzzy set for input variable

4.1.3 Membership Function for Energy

The linguistic variable representing the residual energy are described using three levels that are low, average and high. The membership function for residual energy is as shown in Fig. 2. This residual energy variable could take the values ranging from 0 to 0.5.

Fig. 2
figure 2

Membership function editor for residual energy

4.1.4 Membership Function for Proximity Distance

The linguistic variable representing the proximity distance are described using three levels that are near, medium and far. The membership function for proximity distance is as shown in Fig. 3. This proximity distance variable could take the values ranging from 0 to 75 m.

Fig. 3
figure 3

Membership function editor for proximity distance

After the conversion of the information to the membership functions, these functions are passed to the fuzzy inference engine where they are manipulated using the rule base, which comprises of if–then statements that manipulates these linguistic variables and produces the output. The fuzzy rules for the proposed approach are listed in Table 2.

Table 2 Inference rules

The input linguistic variables are passed to the fuzzy inference engine where they are manipulated using the fuzzy rule base. But, the inference engine produces the fuzzified output which needs to be defuzzified using the defuzzifier. In the proposed approach, most commonly used fuzzy inference system is used for defuzzyfication, i.e. Mamdani [18] method and centroid method are used in this FIS. The linguistic variable representing the output which describes the chance of selection are described using two levels that are Low and High.

4.2 Steady State Phase

This phase involves transferring of information from the nodes to the base station. The proposed approach uses the ACO to find the optimized path from nodes to cluster head which then later forwards it to the base station. The flowchart for the proposed approach is shown in Fig. 4. The procedure for finding the ant colony optimized path is as given below:

Fig. 4
figure 4

Flowchart for proposed approach

  1. A.

    At the source node, forward ants are deployed which traverse through the intermediate nodes to reach the destination, that is, their associated cluster head [20].

  2. B.

    When the ant follows a probabilistic approach for selection of next node to be traversed. This probabilistic approach is based over the pheromone and the heuristic information [20]. The probability is calculated as given:

    $$ P_{ij} = \frac{{(\tau_{ij} )^{\alpha } (\eta_{j} )^{\beta } }}{{\mathop \sum \nolimits_{j \in N} (\tau_{ij} )^{\alpha } (\eta_{j} )^{\beta } }} $$
    (4)

    where, τij represents the pheromone information between the source node and the next node to be selected which is given by:

    $$ \tau_{ij} = \frac{1}{{d_{ij} }} $$
    (5)

    where dij is the distance between source node i and its associated cluster head. The distance between node and its associated cluster head is calculated as Euclidian distance given below

    $$ {\text{d}}_{ij} = \sqrt {\left( {{\text{S}}\left( {\text{i}} \right).{\text{xd}} - {\text{s}}\left( {\text{j}} \right).{\text{xd}}} \right)^{2}\,+\,\left( {{\text{S}}\left( {\text{i}} \right).{\text{yd}} - {\text{s}}\left( {\text{j}} \right) . {\text{yd}}} \right)^{2} } $$
    (6)

    \( \eta_{j} \) represents the heuristic information that defines energy of nodes and is represented by:

    $$ \eta_{j} = \frac{{E_{0} - E_{residual} }}{{\mathop \sum \nolimits_{k \in N} E_{k} }} $$
    (7)

    where E0 is the initial energy and Eresidual is the residual energy of the node.

    The α and β are two parameters that control the relative weight of the pheromone trail and heuristic value.

  1. C.

    The node with the maximum probability is selected to be the next node in the path from the source node to its respective cluster head.

The algorithm of the proposed approach is given as follows:

  1. 1.

    Following steps are repeated until all the nodes are dead in the sensor system.

  2. 2.

    The two fuzzy descriptors namely residual energy and proximity distance are passed to the fuzzy inference system, which process the information based on the predefined fuzzy rules and produces the output.

  3. 3.

    Output produced by the FIS system is used for selection of cluster heads and clusters are built around these cluster heads which comprises of their associated nodes.

  4. 4.

    For each node ant colony optimized path to their associated cluster head is calculated which is based over the probabilistic selection which requires pheromone information and the heuristic information as parameters.

  5. 5.

    The optimized path produced in previous step is compared to the direct path between the node and the base station.

  6. 6.

    Based on the comparison one of the path is selected and following procedure is performed:

    • If the ant colony optimized path is selected then the node forwards the data packet to the cluster head which then transfers it to the base station.

    • If the direct path to the base station is selected then the node forwards the data packet directly to the base station.

5 Simulation Results

In simulation the performance of LEACH algorithm is compared with the proposed approach. All the nodes have same transmission range. The sink node i.e. base station lies at the center of this square area (50, 50). For simulation 100 nodes are deployed within a region of 100*100. All the sensor nodes have homogeneous initial energy level and same transmission range. The various parameter values used for simulation are listed in Table 3.

Table 3 Parameter values used for simulation

Two algorithms LEACH and the proposed approach have been compared on the basis of following parameters.

  1. 1.

    Total number of nodes alive within the system at different rounds of iterations.

  2. 2.

    Total energy of the system at different rounds of iterations.

  3. 3.

    Total number of packets transmitted to the base station at different rounds of iterations.

It could be clearly seen from the simulation results that the proposed approach has higher stability period and better energy utilization as compared to existing LEACH algorithm. Table 4 shows the values of rounds at which the first node dead in LEACH and Proposed approach. The first node dead (FND) in LEACH algorithms at round 436 whereas the first node dead in proposed approach at 956 round which shows the significant improvement in stable period.

Table 4 First dead node value of LEACH and proposed algorithm

Figure 5 compares the LEACH algorithm with the proposed approach on the basis of total number of nodes alive within the system. It is clear from the graph that the proposed approach has higher stability period and prolonged network lifetime as compare to LEACH. Stability period is the time interval from the start of network operation until the death of the first sensor node. We also refer to this period as “stable region.” Network lifetime is the time interval from the start of operation (of the sensor network) until the death of the last alive node.

Fig. 5
figure 5

Total number of nodes alive within the system at different rounds of iterations

Figure 6 compares the LEACH algorithm with the proposed approach, considering the residual energy within the system at different rounds of iterations. It is clearly evident from the figure that the proposed approach has higher energy utilization and higher energy savings at different rounds of iterations as compare to LEACH.

Fig. 6
figure 6

Residual energy of the system at different rounds of iteration

Figure 7 compares the LEACH algorithm with the proposed approach, considering the total number of packets which are delivered to the base station. As it could be clearly seen from the graph that the proposed approach outperform the LEACH algorithm in terms of number of data packets transmitted to base station

Fig. 7
figure 7

Number of data packets delivered to the base station at different rounds

From the simulation following results are obtained:

  1. 1.

    There is an improvement in stability period and network life time as compared to existing LEACH algorithm.

  2. 2.

    The proposed approach has higher energy efficiency as compared to existing LEACH algorithm.

  3. 3.

    Information received by the base station has increased considerably in the proposed approach.

6 Conclusion and Future Works

Energy, network life time and finding optimal path are the key challenges in the design of wireless sensor networks routing protocols. In this paper a cluster based energy efficient hierarchy model is introduced, in which the procedure of cluster head selection is based over the fuzzy rules which apply over the linguistic variables or parameters of the nodes which are deployed over the field. The primary goal of the proposed approach is to introduce a solution which rule out the limitation of selection of cluster head on random basis as in LEACH along with the application of ant colony meta-heuristic approach to identify the optimal path between a sensor node and the base station. The optimal path has been calculated based on pheromone concentration in homogeneous environment. Simulation results show that the proposed approach is able to produce better results as compared to the LEACH algorithm in terms of prolonged network life time, higher energy efficiency and elevated amount of data packets transmitted to base station. The proposed approach uses the random deployment of the sensor nodes which could be improved further as future work by using a systematic deployment approach for these sensor nodes. By this the energy efficiency could be increased further with overall increase in the coverage region of these sensor nodes. In the proposed approach the experiments have been carried out for the homogeneous environment, further result can be improved for the heterogeneous environment. In future various approaches such as integration of multiple sink-nodes and mobility context of sensors along with ACO and Particle swarm optimization shall be studied to further improve the performance of wireless sensor network.