1 Introduction

The sensor nodes are deployed abundantly in a random manner over the WSNs [1] for sensing and monitoring the environmental and physical conditions. Four major components are deployed in WSN. They are, the data accumulation from the desired geographical area by SNs (Sensor Node); the data transmission by the interconnection network through SNs [2] to the gateway or sink; sink that is the central data gathering system and is the set of computing resources for storage, analysis, and processing at the user end [3] [4]. WSNs provide a wide range of applications in military, natural disaster detection and monitoring, structural health monitoring, and environmental monitoring.

In WSN [5], the preservation of energy consumption is made by the clustering technique that performs the selection of CH [6] [7]. CSN is the technique that gathers the consumption of energy. The arrangement of sensor nodes is in the different groups in the clustering process [8] [9] so-called clusters. Every cluster includes a CH (i.e. a controller) and the residual nodes are referred to as CMs. Each sensor node should belong to only one cluster. The sensed data is sent by the sensor nodes to their related CHs. The CH then associates all and transfers them to the sink so-called an isolated base station by single-hop [10] [11] or multi-hop communication [12] [13] [14]. LEACH [15] [16] and FCM [17] [18] are under this clustering based protocol. The main objective of this protocol is to maximize the lifetime of the network. PSO, WOA, Salp swarm algorithm are used in node localization in wireless sensor networks and maximizing their lifetime [19] [20] [21].

A variety of challenges are persisted over the network features in terms of the sensor network model [22]. Some of the characteristics are enormous and random employment, dynamic and undependable environment, restricted battery capacity, and restricted hardware resources. Many researchers found the data transmission from one sensor node to another sensor node as the major challenge in WSN [23] [24] [25]. On comparing the single-path routing [26] with the multi-path routing, the retransmission in a single path guarantees an eligible delivery whereas the multipath offer a delay by neglecting the retransmission. Though it poses two main limitations like (a) significant energy loss persists in sending the packet over multiple paths; (b) more channel contentions and interference are introduced because of the use of multiple paths [27] [28] that can maximize the delay in delivery and also provides transmission malfunction. The primary concern in data gathering and sensing is cost-effectiveness. Limited power and energy are existed because of the compactness of Wireless SNs and hence require the effective and efficient utilization of energy in WSN. The optimization methods have undergone diverse development in terms of many factors [29] [30] [31] [32] [33] [34].

This paper intends to perform an analysis over the implemented FCR and FCGWO models in terms of alive nodes, energy efficiency, and network lifetime under three distributions function namely Uniform, Normal, and Gamma distributions. Section II explains the literature review. The selection of Cluster Head in WSN is described briefly in Section III. Section IV defines the proposed FCR and FCGWO model for optimal cluster head selection. The results and discussion are explained in Section V Section VI concludes the paper.

2 Literature review

2.1 Related works

Khan et al. [35] have proposed a technique based on the multi-criteria decision making named Fuzzy-TOPSIS. This was for choosing the CHs effectively and efficiently to enlarge the WSN life expectancy. Further numerous criteria like distance from the sink, node energy consumption rate, and average distance between neighboring nodes, residual energy, and several neighbor nodes were also considered. The consumption of energy was minimized by the threshold-based multi-hop communication mechanism namely inter-cluster and intra-cluster multi-hop. To investigate the impact on WSN lifetime, the analysis of different types of mobility strategies and, the impact of node density was made. Moreover, the octagonal trajectory of predictable mobility was developed to increase the load distribution. Hence, the overall lifetime and latency of the network were improved. The investigation has resulted in the improvement over the proposed model in terms of 80% energy prevention, a 25% considerable decrease in frequent CH per round selection, and network lifetime by 60%, when compared over the other traditional LEACH and Fuzzy protocols.

Rajeev and Dilip [36] have paid attention to the improvement of lifetime and energy stabilization in WSN through the CHS model by deploying the ABC algorithm. In this, the multi-objective FABC algorithm was assumed as the hybridization technique for managing the convergence rate. The major concern of this research work was focused on the delay in packet transmission, energy consumption, and node’s distance. Moreover, the developed FABC-based CHSs performance has proved the perseverance of life expectancy and maximized energy of sensor nodes in WSN, while comparing with the conventional protocols.

Panag and Dhillon [37] have implemented a narrative algorithm called DHSCA for increasing the WSN life expectancy and for equalizing the energy consumption by the sensor nodes. The nodes avoid the cluster reformation’s overhead in dynamic clustering, as well as based on the location, the static clusters were categorized. Based on the residual energy and the space from the sink, the selection was made as two nodes from each cluster. The cluster has the other nodes were chosen to be as CHs, they are each for data transmission and data aggregation. The energy consumption during the inter-cluster and intra-cluster communication was getting reduced by this. To avoid the hot-spot problem, the multi-hop technique was deployed for transmitting the data over the sink. The simulation has explained the DHSCA delivers the fraction of the packet successfully, as wells as reduces the energy consumption patterns. This leads to an enhancement in energy consumption equalization that sequentially improves the network lifetime. The proposed algorithm provides the betterment over the other methods.

