1 Introduction

Wireless Sensor Network (WSN) technology combines various paradigms of wireless communication, electronics, embedded computing resulting in applications of monitoring used in military, industry and agriculture [1]. WSN is an ad-hoc network made of low-power, short-lived sensor devices that cooperate with each other in sensing and reporting the data collected to base station (BS) [2]. Applications of WSNs are found in diverse fields such as military surveillance, healthcare, wildlife conservation, industrial monitoring, agriculture, and other fields [3]. Due to the limitations of energy resources, computing resource and bandwidth availability, the WSN design concerns mainly on conserving energy consumption and extend lifetime of the network. Routing protocol is used for transmitting data between the node and the BS in multihop scenario and generally data aggregation takes place in single hop scenario. The design of the routing protocol must incorporate measures to minimize power consumption. Studies have shown that efficient routing protocol can improve Quality of Service (QoS) and the lifetime of WSNs [47].

One of the most energy efficient technique used in WSN for data aggregation is clustering which achieves a hierarchical network architecture. In clustering, sensor nodes are grouped into clusters and every cluster has a CH which acts as a leader of the cluster. Sensor nodes belonging to a particular group transmit their data to the CH of that cluster. The CH aggregates the data and transmits the same to the BS. Only CHs have the ability to communicate with other CHs or BS [8]. Clustering algorithms has two phases’ setup phase and data communication phase. During the initial setup stage, CHs are elected among the nodes and the other nodes link to one of the CH, thus, partitioning the network into clusters. Nodes within a cluster can communicate only with its CH (intra-communication) whereas the CHs are responsible for intercluster communication. Advantages of clustering in WSN are that the data aggregation by CH reduces transmission of unnecessary and redundant data. Additionally, scalability for large networks is achieved with lower communication over head. As number of sensors taking part transmission is less, allowing for efficient use of resources in WSNs [9].The additional responsibility of the CH necessitates higher energy consumption in the node for processing and transmitting of the cluster data. This leads to uneven network degradation. It is thus required to rotate the role of CH to improve the network lifetime.

Cluster-based routing protocols is categorized as uneven clustering and uniform clustering [10]. Low Energy Adaptive Clustering Hierarchy (LEACH) is a popular uniform cluster routing used in WSNs. It is the first hierarchical routing protocol proposed in WSNs [11]. LEACH uses periodic rotation of CHs to avoid draining of energy in the nodes. To reduce the network energy consumption, each node is elected as a CH based on a probability. LEACH is more energy efficient than plain routing protocols and static network clustering. The disadvantages of LEACH are: the location of the nodes are not considered creating poor distribution of clusters, leading to early death of some nodes invalidating the network. Another disadvantage of LEACH is that all nodes are assumed to have same initial energy, which is not efficient for imbalanced-energy network [12]. Energy efficient clustering and CH selection has extensively been studied in the literature for WSNs.

Jain and Trivedi [13] proposed an algorithm in WSN for energy efficient clustering and constructed the sensor network in the form of a circle, with the BS in the center. CH selection after each round is done and within the same round multiple times. Li et al. [14] proposed a clustering algorithm where CH is re-appointed for several rounds. Simulation results show the energy saving efficiency of the protocol. Abusaimeh and Yang [15] proposed a novel technique to find the number of clusters and the best node to be CH in WSN. Comparing this technique with cluster-tree technique, for establishing network and linking nodes to each other, simulation results show that the proposed technique increases the lifetime of the WSN by 50 % in average. Using mobile BS, Mezghani and Abdellaoui [16] worked on maximizing network lifetime of WSN. Based on the modified LEACH protocol, the proposed algorithm supports node mobility and improves network lifetime. Considering a heterogeneous WSN, this comprises of many sensor nodes, a mobile BS and a few static CHs. All the sensor nodes send sensed events to nearest CH regularly. The CH in turn sends the sensed events to the mobile BS, according to an itinerary. The proposed protocol is compared with an algorithm which is dedicated to a network with fixed nodes. Results show that the proposed protocol has the required reliability and maximizes network lifetime.

