1 Introduction

Developments in wireless communication and electronics have led to the development of low-cost, low-power, multifunctional WSNs that can operate in wide variety of diverse and complex environments, even where human activity is not possible at all. WSNs contain self-configured, distributed and autonomous sensor nodes (SNs) that monitor physical or environmental activities like humidity, temperature or sound in a specific area of deployment (Yick et al. 2008; Zhu et al. 2012). SNs can have more than one sensor to capture data from the physical environment, wherever deployed. A sensor with limited storage and computation capabilities receives the sensed data through analogue to digital converter (ADC) and processes it further for transmission to a main location, known as base station (BS), where the data can be analyzed for decision making in variety of applications (Al-Karaki and Kamal 2004). Every node also acts as a repeater for passing information of other sensor nodes to the sink. The most important part of the sensor node is its power supply, which caters to the energy requirements of sensors, processors and transceiver; however, its limited battery life can lead to premature exhaust of the network due to excessive usage (Akkaya and Younis 2005). As manual recharging of batteries is not possible in complex deployments, efficient use of the energy becomes a tough challenge in applications where a prolonged life of the network is required (Gaura 2010). Researchers are heavily involved in designing of energy-efficient solutions; however, on the other hand network life can also be extended by planning energy-efficient approaches. It is well accepted that cluster-based hierarchical approach is an efficient way to save energy for distributed WSNs (Abbasi and Younis 2007; Tyagi and Kumar 2012), which increase network life by effectively utilizing the node energy and support dynamic WSNs environment. In a cluster-based WSN, SNs are divided into several groups known as clusters with a group leader known as cluster head (CH). All the SNs sense data and send it to their corresponding CH, which finally sends it to the BS for further processing. Clustering has various significant advantages over classical schemes (Abbasi and Younis 2007). First, data aggregation is applied on data, received from various SNs within a cluster, to reduce the amount of data to be transmitted to BS thus energy requirements decrease sharply. Secondly, rotation of CHs helps to ensure a balanced energy consumption within the network, which prevent getting specific nodes starved due to lack of energy (Chamam and Pierre 2010). However, selection of appropriate CH with optimal capabilities while balancing energy efficiency ratio of the network is a well-defined NP-hard optimization problem in WSNs (Khalil and Attea 2011). Thus, computational intelligence (CI) (Kulkarni et al. 2011)-based approaches such as evolutionary algorithms (EAs), reinforcement learning (RL), artificial immune systems (AIS), and more recently, artificial bee colony (ABC) have been used extensively as population-based metaheuristic for energy-efficient clustering protocols in WSNs (Das et al. 2009). Results prove that the performance of the ABC metaheuristic is competitive to other population-based algorithms with the advantage of employing fewer control parameters, simplicity of use and ease of implementation (Samrat and Udgata 2010). However, similar to other population-based algorithms, the standard ABC metaheuristic also face some challenges, as it is considered to have poor exploitation phase than exploration; moreover, convergence rate is typically slower, especially while handling multimodal optimization problems (Karaboga and Akay 2009). Therefore, we propose an improved artificial bee colony (iABC) metaheuristic, with an improved solution search equation, which will be able to search an optimal solution to improve its exploitation capabilities and an improved technique for population sampling through the use of first-of-its-kind compact Student’s t-distribution to enhance the global convergence of the proposed metaheuristic. Further, to utilize the capabilities of the proposed metaheuristic, an improved artificial bee colony-based clustering protocol, Beecluster is introduced, which selects optimal cluster heads (CHs) with energy-efficient approach in WSNs.

2 Related work

A large variety of clustering protocols have been developed so far for WSNs. Here, we present only the vital contributions of the researchers based on Classical as well as CI-based metaheuristic approach; however, we underline the significance of CI, as our proposed protocol is part of this approach. Low-energy adaptive clustering hierarchy (LEACH) (Heinzelman et al. 2002) is a classical clustering protocol which combines energy-efficient cluster-based routing to application-oriented data aggregation and achieve better lifetime for a WSN. LEACH introduces algorithm for adapting clusters and rotating CHs positions to evenly distribute the energy load among all the SNs and thus enables self-organization in WSNs. LEACH remain a paradigm architect for designing clustering protocols for WSNs till date. HEED (hybrid energy-efficient distributed clustering) (Younis and Fahmy 2004) is another classical clustering protocol that selects CHs based on hybridization of node residual energy and node proximity to its neighbors or node degree thus achieves uniform CH distribution across the network. HEED approach can be useful to design WSNs protocols that require scalability, prolonged network lifetime, fault tolerance, and load balancing, but it only provided algorithms for building a two-level hierarchy and no idea is presented for designing protocol to multilevel hierarchies. Power-efficient and adaptive clustering hierarchy (PEACH) (Yi et al. 2007) selects CHs without additional overhead of wireless communication and supports adaptive multilevel clustering for both location-unaware and location-aware WSNs but with high latency and low scalability, thus making it suitable only for small networks. T-ANT (Selvakennedy et al. 2007) is a swarm-inspired clustering protocol which exploits two swarm principles, namely separation and alignment, through pheromone control to obtain a stable and near-uniform distribution for selection of CHs. Energy-efficient multilevel clustering (EEMC) (Jin et al. 2008) achieves less energy consumption and minimum latency in WSNs by forming multilevel clustering with minimum algorithm overhead. However, the authors ignored the issue of channel collision which happens frequently in wireless networks. Energy-efficient heterogeneous clustered scheme (EEHC) (Kumar et al. 2009) selects CHs based on weighted election probabilities of each node, which is a function of their residual energy and further support node heterogeneity in WSNs. Multipath routing protocol (MRP) (Yang et al. 2009) is based on dynamic clustering with ant colony optimization (ACO) metaheuristic . A CH is selected based on residual energy of nodes, and an improved ACO algorithm is applied to search multiple paths that exist between the CH and BS. MRP prolonged the network lifetime and reduces the average energy consumption effectively using proposed metaheuristic. Energy-efficient cluster formation protocol (EECF) (Chamam and Pierre 2010) presents a distributed clustering algorithm where CHs are selected based on a three-way message exchange between each sensor and its neighbors while possessing maximum residual energy and degree. However, the protocol does not support multilevel clustering and consider small transmission ranges. Mobility-based clustering (MBC) protocol (Deng et al. 2011) supports node mobility; hence, CHs will be selected based on nodes residual energy and mobility, whereas a non-CH node maintains link stability with its CH during setup phase. UCFIA (Mao and Zhao Cl 2011) is a novel energy-efficient unequal clustering algorithm for large scale WSNs, which use fuzzy logic to determine node’s chance to become CH based on local information such as residual energy, distance to BS and local density of nodes. In addition, an adaptive max–min ACO metaheuristic is used to construct energy-aware inter-cluster routing between CHs and BS, thus balancing the energy consumption of CHs. Distributed energy-efficient clustering with improved coverage (DEECIC) (Liu et al. 2012) selects minimum number of CHs to cover the whole network based on nodes local information and periodically updates CHs according to nodes residual energy and distribution. By reducing overheads of time synchronization and geographic location information, it prolongs network lifetime and improves network coverage. Energy-aware evolutionary routing protocol (ERP) (Attea and Khalil 2012) is based on evolutionary algorithms (EAs) and ensures better trade-off between lifetime and node stability period of a network with efficient energy utilization in complex WSNs environment. Harmony search algorithm-based clustering protocol (HSACP) (Hoang et al. 2014) is a centralized clustering protocols based on harmony search algorithm (HSA), a music-inspired metaheuristic, which is designed and implemented in real time for WSNs. It is designed to minimize the intra-cluster distances between the cluster members and their CHs, thus optimizing the energy distribution for WSNs. BeeSensor (Saleem and Farooq 2012) is an energy-aware, event-driven, reactive and on-demand routing protocol for WSNs. Inspired from biological system of bees and based on a typical bee agent model, which works with four type of agents, namely packers, scouts, foragers and swarms, BeeSensor demonstrates good performance over other CI-based protocols with least communication and processing cost. One major drawback of the protocol is its flat nature or non-cluster-based approach, which affects its performance on various fronts. Kuila and Jana (2014) presents a linear/nonlinear programming (LP/NLP) formulations of energy-efficient clustering and routing problems in WSNs, followed by two algorithms for the same based on a particle swarm optimization (PSO). Their proposed algorithms demonstrate their proficiency in terms of network life, energy consumption and delivery of data packets to the BS. Ozturk and Hancer (2015) presents an improved binary artificial bee colony algorithm (IDisABC), which can be used for real-world optimization problems of dynamic clustering with hands-on experiments conducted on data and image clustering benchmark problems. Ari and Yenke (2016) proposes ABC-SD, a novel centralized cluster-based routing protocol based on artificial bee colony metaheuristic with a multiobjective fitness function to select CHs along with a cost-based function for routing, which makes a trade-off between the energy efficiency and the number of hops in the routing path. Extensive evaluation demonstrate the effectiveness of the proposed protocol in terms of network lifetime, network coverage and packet delivery ratio. Ding et al. (2016) presents a rule-driven multipath routing algorithm with dynamic immune clustering, which applies biological immune system to the event-driven dynamic clustering algorithm for WSNs. Below in Table 1, we present a relative comparison of these protocols, highlighting their features and limitations for a better insight:

Table 1 Relative comparison of protocols inWSNs

It is very much clear from the comparison that classical as well as CI-based approaches have their own features as well as limitations. Classical approaches are better in self-organization, load balancing with minimum overhead but average in energy efficiency, whereas CI-based metaheuristic showed to be good in energy efficiency with prolonged network life. Therefore, CI-based metaheuristic approaches need to be further explored and improved for energy-efficient solutions in WSNs.

3 Standard artificial bee colony (ABC) metaheuristic

Original artificial bee colony (ABC) metaheuristic is proposed by Karaboga and Akay (2009) for optimizing multivariable and multimodal continuous functions, which has aroused much interest in research community due to less computational complexity and use of less number of control parameters. Moreover, optimization performance of ABC is competitive to well-known state-of-the-art metaheuristics (Karaboga and Basturk 2008). In ABC, there are three type of bees: employed bees, onlookers and scout bees (Zhang and Wu 2011). The employed bee carries exploitation of a food source and share information like direction and richness of food source with the onlooker bee, through a waggle dance; thereafter, onlooker bee will select a food source based on a probability function related to the richness of that food source, whereas scout bee explores new food sources randomly around the hive. When a scout or onlooker bee finds a new food source, it becomes employed again; on the other hand, when a food source has been fully exploited, all the employed bees will abandon the site and may become scouts again. In ABC metaheuristic, a food source corresponds to a possible solution to the optimization problem and the number of employed bees are equal to the number of food sources.

Below we present the detail procedure of ABC metaheuristic in different phases.

3.1 Initialization phase

ABC metaheuristic starts with initial population number (PN), randomly generated through D-dimensional real set of vectors. Let \( x_{ij} = \{\ x_{i1}, x_{i2},\ldots x_{iD}\} \) is the ith food source, where \(j =1,2\ldots D\) is obtained by:

$$\begin{aligned} x_{ij} = x_{{\mathrm{min}}_j} + rand(0,1) ( x_{{\mathrm{max}}_j} - x_{{\mathrm{min}}_j} ) \end{aligned}$$
(1)

where \( x_{{\mathrm{min}}_j} \) and \( x_{{\mathrm{max}}_j} \) denotes lower and upper limits, respectively.

3.2 Employed bee phase

In this phase, each employed bee obtains a new solution \( v_{ij}\) from \( x_{ij}\) using expression:

$$\begin{aligned} v_{ij} = x_{ij} + \phi _{ij} (x_{ij}- x_{kj}) \end{aligned}$$
(2)

where k is randomly obtained from { 1,2...SN } and \(\phi _{ij}\) is a uniform random number between [\(-1, 1\)]. The value of \( v_{ij}\) is obtained and compared to \( x_{ij}\), further if fitness of \( v_{ij}\) comes out better than \(x_{ij}\), then bee will forget the old solution and remember the new one. Otherwise, it will keep exploiting \( x_{ij}\).

3.3 Onlooker bee phase

All employed bees share the nectar information of their food source with the onlookers, through a waggle dance performed at their hive, after which they select a food source depending on a probability \( p_{i}\) as:

$$\begin{aligned} {p_i}= {\frac{f_i}{\sum _{n=1}^{\mathrm{SN}}{f_i}}} \end{aligned}$$
(3)

where \( f_{i}\) is the fitness of \( x_{i}\). Onlooker bee chooses a food sources with higher fitness and search \( x_{ij}\) according to Eq. (2); now if the new solution has a better fitness, it will replace \( x_{ij}\).

3.4 Scout bee phase

After a number of trials, called maximum cycle number (MCN), if a solution cannot be improved further then food source is abandoned, and the corresponding employed bee becomes a scout again. The scout will then produce a new food source randomly by using Eq. (1) again.

4 Variants of ABC

Various modifications has been proposed in the past to inculcate efficiency in the existing original version of the ABC metaheuristic. One of the factors, which affect the outcome of the metaheuristic, is influenced by its solution search equations and thus require many modifications. Advising an improved solution search equation trying to set a balance between the exploitation and exploration capabilities of the metaheuristic, Gao and Liu (2011) introduced search equations which are based on differential evolution (DE) (Ferranate Neri 2001) algorithms, to solve numerous real-world optimization problems.

$$\begin{aligned} v_{ij}= & {} x_{bj} + \phi _{ij} (x_{ij}- x_{rj}) \end{aligned}$$
(4)
$$\begin{aligned} v_{ij}= & {} x_{r1j} + \phi _{ij} (x_{ij}- x_{r2j}) \end{aligned}$$
(5)

where \(x_{bj}\) is the global best solution, \(\phi _{i,j}\) is a uniform random number and \(x_{r,j}\) is the jth component of a random solution. In addition, Heinzelman et al. (2002) introduced another variant later as

$$\begin{aligned} v_{ij} = x_{bj} + \phi _{ij} (x_{r1j}- x_{r2j}) \end{aligned}$$
(6)

Other search equations are proposed by Abro and Mohamad-Saleh (2012) and Gao and Liu (2013)

$$\begin{aligned} v_{ij}= & {} x_{r1j} + \phi _{ij} (x_{r2j}- x_{r3j}) \end{aligned}$$
(7)
$$\begin{aligned} v_{ij}= & {} x_{bj} + \phi _{ij} (x_{r1j}- x_{r2j})+ \psi _{ij}(x_{r3j}- x_{r4j}) \end{aligned}$$
(8)
$$\begin{aligned} v_{ij}= & {} x_{bj} + \phi _{ij} (x_{r1j}- x_{r2j})+ \psi _{ij}(x_{\mathrm{sbj}}- x_{ij}) \end{aligned}$$
(9)

where \(x_{\mathrm{sbj}}\) is the j coefficient of the second best solution. However, the effectiveness of these DE-based equations will critically depend on the appropriate setting of population size and strategy parameters. Therefore, to obtain optimal solution, the parameters setting must be required.

These equations are further modified by Li and Niu (2013) into Eq. (10), where \(w_{ij}\) is the relative weight and \(\theta _1 \), \(\theta _2\) are parameters to control step size.