Albert et al. [38] have introduced the algorithmic network method with redundancy. It also enhanced the transmission reliability in the data traffic system. By using the WSN, the designing of an automatic system and the quicker prototyping was made. Moreover, to amplify the small duration optimal solution, the mixed-integer program integrated along with polynomial-time heuristic was deployed.

Amuthan and Arulmurugan [39] have presented a technique called HRFCHE based on the energy and trust assessment incorporated calculation scheme to improve the network lifetime. The result that obtained provides a betterment of energy consumption by minimizing it by 34% and enlarges 28% of the network life expectancy while comparing over the other CHS schemes.

Zhao et al. [40] had dealt with providing the optimal routing in WSN by using the method called GSTEB that was based on the tree process. Here, a root node was provided to the base station, and the initial transmission was made over the entire node numbers during every single round. Further, the delay was made over the data transmission that will direct to disperse more energy. Furthermore, this model reduces the energy consumption and also balances the whole load of WSN.

Mahajan et al. [41] have conferred the CCWM approach that was known for the CH weight selection method. In the overall network, the service parameters were considered while enhancement. One of the major problems in the clustering-based approach was the formation of the balanced clusters and selecting the suitable CHs in the network. The cluster formation was carried out after selecting the CHs based on the weight metric from the network. In this, the energy was conserved as well as the load was balanced. The implemented model outcome was compared over the other models like WCA, IWCA, and LEACH, and outperforms result was obtained.

Cheng et al. [42] had developed the QoS routing. A narrative routing scheme called QoS-aware geographic opportunistic approach was implemented for the provisioning of QoS in WSN. In terms of latency, the proposed model achieves the priority set. Furthermore, by contrasting the proposed model with traditional schemes like multipath routing, the performance analysis was made.

C. Vimalarani et al. [43] the network performance of the WSNs is enhanced by PSO-based clustering and CH scheme algorithms by increasing the throughput, packet delivery ratio, residual energy, and number of active nodes. Cluster is centralized and the CH is enhanced by PSO. Based on the threshold value data are sensed from the sensor node.

Shankar thangavelu et al. [44] WOA, helps in energy selection in which CHs based on a fitness function which considers the residual energy of the node’s and the sum of energy of adjacent nodes. The parameters like network lifetime, energy efficiency, throughput and overall stability are measured.

2.2 Review

Even though the optimal CHS is good at various fields in WSN, but still it lacks some features that are to be rectified for future works. Some of the other features and challenges in the CHS models are given in Table 1. Fuzzy-TOPSIS [35] reduced energy consumption and redundancy is removed. Still, it has the limitations in dealing with the vagueness needs improvement and it is cost-effective in data sensing and gathering. Multi-objective fractional ABE [36] has provided maximum energy and has maximized the lifetime of the node. The main drawback of this is power resources are limited and requires careful analysis for efficient use of energy. DHSCA [37] has reduced overhead and increased WSN lifetime, whereas some of the limitations are needs balance in additional functionality and needs enhancement in a stability period. A mixed-integer linear program [38] has better functional correction and robustness and also optimizes power consumption. Network resiliency is needed for further tuning and improvement needs in network lifetime. These are the major challenge in this methodology. HRFCHE [39] has a minimized average delay and also has reduced total energy consumption. Selfishness has taken into consideration to quantify the transition behavior and transition probabilities are not normalized. GSTEB [40] has consumed a small amount of energy and the transmission delay gets reduced. However, some of the disadvantages are the requirement of improvement over the throughput and bandwidth is limited. CCWM [41] has reduced energy consumption and netter load distribution. Yet poses the limitations like Scalability has to be enhanced and the Improvement over Quality of Service is needed. EQGOR protocol [42] has resulted in very low time complexity and has better efficacy in QoS provisioning. The major drawback of this includes the essential requirement of Communication and computation and Power failure in the system cause change in topology. PSO [43] has an advantage of computational time is less and lifetime of the network is increased, it has a drawback of convergence rate is low. WOA [44] is a simple method and robust is good, it requires less parameter only. Drawback of this method is poor in space search.

Table 1 Features and challenges in state-of-the-art for optimal cluster head selection in WSN

3 Selection of cluster head in WSN

3.1 Network model

Several sensor nodes (\(Nb_{N}\)) are subsisted in WSN, in which every sensor nodes are in a stationary state and have their equal capability. The node may act as an active sensor as well as CH during the transmission of data. Generally, the WSN model connects data sensing, radio communication, topology features, energy consumption, and sensor allotment. The sensor is placed either manually or in a random manner within an application area. In WSN, the CHS model with the centralized base station and several sensor nodes is shown in Fig. 1. Clustering is defined as the process in which a set of sensor nodes are gathered. This is the prominent model for extending the WSN lifetime. Here, the choosing of CH is made and the count of CH is represented as \(Nb_{c}\). This type of CHS pattern is made for the entire count of clusters. In a particular cluster, the formation of the node is based on CH with a lower distance. The entire sensor nodes gather this data from the target region and then it is transformed into the CH at the time of operation.