Izadi et al. [17] suggested a type-2 fuzzy based Self-Configurable Cluster Head (SCCH) selection approach. The proposed protocol considers the selection criteria of CH and also the cluster backup approach. So, in case of cluster failure, the cluster backup approach helps the system to work in an effective manner. An inherent operational aspect of WSN is communication uncertainty that is handled by the proposed protocol. Simulation results show that SCCH performs better than recently developed methods. Sathian et al. [18] proposed a CH Cooperative Trustworthy Energy Efficient MIMO (CH-C-TEEM) algorithm on game theory for WSN and the performances studied for energy consumption. In this protocol the CH nodes cooperate to transmit data cooperatively, than choosing the cooperative sending/receiving groups in each cluster. Game theory helps in choosing healthier CHs that are having sufficient residual energy and also high trust level. Also, the game theory is used to choose the cooperative nodes for MIMO communication. Experimental results show that CH-C-TEEM algorithm has 50 % increase in residual energy when it is compared to TEEM.

Optimization is a mathematical problem in all engineering disciplines. Optimization techniques aims to find the best possible solution within the constraints defined for a given problem. The optimization algorithms can be either deterministic or stochastic in nature. The SFLA is a swarm intelligence heuristic which combines the advantages of particle swarm and Memetic algorithm. It is a population-based cooperative meta-heuristic with efficient computing performance and good global search capability [19, 20]. SFLA is capable of solving discrete and continuous optimization problems. SFLA is based on the food searching behavior of frogs. The interactive behavior and exchange of information by the frogs while searching for food placed on stones in a pond is modelled. As it combines the advantages of the memetic algorithm and the swarm behavior, it is characterized with easy implementation, and good global search capacity. SFLA algorithm has been used in various domain to efficiently solve optimization problems.

Mehta and Banati [21] presented SFLA based trust aware clustering system for social context modeling. Jaballah et al. [22] presented a new search strategy to improve the efficiency of the SFLA. Qiusheng et al. [23] improved the convergence and effectiveness of local search process of SFLA with an individual update method. Wang and Gong [24] proposed a Fast SFLA (FSFLA) for optimizing functions such as a low optimization precision, and local optimum issue. Each individual in the subgroup acquires from the group extreme which is updated by the update strategy. The speed of the proposed technique was improved by grouping the individuals at regular intervals. Eghbal et al. [25] presented the application of SFLA for the problem of transmission network expansion planning. Roy and Chakrabarti [26] proposed a method to solve complex mixed integer programming problem using SFLA with Genetic Algorithm (GA).The Modified SFLA (MSFLA) applies local search during the evolutionary cycle.

Conservation of energy and extending lifetime of WSN are the main design criteria of WSN routing protocol. As observed from the works available in the literature, various techniques for energy conservation is proposed. The NP-hard problem of the CH selection is also widely researched. Though many optimization techniques were used for CH selection, SFLA is not tried. In this work, a hybrid SFLA based CH section algorithm is proposed to improve the performance and the lifetime of the WSN. A novel SFLA heuristic with antipredator adaptation capability which avoids locations with predators is implemented. Section 1 details the problem formulation, Sect. 2 shows the methods and techniques used for research, Sect. 3 shows the results and its discussions and finally Sect. 4 concludes the research.

2 Methodology

CH selection can be seen as an undirected graph with each node representing a vertex and the edge representing the weights associated with QoS. The problem can be seen as a combinatorial problem which can be represented by Eq. (1):

$$\hbox{min} \;z_{k} (x) = \sum\limits_{i = 1}^{m} {w_{ki} e_{i} \quad k = 1,2, \ldots ,n}$$
(1)

where z is the objectives that has to be minimized. In this work two objectives namely minimization of packet loss rate and network life time are considered.

LEACH is a popular protocol studied extensively for CH formation. During cluster establishment in LEACH, the CH are randomly chosen. The LEACH changes the CH periodically to conserve energy. During CH election, the probability threshold T of a node to be selected as CH (n), expressed as Eq. (2) shown is computed. If a node has been elected CH, makes T (n) = 0, this node will not be elected as CH, otherwise, the T (n) probability of being elected as CH [27, 28].