$$\begin{aligned} v_{ij} = w_{ij}x_{bj} + \phi _{ij}\theta _1 (x_{ij}- x_{rj})+ \psi _{ij}\theta _2(x_{bj}- x_{ij}) \end{aligned}$$
(10)

Although the above-mentioned solution search equation may refine the exploitation process, using two different control parameters sometimes leads to oscillation. The search equations introduced above can be utilized in onlooker bee phase as well; however, in that case neighborhood search will be performed on most anticipating solutions with best fitness.

Scout bee phase also witnessed some improvements (Guo and Cheng 2011) in form of new solution search Eqs. (11), (12) as:

$$\begin{aligned} v_{ij}= & {} x_{ij} + \phi _{ij} (x_{bj}- x_{ij}) \end{aligned}$$
(11)
$$\begin{aligned} v_{ij}= & {} x_{ij} + \phi _{ij} (x_{\mathrm{sbj}}- x_{ij}) \end{aligned}$$
(12)

In addition, some improved versions of the ABC metaheuristic (Akay and Karaboga 2012) include some parameters, like modification rate (MR) and scale factor (SF); MR controls the neighborhood search, whereas SF controls the length of the search. However, most of the above-mentioned works do not control the adaptation of the population and does not specify any means to improve sampling space, which is a significant measure to improve the effectiveness of ABC metaheuristic.

5 Author’s contribution

The main contributions of this paper are listed as follows:

  1. 1.

    Improved artificial bee colony (iABC) metaheuristic: In an attempt to further improve the convergence rate and attain a perfect balance between exploitation and exploration capabilities of existing ABC metaheuristic, we propose an improved artificial bee colony (iABC) metaheuristic with better sampling technique using Student’s t-distribution; a compact probability density function (cPDF), which requires only one control parameter to be stored on memory. Student’s t-distribution is being introduced first time from the widely acclaimed family of estimation of distribution algorithms (EDAs) framework. Further, an improved solution search equation named ABC/rand-to-opt/1 is proposed, which is motivated by existing differential evolution (DE) family framework and educe a optimal solution from the current best solutions thus improving convergence rate of the proposed metaheuristic.

  2. 2.

    Beecluster—an improved artificial bee colony-based clustering protocol: Utilizing capabilities of the proposed metaheuristic, we introduce Beecluster, an improved artificial bee colony-based clustering protocol for optimal cluster head (CH) selection, which is a well-identified NP-hard optimization problem in WSNs. Additionally, we determine the optimal position of the BS through analytical evaluation of energy equations, which reduce the energy requirements of the existing network, thus extending network life of WSNs.

6 Improved artificial bee colony (iABC) metaheuristic

Like standard ABC metaheuristic, its variants too face some challenges, like the convergence rate is typically slow since they find difficulty in choosing the most promising search solution, while solving complex multimodal optimization problems. To overcame these limitations, we propose an improved artificial bee colony (iABC) metaheuristic with an improved initialization phase for better sampling and improved solution search equation, namely ABC/rand-to-opt/1 with optimal search abilities. The details of the proposed metaheuristic are as follows:

6.1 Improved initialization phase

Population initialization is an important step in evolutionary algorithms as it can affect the convergence rate and quality of the final solution. Moreover, a large amount of the memory is needed either to store the trial solutions or control parameters of the problem. To reduce the memory requirements, the concept of virtual population has been introduced (Mininno and Cupertino 2008) through family of estimation of distribution algorithms (EDA) (Larranaga and Lozano 2001) framework by considering compact probability density functions (cPDFs). Therefore, we propose Student’s t-distribution (Walck 1996); a cPDF, which needs only one vector to be stored on memory, thus reduces storage and step up convergence rate. The proposed distribution can be described by Eq. (13 ) where \( f(x_{ij})\) is the value of the cPDF corresponding to variable \( x_{ij} \), the \( (-\infty , \infty ) \) domain of the proposed cPDF is truncated to [\(-1,1\)] and B represents a Beta function. By applying this cPDF, only vector \( \kappa \) is needed to be stored on memory. This cPDF is being introduced first time in population-based metaheuristic due to its compact nature.

$$\begin{aligned} f(x_{ij})= \dfrac{{{\Bigg (1+ \dfrac{x_{ij}^2}{\kappa } \Bigg )}^ {-(\kappa +1)/2}}}{ {\sqrt{\kappa }B\Bigg (\dfrac{1}{2},\dfrac{\kappa }{2}\Bigg )}} \end{aligned}$$
(13)

Further, we suggested a new alternative with cumulative distribution function (CDF) of the proposed Student’s t-distribution, where a pair of cPDFs that share the same parameters are derived through Student’s t-CDF by taking integral from \(-x \) to x with respect to \(\mathrm{d}x\) for function f(x) as mentioned below:

$$\begin{aligned} \int _{-x}^x f(x) \mathrm{d}x&= \dfrac{1}{{\sqrt{\kappa }B\Bigg (\dfrac{1}{2},\dfrac{\kappa }{2}\Bigg )}}\int _{-x}^x {{\Bigg (1+ \dfrac{x^2}{\kappa } \Bigg )}^ {-(\kappa +1)/2}} \mathrm{d}x \nonumber \\&= \dfrac{2}{{\sqrt{\kappa }B\Bigg (\dfrac{1}{2},\dfrac{\kappa }{2}\Bigg )}}\int _{0}^x {{\Bigg (1+ \dfrac{x^2}{\kappa } \Bigg )}^ {-(\kappa +1)/2}} \mathrm{d}x \nonumber \\&= \dfrac{-2}{{\sqrt{\kappa }B\Bigg (\dfrac{1}{2},\dfrac{\kappa }{2}\Bigg )}}\int _{1}^{\kappa /{\kappa +x^2}}\dfrac{{x}^{{\kappa +1}/2}\kappa \sqrt{x}}{2x^2\sqrt{\kappa }\sqrt{(}1-x)} \mathrm{d}x \nonumber \\&=\dfrac{1}{{B\Bigg (\dfrac{1}{2},\dfrac{\kappa }{2}\Bigg )}}\int _{\kappa /{\kappa +x^2}}^{1} {(1-x)}^{-1/2} x^{{\kappa /2}-1}\mathrm{d}x \nonumber \\&=\dfrac{1}{B\Bigg (\dfrac{1}{2},\dfrac{\kappa }{2}\Bigg )}\Bigg (B\Bigg (\dfrac{\kappa }{2},\dfrac{1}{2}\Bigg )-{B_{\dfrac{\kappa }{\kappa +x^2}}\Bigg (\dfrac{\kappa }{2},\dfrac{1}{2}}\Bigg )\Bigg ) \nonumber \\&=1-I_{\dfrac{\kappa }{\kappa +x^2}}\Bigg (\dfrac{\kappa }{2},\dfrac{1}{2}\Bigg ) = I_{\dfrac{x^2}{\kappa +x^2}}\Bigg (\dfrac{1}{2},\dfrac{\kappa }{2}\Bigg ) \end{aligned}$$
(14)

where I corresponds to incomplete Beta function. Therefore, the search space corresponding to variable \( x_{ij} \) is now divided into [\(-1,0\)] and [0,1] and instead of applying one cPDF, a pair of cPDFs \( P_j(x)\) (15) and \( Q_j(x) \) (16) are employed for better sampling based on a parameter \(\xi \) that controls the probability of sampling.

$$\begin{aligned} P_j(x)= & {} \dfrac{1}{2}-\dfrac{1}{2}I_{\dfrac{x_{ij}^2}{\kappa +x_{ij}^2}}\Bigg (\dfrac{1}{2},\dfrac{\kappa }{2}\Bigg ) \quad \mathrm{for}\,\,-1<x<0 \end{aligned}$$
(15)
$$\begin{aligned} Q_j(x)= & {} \dfrac{1}{2}+\dfrac{1}{2}I_{\dfrac{x_{ij}^2}{\kappa +x_{ij}^2}}\Bigg (\dfrac{1}{2},\dfrac{\kappa }{2}\Bigg ) \quad \mathrm{for}\,\, 0 \le x<1 \end{aligned}$$
(16)