Fig. 1
figure 1

A Network Model for WSN’s cluster head selection

The main issue in WSN is data transmission from one node to another. Therefore, the presentation of data transmission is made better by applying the shortest path selection. Another extremely critical problem is the consumption of energy by every node. Thus, the information distribution is the major complication that possesses the minimized energy and smallest length. Various researchers implement several advanced routing protocols for data packet partaking among the nodes and the base station. The main problem is on the selection of optimal CH with regards to position and energy. In fact for transferring the huge quantity of data, the node requires more consumption of energy. Appropriate selection of CH reduces the energy consumption and so, the information transmission can be increased. In WSN, Battery consumption is the main problem. The energy consumption model reduces energy in different operations such as transmission, reception, sensing, and aggregation. Therefore, the CH selection of nodes should help in better positioning in terms of the relational sensor nodes with minimized energy consumption. There is a high responsibility for the distance and energy consumption almost in all optimization algorithms while taking decision CH selection. Hence, multiple objectives are required for improving the node’s life expectancy. Finally, the energy, distance, and delay are the major parameters that have to be taken into consideration while selecting the CH from the collection of sensor nodes.

3.2 Distance model

Primarily, the advertisement message is transferred for declaring the act of the CH. The entire CHs that are within the network carried out the message transmission, because the WSN follows cluster-based data transmission here. In other words, the data transmission is performed by the CH on behalf of the nodes that are within the cluster [45]. The measurement of the exact distance is made from the CH using every single SN in the network. The node is said to belong to the particular cluster on the condition in which the distance from the CH of that cluster is low. Furthermore, the message is transferred to the consequent CH. In contrast, the transferring of the message is done straight to the base station by the sensor nodes, when the CH and node distance is larger than the base station and node distance. The cluster formation is based on the calculation of nearby distance. By using the distance matrix \(M(p*q)\), the node with the selected CH is reclustered in the network and is given in Eq. (1). Here, the normal node and the CHs Euclidian distance is denoted by \(dis_{{Nb_{c} }}\), and the sensor nodes are defined by \(y_{1} ,y_{2} ,....y_{n}\). Let the two sensor nodes be \(e\)(cluster node) and \(z\)(normal node) and \(\hat{i},\hat{j}\) are their positions, correspondingly. The Eq. (2) provides the corresponding Euclidian distance.

$$M(p*q) = \left[ \begin{gathered} dis_{{Nb_{c1} ,y_{1} }} dis_{{Nb_{c1} ,y_{2} }} .........dis_{{Nb_{c1} ,y_{q} }} \hfill \\ dis_{{Nb_{c2} ,y_{1} }} dis_{{Nb_{c2} ,y_{2} }} .........dis_{{Nb_{c2} ,y_{q} }} \hfill \\ : \hfill \\ : \hfill \\ dis_{{Nb_{cp} ,y_{1} }} dis_{{Nb_{cp} ,y_{2} }} ..........dis_{{Nb_{cp} ,y_{q} }} \hfill \\ \end{gathered} \right]$$
(1)
$$dis_{e,z} = \sqrt {(e_{{\hat{i}}} - z_{{\hat{i}}} )^{2} + (e_{{\hat{j}}} - z_{{\hat{j}}} )^{2} }$$
(2)

The Eq. (1) shows the distance matrix. Here each element represents \(e^{th}\) and \(z^{th}\) CHs distance. The column made the respective link with the corresponding one, which uses the least value in the matrix point. Let,\(dis_{{Nb_{c1} ,y_{1} }}\) is the element that occupies the matrix initial column with minimum distance then the relation is made among the node \(y_{1}\) and CH \(Nb_{c2}\).

Further, \(Nb_{c}\) is assigned a time slot to every sensor node in the data transmission. The gathering of transferred data from the entire sensor node in the cluster is the major task of every \(Nb_{c}\). The \(Nb_{c}\) transfers the relevant data that is received from the entire sensor node within the particular cluster to the base station or sink. When \(Nb_{c}\) is inactive position, the sensor node from one instant to another continues to be in sleep mode. The re clustering and data transmission function continue up to the number of cycles until the entire sensor node reaches the dead state. Based on the distance among the receiver a transmitter, the two channels are utilized so-called multipath fading and free-space channels. The free space channel is exploited, when the assured threshold value allots a larger value than the distance. The multipath fading channel quite the reverse uses the fewer thresholds. The threshold distance is given as per the Eq. (3), here, the energy required while utilizing the open space model is symbolized as \(Eg_{fr}\) and the power amplifier’s energy is represented as \(Eg_{pa}\).