$$T(n) = \left\{ \begin{array}{ll} \frac{p}{1 - p \times [r\bmod (1/p)]} ,&\quad {\text{n}} \in {\text{G}} \\ 0 ,&\quad{\text{else}}\\ \end{array} \right.$$
(2)

LEACH algorithm groups the nodes into clusters and the CH communicates directly with the sink/BS, forming a two magnitude star network (Fig. 1).

Fig. 1
figure 1

Single-hop LEACH routing protocol

The SFLA is a population-based search heuristic with a combination of deterministic and random strategies. The deterministic strategy ensures efficient heuristic search of the algorithm whereas the random strategy allows for flexibility and robustness of the search process [21]. The SFLA consists of “memeplexes” which is a set of virtual frogs. The leaping behavior of the Frog enhances its performance. Frogs in each memeplex represent different solution and the quality of solution can be used to change other frogs. In the memetic evolution step, information is exchanged between the frogs in a memeplex [26]. The frogs are shuffled after a defined number of memetic evolution step for improved quality of memeplex. Shuffling boosts the meme quality and also ensures cultural evolution. The memetic evolution and shuffling are iterated until convergence is achieved.

The steps in SFLA include:

  • Initial population Frogs representing solutions are randomly initialized. In this work each frog represents a binary encoded solution with ‘0’ representing the node not selected as CH and ‘1’ representing a CH. Each solution ensures that all nodes are covered in the network.

  • Sorting and distribution Frogs are ranked based on their fitness values and are grouped into m memeplexes with n frogs.

  • Memeplex evolution Local search is performed.

  • Shuffling Frogs are shuffled among the memeplexes to ensure improvement in the quality and to move towards optimal solution.

  • Terminal condition The algorithm stops after fixed number of iterations or desired threshold received.

For S-dimensional problems, initial population of P frogs is represented as Eq. (3):

$$X_{i} = (x_{i1} ,x_{i2} ,. \ldots ,x_{iS} )$$
(3)

On evaluating the fitness and formation of memeplex, the frogs with the best and the worst fitnesses are identified as Xb and Xw, respectively. The position of the frog with the worst fitness is adjusted as follows [29]:

$$Change \, in \, frog \, position \, (D_{i} ) = rand() \times (X_{b} - X_{w} )$$
(4)
$$\begin{aligned} & New \, position \, X_{w} = current \, position \, X_{w} + D_{i} \\ & D_{\hbox{max} } \ge D_{i} \ge - D_{\hbox{max} } \\ \end{aligned}$$
(5)

where rand () is a random number [0, 1] and Dmax maximum change allowed in a frog’s position. If a better solution is obtained then it replaces the worst frog, else frog position is recomputed with respect to the global best frog (Xg replaces Xb). In the proposed improvements, using frogs hop and avoid predator. It can be taken m inputs, hop will be choosen for randomly, then initiate antipredator. If the predator will be chosen for yes update frog location, else update predator list.

A major drawback of SFLA is that after some runs, position of the frogs become closer in each memeplex leading to a premature convergence. To avoid the premature convergence, this work proposed a predatory mechanism achieved by using hops during the local search phase. The flowchart of the proposed technique is shown in Fig. 2. A memory mechanism is introduced wherein frogs hop at its neighborhood in search of better food. If predators are present in the location then the frog backtracks and stores the information in the global memory which is used by other frogs in the current generation and frogs of the future generation. Figure 3 shows the proposed technique introduced into the existing SFLA.

Fig. 2
figure 2

Flowchart of the shuffled frog leaping algorithm

Fig. 3
figure 3

Proposed improvement in SFLA

For CH selection:

$$\begin{aligned} & During \, the \, selection \, of \, cluster \, head \\ & if \\ & Sensor \, nodes_{energy \, level} \ge \, average_{energy \, level} \\ & then \\ & Sensor \, node \, suitable \, for \, cluster \, head \\ & if \\ & Sensor \, node \, with \, highest \, energy \, level \, work \, as \, a \, CH \\ & else \\ & Not \, eligible \, for \, cluster \, head \, selection \, process. \\ \end{aligned}$$

The network size increases, it is affect the QoS of WSN i.e. throughput, delay, PDR etc.

Since distance between nodes play a very important role the Minkowski distance is used as the metric for partitioning of the network. Minkowski distance is given by Eq. (6):

$$d(x,y) = \left( {\sum\limits_{i = 1}^{m} {|x_{i} - y_{j} |^{r} } } \right)^{1/r}$$
(6)

In the above method only distance is minimized leading to inefficient clusters. To overcome this a novel multiobjective function is proposed in Eq. (7).

$$f(i) = w\left( {\frac{{\text{E}_{\rm i} }}{{\sum\nolimits_{\rm i = 1}^{\rm n} {\text{E}_{\rm i} } }}} \right) + (1 - \text{w})\left( {\frac{1}{{\sum\nolimits_{\rm j = 1}^{\rm m} {\text{D}_{\rm i,j} } }}} \right)\quad \text{where } {\boldsymbol{w}} = \boldsymbol{[0,1]}$$
(7)

where \({\boldsymbol{E}}_{rm i}\) is residual energy in node i, n is number of nodes in a network, \({\text{D}}_{\rm i,j}\) is distance between nodes i which are selected to be CH. As w increases, network lifetime increases. In this work we set \(w = 0.7\) with the goal of increasing network life time over QoS.

3 Results and Discussion

Simulations were conducted by varying number of nodes (75–450) in a network. The initial energy in the nodes are 0.5 J, transmission power is 0.005 W. The simulations are conducted with data packets of 5 kb. The proposed Hybrid SFLA is evaluated and compared with LEACH, PSO, and SFLA. As the PSO is similar to SFLA, it is used for comparing the proposed SFLA model. Performance of the network was evaluated based on number of clusters formed, average end to end delay, average packet loss, network lifetime and remaining energy in the nodes. Table 1 lists the simulation and other parameters used in the investigation.

Table 1 Simulation parameters

From the Table 2, it can be observed that the Hybrid SFLA method improved number of clusters by 18.18, 9.52, and 18.18 % for LEACH, PSO, and SFLA method respectively when number of nodes is 75. When the number of nodes is 450, Hybrid SFLA improved number of clusters formed by 9.23, 6.06, and 2.99 % for LEACH, PSO, and SFLA method respectively. The number of clusters formed by the proposed SFLA is more optimal due to which the transmission distance reduces leading to energy conservation.

Table 2 Number of clusters formed

From the Table 3, it can be observed that the Hybrid SFLA method decreased average end to end delay. When number of nodes is 75 Hybrid SFLA decreased average end to end delay by 8 % for LEACH, PSO, and SFLA methods. When number of nodes is 225 Hybrid SFLA decreased average end to end delay by 0.7782, 12.4542, and 11.7647 % for LEACH, PSO, and SFLA method respectively. When number of nodes is 450 Hybrid SFLA decreased average end to end delay by 19.5178, 12.1864, and 11.7365 % for LEACH, PSO, and SFLA method respectively.

Table 3 Average end to end delay

From Table 4, it can be observed that the Hybrid SFLA method decreased average packet loss rate. When number of nodes is 75 Hybrid SFLA decreased average packet loss rate by 21.6, 13.28, and 11.84 % for LEACH, PSO, and SFLA method respectively. When number of nodes is 225 Hybrid SFLA decreased average packet loss rate by 24.84, 22.91, and 21.07 % for LEACH, PSO, and SFLA method respectively. When number of nodes is 450 Hybrid SFLA decreased average packet loss rate by 37.49, 34.03, and 32.49 % for LEACH, PSO, and SFLA method respectively.

Table 4 Average packet loss rate

From Fig. 4, it can be observed that the Hybrid SFLA method improved the network lifetime than LEACH, PSO, and SFLA. When number of rounds is 200, Hybrid SFLA increased percentage of nodes alive by 9.63, 11.89, and 7.41 % for LEACH, PSO, and SFLA respectively. When number of rounds is 400, Hybrid SFLA increased percentage of nodes alive by 17.5, 18.87, and 13.5 % for LEACH, PSO, and SFLA respectively. When number of rounds is 600, Hybrid SFLA increased percentage of nodes alive by 167.57, 116.28, and 61.54 % for LEACH, PSO, and SFLA respectively.

Fig. 4
figure 4

Percentage of nodes alive

From the Fig. 5, it can be observed that the Hybrid SFLA method improved average remaining energy of nodes than LEACH, PSO, and SFLA. When number of rounds is 200, Hybrid SFLA increased average remaining energy of nodes by 50.75, 10, and 15.39 % for LEACH, PSO, and SFLA respectively. When number of rounds is 400, Hybrid SFLA increased average remaining energy of nodes by 57.14, 14.93, and 21.54 % for LEACH, PSO, and SFLA respectively. When number of rounds is 500, Hybrid SFLA increased average remaining energy of nodes by 90.91, 50.98, and 50.98 % for LEACH, PSO, and SFLA respectively.

Fig. 5
figure 5

Average remaining energy of nodes

4 Conclusion

Clustering is useful for energy conservation of WSNs as it lowers the communication overhead of the networks. The optimal selection of CH is essential for efficient operation and performance of WSN.In this paper, a hybrid SFLA based on antipredator model for optimal selection of CH is proposed. The proposed technique avoids the local optima problem faced in other algorithms including Particle Swarm Optimization. The proposed algorithm aims to minimize the energy consumption in the network and increase the Packet Delivery Ratio. Simulation results demonstrate the effectiveness of the proposed hybrid SFLA. It is observed that the network lifetime improves and the packet loss and end to end delay decreases.