These equations are employed to refine the sampling process which ultimately enhance the convergence rate of the proposed metaheuristic globally.

6.2 Improved solution search equation

Differential evolution (DE) (Storn R 2010) employs most powerful stochastic real-parameter algorithms to solve multimodal optimization problems with the optimal combination of population size and their associated control parameters. In other words, a well-contrive parameter adaptation approach can effectively solve various optimization problems and convergence rate can improve further if the control parameters are adjusted to appropriate values with improved solution search equations at different evolution stages of a specific problem. There are various DE variants which are different in their mutation strategies, but DE/rand-to-best/1 (Das and Sugantha 2011; Gonuguntla et al. 2015) is one of its kind which explore best solutions to direct the movement of the current population and can effectively maintain population diversity as well.

$$\begin{aligned} \mathrm{DE/rand-to-best/1} : v_{t}= & {} x_{t} + \mathrm{SF}_1 (x_{\mathrm{bes}}- x_{t})\nonumber \\&+\, \mathrm{SF}_2(x_{r}- x_{s}) \end{aligned}$$
(17)

where \(\mathrm{SF}_1\) and \(\mathrm{SF}_2\) are scaling factors for neighborhood search. Inspired by this DE variant (17) and inculcating properties of the ABC metaheuristic, we propose a new solution search equations ABC/rand-to-opt/1 as follows:

$$\begin{aligned} \mathrm{ABC/rand-to-opt/1} : v_{ij}= & {} x_{ij} + \phi _{ij} (x_{\mathrm{opt}, j}- x_{ij})\nonumber \\&+ \psi _{ij}(x_{r_{1}j}- x_{r_{2}j})\nonumber \\ \end{aligned}$$
(18)

where \( r_1, r_2 \) are random variables from \({1, 2,\ldots , SN}\), \( x_{\mathrm{opt}} \) is the optimal individual solution with optimal fitness in the current population with \(\phi _{ij}\) and \(\psi _{ij}\) are scaling factors, respectively.

The proposed solution search equation ABC/rand-to-opt/1, which utilizes the information of only optimal solutions in the current population, can improve the convergence rate of the proposed metaheuristic.

Table 2 Benchmark functions used in experiment

To increase the multifariousness of the population further, a crossover operation is performed as :