$$dis_{0} = \frac{{Eg_{fr} }}{{Eg_{pa} }}$$
(3)

3.3 Energy model

In WSN, energy consumption is a major problem. Actually in WSN, the recharge option is not available for the battery that is used in this, which means once the battery gets depleted the WSN cannot get the power supply.. Basically, the data transmission needs more energy while transmitting the information to the BS (base station) from the entire sensor nodes. Therefore, sensing, transmission, aggregation, and reception are the different operational performances that consume more energy in the network. Hence, the energy required for the transmission of data is deployed in Eq. (4). Here, for transmitting the total consumed energy, \(P\) bytes of packets at a distance \(d\) is denoted as \(E_{TD} (P:dis)\) and \(E_{et}\) represents the electronic energy based on the diverse factor that involves filtering, digital coding, spreading, and so on. The formulation of electronic energy is expressed in Eq. (5), where the data aggregation energy is indicated by \(E_{ag}\)

$$E_{TD} (P:dis) = \left\{ \begin{gathered} E_{et} *P + E_{fr} *P*dis^{2} ,if\,\,dis < dis_{0} \hfill \\ E_{et} *P + E_{pa} *P*dis^{2} ,if\,\,dis \ge dis_{0} \hfill \\ \end{gathered} \right.$$
(4)
$$E_{et} = E_{TD} + E_{ag}$$
(5)

The total energy consumed for receiving the \(P\) bytes of packets at a distance \(dis\) is given as per Eq. (6). Moreover, Eq. (7) denotes the energy required for the amplification purpose.

$$E_{RD} (P:dis) = E_{et} P$$
(6)
$$E_{ap} = E_{fr} dis^{2}$$
(7)

Equation (8) provides the network’s overall energy consumption. The required energy during the idle state is expressed by \(E_{1}\) and the energy cost during sensing is given as \(E_{Sen}\). It is essential to minimize the overall energy consumption are provided in Eq. (8).

$$E_{total} = E_{TD} + E_{RD} + E_{1} + E_{Sen}$$
(8)

4 Proposed FCR And FCGWO model for optimal cluster head selection

4.1 Objective function

The CHS core motive:

The objective function of this algorithm is to select the CH optimally by stabilization of energy, minimization of node’s distance and convergence analysis are better when compared to other optimization methods like GA, GSO, ABC, FABC, Firefly, GWO, PSO, ABC-ACO, OBC-WOA [25] [46].

The distance between the selected CH, the node, and the data transmitting delay from one node to another node should be low. The network energy should be high, (i.e.) the energy consumption should be low while transmitting data.

CH-selection is an optimization and leads to the NP-hard problem as the selection of m CHs in n sensor nodes gives n possibilities and when the network size increases computational complexity varies exponentially. Also for n sensor nodes and m CHs, if every sensor node has an average p CHs then have to assign as pn. Therefore, the computational complexity of n sensor node to m CHs is also varied exponentially [36].

As a result, the proposed cluster selection’s objective function is expressed as per the Eq. (9), where \(f_{b}\) and \(f_{d}\) is defined in Eq. (10 and 11) and the \(\beta\) value should be in the range \(0 < \beta < 1\).\(\sigma_{1}\), \(\sigma_{2}\) and \(\sigma_{3}\) denotes the distance, energy, and delay so-called constraint parameters. This parameter condition is \(\sigma_{1} + \sigma_{2} + \sigma_{3} = 1\). The distance among the normal node and sink is represented by \(Z^{x} - F_{s}\).

$$Fun_{q} = \beta f_{d} + (1 - \beta )f_{b}$$
(9)
$$f_{b} = \sigma_{1} *f_{l}^{dis} + \sigma_{2} *f_{l}^{ene} + \sigma_{3} *f_{l}^{del}$$
(10)
$$f_{d} = \frac{1}{q}\sum\limits_{x = 1}^{q} {\left\| {Z^{x} - F_{s} } \right\|}$$
(11)

The fitness function for distance is given in Eq. (12). Here, \(f_{(b)}^{dis}\) is related to the packet transmission to the CH from the normal node then to the base station from the CH. The \(f_{l}^{dis}\) value lies in the range of 0 to 1. When the distance among the normal node and the CH is high, then the value of \(f_{l}^{dis}\) also becomes high.

$$f_{l}^{dis} = \frac{{f_{(b)}^{dis} }}{{f_{(d)}^{dis} }}$$
(12)
$$f_{(b)}^{dis} = \sum\limits_{i = 1}^{{N_{i} }} {\left[ {\left\| {H_{i} - F_{s} } \right\| + \sum\limits_{j = 1}^{{N_{j} }} {\left\| {H_{i} - Z_{i} } \right\|} } \right]}$$
(13)
$$f_{(d)}^{dis} = \sum\limits_{i = 1}^{{N_{i} }} {\sum\limits_{j = 1}^{{N_{j} }} {\left\| {Z_{i} - Z_{j} } \right\|} }$$
(14)

The Eq. (13 and 14) represent the formulation of \(f_{(b)}^{dis}\) and \(f_{(d)}^{dis}\), respectively. The CH of \(i^{th}\) cluster is denoted by \(H_{i}\), the normal node that belongs to \(i^{th}\) cluster is indicated by \(Z_{i}\). The distance between the CH and base station is given as \(H_{i} - F_{s}\). The distance between the CH and normal node is represented as \(H_{i} - Z_{i}\). The distance between the two normal nodes is shown as \(Z_{i} - Z_{j}\). The count of the node that don’t belong to the \(i^{th}\) and \(j^{th}\) cluster is represented by \(N_{i}\) and \(N_{j}\).

The energy’s fitness function is defined in Eq. (15). When the entire CH cumulative \(f_{(b)}^{ene}\) and \(f_{(d)}^{ene}\) presume energy with increased value and the increased count on CH. This makes the \(f_{l}^{ene}\) value becomes higher than one.

$$f_{l}^{ene} = \frac{{f_{(b)}^{ene} }}{{f_{(d)}^{ene} }}$$
(15)

The fitness function of delay is given in Eq. (16) and the entire number of nodes, which belongs to the cluster, is directly proportional. Hence, the delay becomes low when the cluster consists of only an adequate number of nodes. The delay is reduced by taking the maximum number of clusters as per the Eq. (16). The entire number of nodes is indicated as \(Nb_{N}\).

$$f_{l}^{del} = \frac{{\mathop {\max \left( {\left\| {H_{i} - Z_{i} } \right\|} \right)}\nolimits_{i = 1}^{{Nb_{c} }} }}{{Nb_{N} }}$$
(16)

The \(f_{l}^{del}\) value lies in the range of 0 to 1.

figure a

4.2 Firefly with cyclic randomization

The proposed FCR approach is varied over the original firefly algorithm. The conventional firefly algorithm is replaced by the proposed FCR model by using the conditions that are provided in the pseudo-code in Algorithm 1. The proposed firefly algorithm’s pseudo-code is shown as follows:

The proposed FCR updated model is provided in Eq. (20). Here, impulse and step function with binary logic is given as \(\psi_{1} \left( h \right)\) and \(\phi_{1} \left( h \right)\), correspondingly. The impulsive function \(\psi_{1} \left( h \right)\) triggers the positive logic and is obtained first by the \(\phi_{1} \left( h \right)\), hence persuades the property 1. On the basis of the greedy function \(G\left( {m_{u}^{rand} \left( h \right)} \right) = In^{best} - In\left( {m_{u}^{rand} \left( h \right)} \right)\) the binary zero or one is obtained by the \(\phi_{1} \left( h \right)\) step function and is presented in Eq. (18). By Eq. (18), the estimation of the selected parameter \(\rho\) is performed as per the Eq. (20) and the solution set that created randomly is given as \(m_{u}^{rand} \left( h \right)\).

Property 1

The sum of \(\psi_{1} \left( h \right)\forall h\) excluding \(\psi_{1} \left( {h_{1} } \right):h_{1} \in \left[ {1,N_{flies} } \right]\) becomes zero, when \(\phi_{1} \left( {h_{1} } \right)\) equals one and the sum of \(\phi_{1} \left( {h_{2} } \right):1 \le h_{2} \le h_{1} - 1\) remains zero.

Property 2

The product of \(\psi_{1} \left( h \right)\) and \(\phi_{1} \left( h \right)\) equals \(\psi_{1} \left( h \right)\).

Property 3

Based on the property 1, the sum of \(\phi_{1} \left( {h_{3} } \right):1 \le h_{3} \le h_{1}\) equals zero and therefore, the sum of \(\psi_{1} \left( {h_{3} } \right)\) left as zero.

Lemma 1

\(x_{u}\) maintains \(x_{u}^{FF}\) on condition of no capable random solutions, in which the cyclic randomization function is determined.

Proof:

In the random cyclic process of \(N_{flies}\), when there is no promising solution is determined means the greedy search functions fails that is \(\phi_{1} \left( h \right) = 0\). In this case, \(\psi_{1} \left( h \right)\) can’t be triggered and therefore \(\sum\limits_{h = 1}^{{N_{flies} }} {\psi_{1} \left( h \right)} = 0\) that means \(\rho = 0\), while \(x_{u}^{FF}\) is engaged back to \(x_{u}\) as the updated solution.

$$m_{r} = m_{r} + \beta_{0} e^{{ - wb_{r,u}^{2} }} (m_{u} - m_{r} ) + \alpha \varepsilon$$
(17)
$$\rho = \sum\limits_{h = 1}^{{N_{flies} }} {\psi_{1} \left( h \right)}$$
(18)
$$\phi_{1} \left( h \right) = \left\{ {\begin{array}{*{20}c} {1;\,\,if\,G\left( {m_{u}^{rand} \left( h \right)} \right) > 0} \\ {0;\,\,otherwise} \\ \end{array} } \right.$$
(19)
$$m_{u} = \left( {1 - \rho } \right)m_{u}^{FF} + \rho \sum\limits_{h = 1}^{{N_{flies} }} {\phi_{1} \left( h \right)\psi_{1} \left( h \right)m_{u}^{rand} \left( h \right)}$$
(20)

The implementation of the proposed model is by the following steps:

  1. (1)

    Initialize\(S\) particle for holding randomly chosen eligible CH

  2. (2)

    Estimate the cost function for the initialized particle and is given by some basic steps

    1. (a)

      For each node \(N_{r}\), \(r = 1,2.....N\)

      (i) Calculate the distance \(dis(N,Nb_{c,h} )\) among the node and all the CHs \(N_{e,h}\) and (ii) set \(N_{e}\) node to the CH \(Nb_{c,h}\) while the distance have o be minimum so that \(dis(N_{r} ,Nb_{c,h} ) = \min \{ (N_{r} ,Nb_{c,h} )\}\),\(h = 1,2,3....n\).

    (b) Using Eq. (9) specify the cost function. The calculation of the cost function from the prime population is made and the best pool \((In_{best} )\) is taken from the obtained value i.e. maximum.

  3. (3)

    Update the population by the Eq. (19) and calculate the total fireflies’ intensity and cost function.

  4. (4)

    In the case of achieving greater value of updated intensity than the \((In_{best} )\) best pool, then the primary firefly is replaced by the updated firefly and visit step (7).

  5. (5)

    In the case of attaining less updated intensity than the \((In_{best} )\) best pool, then the function of the best solution is changed randomly and lastly the intensity is found.

  6. (6)

    Then iteration of (4) and (5) is made for \(N_{flies}\) cycles

  7. (7)

    Access the newest solution and the light intensity is found as steps (1–6)

  8. (8)

    The fireflies attraction is on the basis of the distance

  9. (9)

    The ranking of fireflies are made to spot out the best light.

  10. (10)

    Repeat the steps till it reaches the maximum count of iteration.

4.3 Firefly cyclic grey wolf optimization

This is the second proposed algorithm for selecting the optimal CH that incorporates GWO within the FF algorithm. Generally, one of the prominent meta-heuristic algorithms is the FF algorithm, which is related to the flashing activity of fireflies’. Based on the fireflies’ brightness, the best position of all the particles are found, which is the major objective of the firefly algorithm. In this, the entire fireflies are assumed to be unisex. Further, the attractiveness of fireflies and its brightness is directly proportional and the firefly’s attractiveness gets reduce as per the increase in distance. The light intensity function is given in Eq. (21), here the average absorption coefficient is denotes as \(\gamma\) and \(di\) indicates the fireflies’ distance. The resource that discharges the light intensity is represented by \(In_{s}\).

$$In = In_{s} \exp (\gamma di^{2} )$$
(21)

The attractiveness and brightness are directly proportional and is mentioned above is given by Eq. (22).

$$\beta = \beta_{0} \exp ( - \gamma di^{m} )$$
(22)

Equation (23) explains the distance among the \(k^{th}\) Firefly to the \(v^{th}\) Firefly, where the count of dimension is given as \(t\) and the \(o^{th}\) constituent of the spatial coordinate \(n_{k}\) that is associated with the \(k^{th}\) Firefly is indicated as \(n_{k,o}\).

$$di_{k,v} = \sqrt {\sum\nolimits_{o = 1}^{t} {(n_{k,o} } - x_{v,o} )^{2} }$$
(23)

The movement of the fireflies because of the attractiveness is given in Eq. (24). In this, specification of the attractiveness pattern is by initial term and the specification of the randomization parameter by the next term.

$$n_{k + 1} = n_{k} + \beta_{0} e^{{ - \gamma di_{k,v}^{2} }} (n_{v} - n_{k} ) + \alpha \varepsilon$$
(24)

Though in the firefly algorithm, minimal attributes are reduced from large data dimensions and also hold the noise and ambiguity, yet it poses some limitations like unchanged parameters over time, handles low memory space, and trapping in several local optima. Due to this drawback, the FF algorithm is substituted by the GWO algorithm. The pseudo-code for this proposed algorithm is given in Algorithm 2. In this, the fireflies and grey wolves’ populations are represented as total clusters (involves entire SNs), from here the selection of the CH is made.

figure b

The proposed FCGWO description based on the CHS is given as follows:

  1. 1.

    Initialize the variable solution as \(X_{k}\) where \(\left( {k = 1,2....n} \right)\) and \(W = 2a.r^{1} - a\),\(L = 2r^{2}\).

  2. 2.

    Calculate the light intensity \(In\) of \(X_{k}\) and also determines the absorption coefficient of light \(\gamma\).

  3. 3.

    If \((In_{v} > In_{k} )\), the \(k^{th}\) firefly moves towards the \(v^{th}\) firefly by Eq. (24).

  4. 4.

    If \((In_{v} < In_{k} )\), use the GWO principle for updating the fireflies position.

    1. (1)

      Initialize the components \(a\), \(W\) and \(L\).

    2. (2)

      The determination of the fitness of each search agent is made and the best search agent is assigned.

    3. (3)

      Update the present search agent’s position by the conventional update equation.

    4. (4)

      Update the components \(a\), \(W\) and \(L\) also update the \(X_{\alpha }\), \(X_{\beta }\) and \(X_{\delta }\) after the result of total search agent’s fitness function.

  5. 5.

    The ranking pattern is adopted to identify the present best firefly.

  6. 6.

    Repeat the steps until it reaches the maximum count of iteration.

This paper makes an analysis of both these FCR and FCGWO for the selection of CH in WSN. The randomly created solution in this algorithm is found based on the three distribution functions like Uniform, Normal, and Gamma distributions. The analysis result is given in the subsequent section.

5 Results and discussion

5.1 Simulation setup

The simulation of both proposed model FCR and FCGWO is evaluated in MATLAB 2017. In WSN, the total number of nodes is assigned to be \(Nb_{N}\) that are dispersed in the region, where the BS is situated at the centre. The particular stimulation is taken place in 0 to 2000 rounds. The result is made by performing the experimentation as per [36]. The initial energy \(E_{i}\) is assigned as 0.5 J and the energy of the power amplifier \(E_{pa}\) is assigned to \(10pJ/bit/m^{2}\). Furthermore, \(50nJ/bit/m^{2}\) is provided by the transmitter energy \(E_{TD}\) and \(5nJ/bit/signal\) is offered by the data aggregation energy. All the sensor nodes are provided with the equal amount of initial energy. In each round, the node consumes energy for the transmission of data according to the energy model that are given in Eqs. (48). The transmission round gets completed, when any of the selected CH lose all its energy. Meantime, the consumed energy is also lost by each node. The process is repeated with the residual energy of each node based on which the CHs are selected for the next round. This process continues till there is no option to select the CH, i.e. number of alive nodes is lesser or equal to the number of CHs to be selected. The analysis is made over the proposed FCR and FCGWO models regarding three distributions namely Uniform, Normal and Gamma distributions in terms of alive nodes, network lifetime, and energy efficiency.

5.2 Alive node analysis

The analysis of alive nodes is computed to the three distributions is illustrated in Fig. 2. In the proposed FCR model, the analysis of distributions is made under cyclic distribution \(N_{flies}\), whereas in the proposed FCGWO model, the same analysis is performed under random vectors \(r^{1}\) and \(r^{2}\). The alive node analysis to the number of rounds of both the proposed model is given in Fig. 2a and b. For the round 1000, the proposed FCR model in terms of uniform distribution attains 68 alive nodes, whereas the proposed FCGWO model achieves 56 alive nodes. The proposed FCR model with respect to normal distribution accomplishes 60 alive nodes, while the proposed FCGWO model obtains 58 alive nodes in the round 1000. In terms of the gamma distribution, the FCR model and FCGWO model attains 58 and 59 alive nodes, respectively. Fig 2c and d explain both the proposed model FCR and FCGWO analysis on alive nodes to distance. At distance 20, the uniform distribution of the proposed FCR and FCGWO model accomplish 4 and 4.35 alive nodes, respectively. Both the proposed model FCR and FCGWO models in terms of normal distribution at distance 20 obtain 20 alive nodes. For gamma distribution, the proposed FCR and FCGWO models achieve 4.35 and 4.38, respectively.

Fig. 2
figure 2

Alive node analysis in terms of three distribution a FCR analysis with respect to the number of rounds, b FCGWO analysis with respect to the number of rounds, c FCR analysis with respect to distance, dFCGWO analysis with respect to distance

5.3 Convergence analysis

The convergence analysis of the proposed FCR and FCGWO model in terms of three distributions is represented in Fig. 3. At 2nd iteration, the convergence analysis with respect to the uniform distribution of the proposed model FCR attains 300 cost functions, while the proposed FCGWO model achieves the cost function of 294. At 4th iteration, the proposed model FCR in terms of uniform distribution achieves 308 as cost function, whereas the implemented FCGWO model accomplishes the cost function of 294. In the normal distribution, the convergence analysis at 2nd iteration for the proposed FCR model provides the cost function of 287 and the proposed FCGWO model accomplishes the cost function of 295. Further, at 4th iteration, the proposed model FCR gains the cost function of 315 and the implemented model FCGWO achieves the cost function of 295. In gamma distribution, the implemented FCR and FCGWO models at 2nd iteration achieve the cost function as 275 and 340, respectively. At 4th iteration, the proposed FCR model attains the cost function as 380, whereas the implemented FCGWO model obtains the cost function as 340.

Fig. 3
figure 3

Convergence analysis with respect to three distributions, a FCR model, b FCGWO model

5.4 Normalized network energy analysis

Figure 4 demonstrates the normalized network energy analysis in terms of three distributions. In Fig. 4a and b, the proposed model FCR in terms of three distribution is on the rise for the distance 2 as 0.1125, then for the distance 3 as 0.1585, and the distance 4 as 0.2. After the distance 4, the normalized network energy attains the maximum distance of 0.5765. Similarly, for the implemented model FCGWO, the three distributions are on the raise up to distance 4 and is attained 0.113, 0.159 and, 0.215 for distance 2, 3 and, 4 respectively. Subsequently, it increases rapidly and achieves 0.5815. Thus, proves that both the models are rising to the peak network energy at various distances.

Fig. 4
figure 4

Normalized Network Energy analysis in terms of three distribution, a FCR analysis with respect to distance, b FCGWO analysis with respect to distance, c FCR analysis with respect to the number of rounds, d FCGWO analysis with respect to the number of rounds

5.5 Comparision results

5.5.1 Alive node analysis

Figure 5 shows the alive node analysis, in Fig. 5a Initially the nodes starts with less amount of energy and gradually increases for FCR and FCGWO comparing to GA, GSO, ABC, FABC, Firefly, GWO, PSO, ABC-ACO,OBC-WOA. In Fig. 5b at distance 20, the proposed FCR and FCGWO model accomplish 4 and 4.35 alive nodes, respectively.

Fig. 5
figure 5

Alive node analysis a GA, GSO, ABC, FABC, Firefly, GWO, PSO, ABC-ACO, OBC-WOA, FCR, FCGWO analysis with respect to the number of rounds, b GA, GSO, ABC, FABC, Firefly, GWO, PSO, ABC-ACO, OBC-WOA, FCR, FCGWO analysis with respect to distance

5.5.2 Convergence analysis

Figure 6 shows the convergence analysis of GA, GSO, ABC, FABC, Firefly, GWO, PSO, ABC-ACO, OBC-WOA, FCR, FCGWO model. At 5th iteration, FCR achieves cost function of 350, FCGWO achieves the cost function of 400. For 10th iteration FCR achieves cost function of 380, FCGWO achieves the cost function of 370. Other conventional methods have less cost function than proposed methods.

Fig. 6
figure 6

Convergence analysis of GA, GSO, ABC, FABC, Firefly, GWO, PSO, ABC-ACO, OBC-WOA, FCR, FCGWO model

5.5.3 Normalized network energy analysis

Figure 7 shows the normalized energy analysis of GA, GSO, ABC, FABC, Firefly, GWO, PSO, ABC-ACO, OBC-WOA, FCR, and FCGWO. In this the proposed model FCR and FCGWO is on the rise for the distance 4, it increases rapidly and achieves 0.5815 while other models achieves less than proposed methods.

Fig. 7
figure 7

Normalized Network Energy analysis of GA, GSO, ABC, FABC, Firefly, GWO, PSO, ABC-ACO, OBC-WOA,FCR, FCGWO, a model with respect to distance, b Normalized Network Energy analysis with respect to the number of rounds

Therefore by comparing the performance of GA, GSO, ABC, FABC, Firefly, GWO, PSO, ABC-ACO, OBC-WOA with FCR and FCGWO, the proposed method produces better results.

6 Conclusion

The main objective of this proposed system is to analyze the FCR and FCGWO models for choosing the CH in WSN. By using the three distribution functions namely Uniform, Normal, and Gamma distributions, the randomly created solution is determined. Convergences analysis with respect to three distributions for the FCR model and FCGWO model were discussed. Normalized network energy analysis in terms of three distributions are also drawn. The performance analysis of alive node analysis, convergence analysis and normalized network energy analysis of GA, GSO, ABC, FABC, Firefly, GWO, PSO, ABC-ACO, OBC-WOA with FCR and FCGWO were discussed. From this result we can say that proposed method produces better results than conventional methods. Further, the analysis is made with respect to alive nodes, network lifetime, and energy efficiency under three distributions. The simulation analysis was made for the three distribution functions and from the result, it was observed that for the round 1000, the proposed FCR model in terms of uniform distribution had attained 68 alive nodes, whereas the proposed FCGWO model had achieved 56 alive nodes. The proposed FCR model for normal distribution had accomplished 60 alive nodes, while the proposed FCGWO model had obtained 58 alive nodes in the round 1000. In terms of the gamma distribution, the FCR model and FCGWO model had attained 58 and 59 alive nodes, respectively [47], [48], [49], [50], [51], [52], [53].