$$\begin{aligned} {u_{ij}}= \left\{ \begin{array}{ll} v_{ij} &{}\quad \text {if } r[0,1] \le {\mathrm{CR}}, \\ x_{\mathrm{opt}, j} &{}\quad \text {{otherwise} } \end{array}\right. \end{aligned}$$
(19)

Then, a selection operation will be performed as:

$$\begin{aligned} {x_{i,j}}= \left\{ \begin{array}{ll} u_{ij} &{}\quad \text {if } f(u_{ij}) \le \ f(x_{ij}), \\ x_{\mathrm{opt},j} &{}\quad \text {{otherwise} } \end{array}\right. \end{aligned}$$
(20)

where \( f(x_{ij}) \) is the fitness function, if the new solution seems to have high fitness value, then it replaces the corresponding old solution; otherwise, the old solution is retained in the memory. Therefore, with the proposed improved solution search equation, optimal solution is obtained with optimal exploration and exploitation ability thus contribute to a better convergence rate.

We have evaluated the convergence rate of our proposed iABC metaheuristic with the standard ABC metaheuristic using set of eight scalable benchmark functions \(f_1 \) to \(f_8 \), where functions \( f_1 \) to \(f_4 \) are unimodal and functions \( f_5 \) to \(f_8 \) are multimodal functions as shown in Table 2:

Figures 1 and 2 show that the proposed iABC metaheuristic convergence fast with optimal or closer-to-optimal solutions on the unimodal as well as complex multimodal functions over to its standard ABC variant. Therefore, the proposed metaheuristic can improve searching abilities, increase convergence rate and possess more computational efficiency.

7 Beecluster-proposed clustering protocol

We inherit the capabilities of our proposed metaheuristic to solve well-known NP-hard optimization problem of energy-efficient clustering in WSNs by proposing Beecluster, an improved artificial bee colony-based clustering protocol with an optimal CH selection ability. Additionally, we also determine the optimal location of the BS through analytical evaluation of energy equations, which reduce the energy consumption of the network and help to enhance the network life of existing WSN.

7.1 Notations for network model

Following notations are used for network model in our proposed work:

  1. 1.

    S is set of sensor nodes \( S = \{\ s_1, s_2,\ldots ,s_n \} \), which are randomly distributed over a geographical area of defined dimensions \(m \times m\), whereas \( s_{n+1}\) denotes the BS. Each sensor node has a communication radius r.

  2. 2.

    L is set of bidirectional wireless links between two sensor nodes, where \(l_{i,j}\)\(\epsilon \) L represents wireless link between node \(s_i\) and \(s_j\).

  3. 3.

    Set of cluster heads (CH’s) are denoted by \( S_{\mathrm{ch}} = \{\mathrm{ch}_1, \mathrm{ch}2,\ldots \mathrm{ch}{k} \} \) where \( S_{\mathrm{ch}} \) is included in S.

  4. 4.

    \( D_{{s}_i}^{s_j}\) denotes the maximum distance between a senor node \( s_{i}\) and \( s_{j}\) is calculated by squared Euclidean distance between them as

    $$\begin{aligned} {D_{{s}_i}^{s_{j}}}&=\mathrm{dis} (s_i,s_{j}) |\forall s_i, s_j \epsilon S\nonumber \\ {D_{{s}_i}^{s_{j}}}&= \Arrowvert s_i - s_j \Arrowvert ^2 = \sum {(s_i - s_j)}^2 |\forall s_i, s_j \epsilon S \end{aligned}$$
    (21)
  5. 5.

    \( D_{{s}_i}^{s_{n+1}}\) denotes the maximum distance between a senor node \( s_{i}\) and BS, calculated by squared Euclidean distance between them as

    $$\begin{aligned} {D_{{s}_i}^{s_{n+1}}}&= \mathrm{dis} (s_i,s_{n+1}) |\forall s_i \epsilon S \nonumber \\ {D_{{s}_i}^{s_{n+1}}}&= \Arrowvert s_i - s_{n+1} \Arrowvert ^2 = \sum {(s_i - s_{n+1})}^2 |\forall s_i \epsilon S \end{aligned}$$
    (22)
  6. 6.

    \( D_{{s}_i}^{\mathrm{ch}j}\) denotes the maximum distance between a senor node \( s_{i}\) and cluster head \({\mathrm{ch}}_j\), calculated by squared Euclidean distance between them as

    $$\begin{aligned} {D_{{s}_i}^{\mathrm{ch}{j}}}&= \mathrm{dis} (s_i,\mathrm{ch}{j}) |\forall s_i, \mathrm{ch}{j} \epsilon S\nonumber \\ {D_{{s}_i}^{\mathrm{ch}{j}}}&= \Arrowvert s_i - \mathrm{ch}{j} \Arrowvert ^2 = \sum {(s_i - \mathrm{ch}{j})}^2 |\forall s_i, \mathrm{ch}{j} \epsilon S \end{aligned}$$
    (23)
  7. 7.

    \( D_{{\mathrm{ch}}_j}^{s_{n+1}}\) represents the maximum distance between a cluster head \({\mathrm{ch}}_j\) and BS, calculated by squared Euclidean distance between them as

    $$\begin{aligned} {D_{{\mathrm{ch}}_j}^{s_{n+1}}}&=\mathrm{dis} ({\mathrm{ch}}_j,s_{n+1}) |\forall j \epsilon S_{\mathrm{ch}}\nonumber \\ {D_{{\mathrm{ch}}_j}^{s_{n+1}}}&= \Arrowvert {\mathrm{ch}}_j - {s_{n+1}} \Arrowvert ^2 \nonumber \\ {}&= \sum {({\mathrm{ch}}_j - {s_{n+1}})}^2 |\forall j \epsilon S_{\mathrm{ch}} \end{aligned}$$
    (24)
  8. 8.

    Transmission power of a sensor node \( s_{i}\) is calculated as:

    $$\begin{aligned} {P_{{\mathrm{tran}}_i}}&= \dfrac{1}{k}{\Bigg (\dfrac{\gamma . T_{\mathrm{delay}}}{dc}\Bigg )}^\alpha \end{aligned}$$
    (25)

    where \(T_{\mathrm{delay}}\) is the sum of three delay components as

    $$\begin{aligned} T_{\mathrm{delay}}&=T_{\mathrm{que}} + T_{\mathrm{tran}} + T_{\mathrm{ack}} \end{aligned}$$
    (26)

    The first component, \(T_{\mathrm{que}}\), is the queuing delay, second component, \(T_{\mathrm{tran}}\), is the transmission delay and third one, \(T_{\mathrm{ack}} \), is delay due to acknowledgement packet. \( \gamma \) , \(\alpha \), dc are signal-to-noise ratio, path loss exponent and delay constraint, respectively, whereas k is a power constant.

7.2 Optimal base station (BS) position

Placement of BS at appropriate location is an all important task in WSNs as it affect its performance by reducing energy consumption and enhancing lifetime of the network. Therefore, we present an analytical evaluation to determine the optimal location of the BS based on critical energy analysis of WSNs. The radio model is assumed to be same which has been used in earlier work (Heinzelman et al. 2002), in which CHs receive data packets from SNs for aggregation but include an additional acknowledgment packet (ACK) in return to the source node after receiving a correct packet. This is first time we incorporate the significance of energy consumption by the exchange of a ACK in WSNs. The radio hardware, which include a transmitter, dissipates energy to run transmitter radio electronics and power amplifier, whereas the receiver dissipates energy to run the receive radio electronics as shown in Fig. 3:

Fig. 1
figure 1

Convergence rate of iABC

Fig. 2
figure 2

Convergence rate of ABC

Fig. 3
figure 3

Radio model for energy analysis

Therefore, the energy consumption for transmission of l bits of data is composed of three parts: the energy consumed by the transmitter \( E_{\mathrm{trans}}\), by the receiver \( E_{\mathrm{rec}} \) and by the ACK packet exchange \( E_{\mathrm{ack}}\).

$$\begin{aligned} E_{\mathrm{total}}(l,d)= E_{\mathrm{trans}}(l,d) + E_{\mathrm{rec}}(l,d) + E_{\mathrm{ack}} \end{aligned}$$
(27)

Now, energy consumed for transmitting l bits of data is given by:

$$\begin{aligned} E_{\mathrm{trans}}(l,d)= l.E_{\mathrm{elec}} + E_{\mathrm{amp}}(l,d) \end{aligned}$$
(28)

Further, if the distance between transmitter, and receiver is d, then

$$\begin{aligned} {{E_{\mathrm{trans}}}(l,d)}= {\left\{ \begin{array}{ll} {l{E_{\mathrm{elec}}}} + l{{\epsilon }_{\mathrm{fs}}d^2}&{} \text {if } d < d_0, \\ {l{E_{\mathrm{elec}}}} + l{{\epsilon }_{\mathrm{mp}}d^4}&{} \text {if } d \ge d_0, \end{array}\right. } \end{aligned}$$
(29)

where \(d_0\) is the threshold distance.

And to receive l bit message, the radio spends \( E_{\mathrm{rec}}(l,d) \) as

$$\begin{aligned} E_{\mathrm{rec}}(l,d)= l.E_{\mathrm{elec}} \end{aligned}$$
(30)

Energy consumed for ACK packet exchange is given by

$$\begin{aligned} E_{\mathrm{ack}}= \tau _{\mathrm{ack}}( E_{\mathrm{trans}} + E_{\mathrm{rec}}) \end{aligned}$$
(31)

where \(\tau _{\mathrm{ack}}= \dfrac{l_{\mathrm{ack}}}{l}\) is the ratio of length of acknowledgement packet to data packet.

Therefore, residual energy of each senor node is calculated as:

$$\begin{aligned} E_{\mathrm{res}}= E_{\mathrm{total}} - ( E_{\mathrm{trans}} + E_{\mathrm{rec}} + E_{\mathrm{ack}} ) \end{aligned}$$
(32)

If there will be n nodes uniformly distributed in an \(m * m \) field with k clusters, then there will be \( \dfrac{n}{k}\) nodes per cluster. Out of these, there will be one CH node and remaining \(\dfrac{n}{k}-1\) non-CH nodes.

Now, energy consumed by a non-CH node is given by:

$$\begin{aligned} E_{\mathrm{non-ch}}(l,d)= & {} E_{\mathrm{trans}}(l,d) \end{aligned}$$
(33)
$$\begin{aligned}= & {} l.E_{\mathrm{elec}} + E_{\mathrm{amp}}(l,d) \end{aligned}$$
(34)

and energy consumed by a CH node is given by :

$$\begin{aligned} E_{\mathrm{ch}}(l,d)= & {} E_{\mathrm{trans}}(l,d)+ \left( \dfrac{n}{k}-1\right) .l.E_{\mathrm{elec}} + \dfrac{n}{k}l.E_{\mathrm{da}}\nonumber \\&+ \left( \dfrac{n}{k}-1\right) E_{\mathrm{ack}} \end{aligned}$$
(35)

where \( E_{\mathrm{da}} \) is the energy consumed by CH for data aggregation at its end. Now, the total energy consumed in a cluster is given by :

$$\begin{aligned} E_{\mathrm{cluster}}= E_{\mathrm{ch}}(l,d)+ \left( \dfrac{n}{k}-1\right) E_{\mathrm{non-ch}} \end{aligned}$$
(36)

Therefore, energy consumed in whole network per round

$$\begin{aligned} E_{\mathrm{round}}= \sum _{j=1}^k E_{\mathrm{cluster}}(j) \end{aligned}$$
(37)

Lemma 1

\(\forall \)\( \{\ s_1, s_2, \ldots s_n \} \)\(\epsilon \) S near to BS, the total energy consumption for transmission of l bits of data from nodes to BS will be a function of \( \sum _{j=1}^n {({\mathrm{ch}}_j - {s_{n+1}})}^2 \) and optimal BS position will be located at centroid of \( \{\ s_1, s_2, \ldots s_n \} \)\(\epsilon \) S.

Proof

Let \( \{\ s_1, s_2, \ldots s_n \} \)\(\epsilon \) S are randomly deployed at \(M = m \times m\) sensor field, within direct communication range to BS.

From Eqs. (33), (35), (36), Eq. (37) can be written as :

$$\begin{aligned} E_{\mathrm{round}}= & {} l.(2n-k).E_{\mathrm{elec}}+ n.l.E_{\mathrm{da}}+ \sum _{i=1}^n E_{\mathrm{amp}}(l.D_{{s}_i}^{\mathrm{ch}j})\nonumber \\&\quad + \sum _{j=1}^k E_{\mathrm{amp}}(l.D_{{\mathrm{ch}}_j}^{s_{n+1}}) + \left( \dfrac{n}{k}-1\right) E_{\mathrm{ack}} \end{aligned}$$
(38)

Signals from all the nodes suffer free space loss while transmitting data; therefore, we have:

$$\begin{aligned} \sum _{i=1}^n E_{\mathrm{amp}}(l.D_{{s}_i}^{\mathrm{ch}j})= l.(n-k)\epsilon _{\mathrm{fs}} \left( \dfrac{M^2}{2\pi k}\right) \end{aligned}$$
(39)

So, Eq. (38) becomes:

$$\begin{aligned}&E_{\mathrm{round}}\nonumber \\&\quad = l\Bigg ((2n-k).E_{\mathrm{elec}}+ n.E_{\mathrm{da}}+(n-k)\epsilon _{\mathrm{fs}} \left( \dfrac{M^2}{2\pi k}\right) \nonumber \\&\qquad + \left( \dfrac{n}{k}-1\right) E_{\mathrm{ack}} + \epsilon _{\mathrm{fs}} \sum _{j=1}^k {(D_{{\mathrm{ch}}_j}^{s_{n+1}})}^2 \Bigg ) \end{aligned}$$
(40)

After n/k rounds, total energy consumption for transmission of l bits of data from nodes to BS, \( E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \) will be given as:

$$\begin{aligned}&E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}})\nonumber \\&\quad =l.\dfrac{n}{k}\Bigg ((2n-k).E_{\mathrm{elec}}+ n.E_{\mathrm{da}}+(n-k)\epsilon _{\mathrm{fs}} \left( \dfrac{M^2}{2\pi k}\right) + E_{\mathrm{ack}}\Bigg )\nonumber \\&\qquad + l.\epsilon _{\mathrm{fs}} \sum _{j=1}^n {(D_{{\mathrm{ch}}_j}^{s_{n+1}})}^2 \end{aligned}$$
(41)

Therefore,

$$\begin{aligned} E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \propto l.\epsilon _{\mathrm{fs}} \sum _{j=1}^n {(D_{{\mathrm{ch}}_j}^{s_{n+1}})}^2 \end{aligned}$$
(42)

thus, from Eq. (24):

$$\begin{aligned}&E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}})\nonumber \\&\quad \propto \mathrm{Min} \Bigg ( l.\epsilon _{\mathrm{fs}} \sum _{j=1}^n {({\mathrm{ch}}_j - {s_{n+1}})}^2 \Bigg ) |\forall j \epsilon S_{\mathrm{ch}} \end{aligned}$$
(43)

Further, to obtain optimal location of BS, we need to minimize \( E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \) and sum of square of Euclidean distances will be minimum at the centroid (R Apostol 2003). Thus, \( E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \) will be minimum if BS will be placed at centroid of \( \{\ s_1, s_2, \ldots s_n \} \)\(\epsilon \) S.

Lemma 2

\(\forall \)\( \{\ s_1, s_2, \ldots s_n \} \)\(\epsilon \) S far from BS, the total energy consumption for transmission of l bits of data from nodes to BS will be a function of \( \sum _{j=1}^n {({\mathrm{ch}}_j - {s_{n+1}})}^4 \) and optimal BS position will be located at centroid of \( \{\ s_1, s_2, \ldots s_n \} \)\(\epsilon \) S.

Proof

As \( \{\ s_1, s_2, \ldots s_n \} \)\(\epsilon \) S are deployed at \(M = m \times m\) sensor field and are far from the direct communication range to BS, after n/k rounds, total energy consumption for transmission of l bits of data from nodes to BS, \( E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \) will be given by:

$$\begin{aligned}&E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}})\nonumber \\&\quad = l.\dfrac{n}{k}\Bigg ((2n-k).E_{\mathrm{elec}}+ n.E_{\mathrm{da}}+(n-k)\epsilon _{\mathrm{fs}} \left( \dfrac{M^2}{2\pi k}\right) + E_{\mathrm{ack}}\Bigg ) \nonumber \\&\qquad + l.\epsilon _{\mathrm{fs}} \sum _{j=1}^n {(D_{{\mathrm{ch}}_j}^{s_{n+1}})}^4 \end{aligned}$$
(44)

Therefore,

$$\begin{aligned} E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \propto l.\epsilon _{\mathrm{fs}} \sum _{j=1}^n {(D_{{\mathrm{ch}}_j}^{s_{n+1}})}^4 \end{aligned}$$
(45)

Thus, from Eq. (24):

$$\begin{aligned}&E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}})\nonumber \\ &\quad \propto \mathrm{Min} \Bigg ( l.\epsilon _{\mathrm{fs}} \sum _{j=1}^n {({\mathrm{ch}}_j - {s_{n+1}})}^4 \Bigg ) |\forall j \epsilon S_{\mathrm{ch}}\nonumber \\ \end{aligned}$$
(46)

Further, to obtain optimal location of BS, we need to minimize \( E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \) and polynomial of Euclidean distances will be minimum at the centroid only (Chen 1984). Thus, \( E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \) will be minimum if BS will be placed at centroid of \( \{\ s_1, s_2, \ldots s_n \} \)\(\epsilon \) S.

Lemma 3

\(\forall \)\( \{\ s_1, s_2, \ldots s_a \} \)\(\epsilon \) S near to BS and \(\forall \)\( \{\ s_1, s_2, \ldots s_b \} \)\(\epsilon \) S far from BS, the total energy consumption for transmission of l bits of data from nodes to BS, will be a function of \( \Bigg ( \sum _{j=1}^n {({\mathrm{ch}}_j - {s_{n+1}})}^2 \) + \( \sum _{j=1}^n {({\mathrm{ch}}_j - {s_{n+1}})}^4 \Bigg ) \) and optimal BS position will be located at centroid of \( \{\ s_1, s_2, \ldots s_a \} \) and \( \{\ s_1, s_2, \ldots s_b \} \)\(\epsilon \) S, respectively.

Proof

As \( \{\ s_1, s_2, \ldots s_a \} \)\(\epsilon \) S are deployed near to BS and \( \{\ s_1, s_2, \ldots s_b \} \)\(\epsilon \) S are far from BS at \(M = m \times m\) sensor field, after n/k rounds, total energy consumption for transmission of l bits of data from nodes to BS, \( E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \) will be given by:

$$\begin{aligned}&E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}})\nonumber \\&\quad = l.\dfrac{n}{k}\Bigg ((2n-k).E_{\mathrm{elec}}+ n.E_{\mathrm{da}}+(n-k)\epsilon _{\mathrm{fs}} \left( \dfrac{M^2}{2\pi k}\right) + E_{\mathrm{ack}}\Bigg ) \nonumber \\&\qquad + l.\epsilon _{\mathrm{fs}} \sum _{i=1}^x {(D_{{\mathrm{ch}}_i}^{s_{n+1}})}^2 + l.\epsilon _{\mathrm{fs}} \sum _{j=1}^y {(D_{{\mathrm{ch}}_i}^{s_{n+1}})}^4 \end{aligned}$$
(47)
$$\begin{aligned}&E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}})\nonumber \\&\quad =l.\dfrac{n}{k}\Bigg ((2n-k).E_{\mathrm{elec}}+ n.E_{\mathrm{da}}+(n-k)\epsilon _{\mathrm{fs}} \left( \dfrac{M^2}{2\pi k}\right) + E_{\mathrm{ack}}\Bigg ) \nonumber \\&\qquad + l.\epsilon _{\mathrm{fs}}\Bigg ( \sum _{i=1}^x {(D_{{\mathrm{ch}}_i}^{s_{n+1}})}^2 + \sum _{j=1}^y {(D_{{\mathrm{ch}}_i}^{s_{n+1}})}^4 \Bigg ) \end{aligned}$$
(48)

Therefore,

$$\begin{aligned} E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \propto l.\epsilon _{\mathrm{fs}}\Bigg ( \sum _{i=1}^x {(D_{{\mathrm{ch}}_i}^{s_{n+1}})}^2 + \sum _{j=1}^y {(D_{{\mathrm{ch}}_i}^{s_{n+1}})}^4 \Bigg ) \end{aligned}$$
(49)

Thus, from Eq. (24):

$$\begin{aligned}&E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \nonumber \\&\quad \propto Min \Bigg ( l.\epsilon _{\mathrm{fs}}\Bigg ( \sum _{j=1}^n {({\mathrm{ch}}_j - {s_{n+1}})}^2 + \sum _{j=1}^n {({\mathrm{ch}}_j - {s_{n+1}})}^4 \Bigg ) \Bigg ) \nonumber \\&\quad |\forall j \epsilon S_{\mathrm{ch}} \end{aligned}$$
(50)

Now, to obtain optimal location of BS, we need to minimize \( E_{\mathrm{total}}(l, D_{{s}_i}^{s_{n+1}}) \), that depends on which type of nodes are dominating in residual energy. If nearby nodes are dominating, i.e., \( E_{{\mathrm{res}}_a}> > E_{{\mathrm{res}}_b} \) then centroid of \( \{s_1, s_2, \ldots s_a \} \)\(\epsilon \) S nodes will be the optimal location for BS, and if \( E_{{\mathrm{res}}_b}> > E_{{\mathrm{res}}_a} \), then centroid of \( \{\ s_1, s_2, \ldots s_b \} \)\(\epsilon \) S nodes will be the optimal location for BS.

7.3 Optimal cluster head (CH) selection

CH selection is one of the crucial task for cluster formation in WSNs as it effects the overall performance of the network. CH will be responsible for collection of data coming from various SNs and transmission of aggregated data to the BS. Selection of appropriate node as a CH will remain a challenging multimodal optimization problem. Therefore, we propose a optimal CH selection algorithm based on our proposed iABC metaheuristic for an improved energy-efficient clustering protocol. The working of proposed algorithm is as follows:

7.3.1 Initialization phase

The population number (PN) and corresponding food sources (SN) are initialized along with control parameters maximum cycle number (MCN), control parameter \( \xi \) and crossover rate (CR).

We employ the proposed improved sampling technique of iABC metaheuristic to generate ith food source \( x_{ij} \), for which we generate \( r \epsilon \) [0, 1] according to uniform distribution and obtain \( x_{ij} \) as :

$$\begin{aligned} x_{ij} = {\left\{ \begin{array}{ll} \dfrac{1}{2}-\dfrac{1}{2}I_{\dfrac{x_{ij}^2}{\kappa +x_{ij}^2}}\Bigg (\dfrac{1}{2},\dfrac{\kappa }{2}\Bigg ) &{} \text {if } r \le \xi , \\ \dfrac{1}{2}+\dfrac{1}{2}I_{\dfrac{x_{ij}^2}{\kappa +x_{ij}^2}}\Bigg (\dfrac{1}{2},\dfrac{\kappa }{2}\Bigg ) &{} r > \xi , \end{array}\right. } \end{aligned}$$
(51)

7.3.2 Fitness function derivation

Now, we construct a fitness function to evaluate the fitness of individual food source of the population. There are three objectives in our proposed CH selection algorithm, firstly the node elected as CH will have maximum residual energy, i.e.,

$$\begin{aligned} f_i \propto {\mathrm{Max}({E_{\mathrm{res}})}} \end{aligned}$$
(52)

Secondly, we ensure to minimize the maximum distance between elected node as CH and BS and finally with minimum transmission power to transmit aggregated data from CH to BS:

$$\begin{aligned} f_i \propto { \frac{1}{\mathrm{Min}( D_{{\mathrm{ch}}_j}^{s_{n+1}}(\mathrm{max}) + P_{{\mathrm{tran}}_i} ) } } \end{aligned}$$
(53)

Aggregating Eqs. (52), (53) as

$$\begin{aligned} f_i \propto { \frac{\mathrm{Max}({E_{\mathrm{res}})}}{\mathrm{Min}( D_{{\mathrm{ch}}_j}^{s_{n+1}}(\mathrm{max}) + P_{{\mathrm{tran}}_i} ) } } \end{aligned}$$
(54)
$$\begin{aligned} f_i = K { \frac{\mathrm{Max}({E_{\mathrm{res}})}}{\mathrm{Min}( D_{{\mathrm{ch}}_j}^{s_{n+1}}(\mathrm{max}) + P_{{\mathrm{tran}}_i} ) } } \end{aligned}$$
(55)

where K is constant of proportionality, assuming K =1,

$$\begin{aligned} f_i = { \frac{\mathrm{Max}({E_{\mathrm{res}})}}{\mathrm{Min}( D_{{\mathrm{ch}}_j}^{s_{n+1}}(\mathrm{max}) + P_{{\mathrm{tran}}_i} ) } } \end{aligned}$$
(56)

Therefore, Eq. (56) will determine the fitness value of each solution of population.

7.3.3 Employed bee phase

Now, each employed bee select a new solution \( v_{ij}\) using proposed improved search Eq. (19) of proposed iABC metaheuristic as:

$$\begin{aligned} v_{ij} = x_{ij} + \phi _{ij} (x_{\mathrm{opt}, j}- x_{ij})+ \psi _{ij}(x_{r1j}- x_{r2j}) \end{aligned}$$
(57)

The obtained value of \( v_{ij}\) is compared to \( x_{ij}\) and if the fitness of \( v_{ij}\) comes out better than \(x_{ij}\), the bee will forget the previous old solution and retain the new optimal solution \( x_{\mathrm{opt}, j} \) found so far; otherwise, it will keep working on \( x_{ij}\).

7.3.4 Onlooker bee phase

Now, employee bee will share the information of their food source with the onlooker bee, through a waggle dance performed at their hive, each of whom will then generate a food source \( u_{ij}\) according to distribution as:

$$\begin{aligned} {u_{ij}}= \left\{ \begin{array}{ll} v_{ij} &{}\quad \text {if } r[0,1] \le {\mathrm{CR}}, \\ x_{\mathrm{opt}, j} &{}\quad \text {{otherwise} } \end{array}\right. \end{aligned}$$
(58)

where CR is crossover rate, further fitness of generated food source \( f(u_{ij}) \) is calculated and compared with previous food source as:

$$\begin{aligned} {x_{i,j}}= \left\{ \begin{array}{ll} u_{ij} &{}\quad \text {if } f(u_{ij}) \le \ f(x_{ij}), \\ x_{\mathrm{opt}, j} &{}\quad \text {{otherwise} } \end{array}\right. \end{aligned}$$
(59)

where \(f(x_{ij})\) is the fitness value of \( x_{ij}\). Onlooker bee will then choose a food source with higher fitness and conduct a local search on \( x_{ij}\), if the new solution has a better fitness, then it will replace \( x_{ij}\) with optimal solution \( x_{\mathrm{opt},j} \) and assigned as a CH; otherwise, the old solution will be retained.

7.3.5 Scout bee phase

Now, if the fitness cannot improve further, after a number of trials then the corresponding employed bee becomes a scout to produce a new food source randomly by using Eq. (51) again.

Details of the cluster head (CH) selection algorithm is discussed as below:

figure a

To evaluate and compare the performance of our proposed clustering algorithm based on iABC with standard ABC metaheuristic, we performed simulation for 10,000 rounds and obtained number of CHs per round.

Fig. 4
figure 4

CHs selected per round in \(iAB{C^2}\)

Fig. 5
figure 5

CHs selected per round in ABC

Figures 4, 5 show that the proposed metaheuristic clearly supports more number of CHs per round compared to its peer, which in turns is contributed to its optimal search ability and better convergence rate. The proposed improved metaheuristic also supported network for larger number of rounds, compared to standard metaheuristic, which is attributed to Student’s t-distribution’s compact nature that saved energy to support network for longer duration.

7.4 Cluster formation phase

After selection of CHs, each CH will advertise a Join-Request (J-REQ) message to all its neighbor nodes for cluster formation. Then, each non-CH node will join the nearest CH node based on squared Euclidean distance between them (Eq. 24), through a Join-Acknowledgment (J-ACK) short message which will be transmitted using a CSMA/CD MAC protocol, to became member of the cluster. During this communication, all CH nodes must keep their receivers on and listen to the channel. If a particular node receives multiple J-REQ message from same CH, then it discards the message to eliminate duplicate frames. After receiving J-ACK messages from all the surrounding nodes, each CH must maintain a cluster member table and create a TDMA schedule for each member node of the cluster for data transmission. During cluster formation, it is ensured that each non-CH node must join a cluster under a CH to avoid node isolation.

7.5 Data transmission phase

After cluster formation, when TDMA schedule is communicated to each member node for data transmission, SNs collect data and transmit it to their CH during their allocated TDMA schedule. The \(non-CH\) nodes can turn their radio transmitter off during other members transmission turn to save energy consumption. After receiving all the data, CH nodes aggregate it at its end using data aggregation algorithms and route the aggregated data packets to the BS.

8 Simulation results and discussion

Now, we evaluate the performance of proposed Beecluster protocol with existing PSO (Kuila and Jana 2014), MRP (Yang et al. 2009) and ERP (Attea and Khalil 2012) protocols using ns-2 simulator. The protocols are simulated over two different BS position scenarios to assess their behavior toward packet delivery ratio, throughput, energy consumption, network lifetime and average latency. The simulation will be performed over standard MAC protocol with free space radio propagation and CBR traffic type, considering other parameters as shown in Table 3 below:

Table 3 Simulation Parameters

In the first scenario WSN # 1, a network of sensor nodes ranging from 100 to 700 are deployed randomly over an area of size \( 200 \times 200\) m\(^2\) with a BS, located at optimal position calculated through proposed evaluation of energy Eq. (7.2) within the network field, whereas in second scenario WSN # 2, a BS will be placed at position (100, 300 m) outside the network field. First, we execute the protocols to compare packet delivery ratio (PDR) in the network for both the scenarios.

Fig. 6
figure 6

Packet delivery ratio in WSN # 1

Fig. 7
figure 7

Packet delivery ratio in WSN # 2

In scenario WSN # 1, Fig. 6 shows that the proposed protocol delivers highest number of packets among its all peers, even at highest density of nodes. Beecluster deliver approximately 100% packets at 100 nodes with BS located at optimal position in WSN # 1 scenario. Even in WSN # 2 scenario, Fig. 7 shows that Beecluster has highest PDR as compared to PSO, MRP and ERP at nodes ranging from 100 to 700. It is further analyzed from above Figs. 6 and 7 that PDR remain highest, at optimal BS position, i.e., in WSN # 1 scenario which clearly shows the significance of placing BS at optimal position, as manual intervention is possible for BS position while deployment of nodes in a WSN.

Fig. 8
figure 8

Throughput in WSN # 1

Fig. 9
figure 9

Throughput in WSN # 2

Throughput is a measure of robustness for any protocol, and Figs. 8 and 9 show that Beecluster is delivering highest number of packets per second even at 700 nodes deployed in the both scenarios. The low performance of PSO and ERP is due to the fact that they are non-cluster-based protocols and hence lack in performance while delivering data from nodes to BS. Additionally, it is observed that optimal BS position scenario WSN # 1 Fig. 8, witness highest throughput compared to WSN # 2 Fig. 9, thus placing BS at optimal position will increase data delivery per second in WSNs.

Fig. 10
figure 10

Energy consumption in WSN # 1

Fig. 11
figure 11

Energy consumption in WSN # 2

Figure 10 shows that in scenario WSN # 1, energy consumption of the proposed protocol is approximately 32, 73, 131% less then PSO, MRP and ERP protocols, respectively, which is attributed to the use of compact Student’s t-distribution and improved solution search equation to selects optimal CHs, thus minimizing energy consumption in the network. Even in scenario WSN #2, Fig. 11, Beecluster consumes 41% less energy as compared to its contender PSO, which clearly shows the effectiveness of the proposed metaheuristic iABC. In Beecluster, optimal CHs are selected not only based on their proximity to BS but with the condition of minimum power consumption in data transmission; moreover, the SNs are assigned to their nearest CH, thus consuming less energy and as a result the overall energy consumption of the network becomes lesser than other protocols. In MRP, all CHs are inevitably used as a relay node to forward the data packets to the BS; therefore, consume more energy whereas PSO and ERP are non-cluster-based protocols and are not able to optimize the energy usage in complex WSN scenario. Moreover, placement of BS at optimal location will decrease the energy consumption as evident from Figs. 10 and 11, respectively.

Figures 12 and 13 shows that Beecluster extend the average network lifetime by approximately 21 and 18 % compared to PSO and MRP in WSN # 1 and WSN # 2, respectively, which is the effect of nodes surplus energy availability due to less computation and an optimal selection of CHs with proposed metaheuristic.

Fig. 12
figure 12

Network lifetime in WSN # 1

Fig. 13
figure 13

Network lifetime in WSN # 2

The energy thus saved will prolong the network lifetime, and the nodes will be able to transmit data for a longer duration. In MRP, due to un-symmetric data forwarding effects on the CHs, those near to the BS will die quickly thus reducing network lifetime. ERP is having the least network lifetime among all its peers, due to absence of a clear data aggregation and communication framework, specially for WSN # 2 like scenarios. It is further analyzed that every 1 % increase in network lifetime of the proposed protocol will increase the data delivery by 3.8% , thus increasing networks robustness.

Fig. 14
figure 14

Average latency in WSN # 1

Fig. 15
figure 15

Average latency in WSN # 2

Figures 14 and 15 compare the average latency in both scenarios after number of rounds ranging from 250 to 1500. It is clearly visible that Beecluster deliver data packets with minimum latency in both the scenarios among other protocols which ultimately increases reliability of the network. In WSN #1, average latency decreases sharply with increase in number of rounds in Beecluster, which is due to the fact that the proposed protocol deliver data packets to the BS with minimum relay after calculating the optimal possible distance for the next hop; moreover, the CHs are placed at optimal distance to BS, thus maintaining a trade-off between transmission distance and hop count. Also in WSN #2, when the BS is located at a far distance from sensor nodes, the proposed protocol will be able to deliver the data packets with minimum delay successfully. In PSO and MRP, data will be transmitted to BS using maximum number of hop count ultimately exhausting the network with unnecessary end-to-end delay.

9 Conclusion

This paper presents an iABC metaheuristic, based on first-of-its-kind Student’s t-cPDF and DE-inspired improved solution search equation ABC/rand-to-opt/1, to improve exploitation capabilities a well as convergence rate of existing ABC metaheuristic. To demonstrate its improvement, we evaluated the proposed metaheuristic on scalable unimodal and multimodal benchmark functions with standard metaheuristic. Further, we proposed Beecluster, a clustering protocol based on the proposed metaheuristic for WSNs, which selects optimal CHs based on an improved search equation and an efficient fitness function. In addition to this, we calculated optimal position of BS, through analytical evaluation of energy equations in WSNs. At last, we compare the performance of the proposed protocol with other protocols to prove its validness over various performance metrics. Simulation results show that Beecluster consumes approximately 32–131% less energy as compared to other protocols and prolongs network life approximately by 18–21 % while delivering highest number of packets with minimum end-to-end delay in diverse WSNs scenarios.