1 Introduction

In the wireless sensor network (WSN) architecture formation process, the tiny autonomous sensors are deployed in random or ad-hoc fashion, afterwards, connected wirelessly. Inside the area of interest the tiny autonomous sensors mutually cooperate with one another and transmits data to base station (BS). Through considering the virtue of recent innovation in microelectronics and communication technology, low cost sensors are easily obtainable and as a outcome WSNs have been invoked to various applications like military, health, environmental monitoring etc. (Akyildiz et al. 2002).

Furthermore, functioning of every sensors depends on energy power which is obtained from equipped battery within it, which is the only source to acquire power. In most of the applications of WSNs, sensor nodes are deployed in hostile environment. Hence, the replacement of batteries of the sensors is almost impossible, which causes the sensors die after dissipation of energy. As a result, one of the primary research issues for the WSN community is energy preservation of sensors. In WSNs, various techniques are devised by instigators and found to be very efficient for saving the energy of sensors, out of them clustering and routing suggested by them (Abbasi and Younis 2007). Investigators make the division of WSN into multiple connected units, known as clusters, this phenomenon is called clustering. In each division, a leader node gets elected using the essential parameters called as cluster head (CH). In data collection and forwarding process, CHs are accountable to receives the local data from its own division i.e., clusters. In the routing process, this data to be send to a BS directly or through other CHs depend on the developed routing path. Hence, CH selection, cluster forming, and routing, all has been proved to be an energy preserving techniques (Abbasi and Younis 2007), therefore, play an important role for extending lifetime of network.

1.1 Hot-spot problem description

In the WSN architecture, cluster heads (CHs) receives the local data within its division member of sensor nodes as well as from connected CHs. Thereafter, this data to the transmitted to the BS through the searched path using the routing technique. In this complete cycle, CHs nearby BS filled with massive relay traffic, it may results, die very quickly. As a outcome, network division is also referred as a hot-spot problem emerged. In order to counter the problem, a strategical clustering and routing algorithms based on harris hawk optimization (HHO) technique have been proposed in this research article. The functionality of routing based unequal clustering for WSN is shown graphically in Fig. 1.

Illustration of Fig. 1: it can be elucidated that clusters are formed according to the network condition such that small size clusters are formed nearby BS due to the massive relay traffic, whereas, larger size clusters are formed far away from the BS location due to the less traffic. Since, all the nodes are homogeneous in the proposed work, for the sake of differentiating only normal sensors and CHs, we use different images as shown in Fig. 1.

Fig. 1
figure 1

Unequal clustered based routing

1.2 Complexity of clustering and routing mechanism

In CH selection process, m CHs among n sensors have been chosen, the possible instances for the CH selection can be expressed as \(^nC_m\). If the network size is small, then problem can be solvable, but, it becomes NP-complete for the scalable networks (Rao and Banka 2017a). In the routing process, number of instances can be expressed as \(l^m\) (Rao and Banka 2017b), if the m CHs having l an average next hop relay nodes. Similarly, routing problem also becomes NP-Complete for the networks (Rao and Banka 2017b). Both of the aforementioned cases, brute force approaches are not able to capture the solution, as mentioned with the scalable network; the growth of complexity is exponential. Harris hawk optimization ( Heidari et al. 2019), is one among the nature inspired algorithms which is recently introduced to handles optimization problems efficiently. Because, ease in implementation, solution of better quality, escaping ability from the local optima, maintaining the diversity along with faster convergence.

1.3 Overview of proposed approach

In this research paper, two harris hawk optimization based algorithms have been proposed to capture the hotspot problem. Firstly, we have proposed CH selection mechanism which choose CHs among sensors using the HHO, which selects more numbers of CHs near to the sink node that favors the formation of unequal clusters. To achieve the objective, a novel fitness function has been derived. In addition, linear programming (LP) formulation has been suggested for the same. Thereafter, we have derived CH_Assignment function for joining sensors nodes to the CHs. Finally, energy efficient routing algorithm has been proposed based on HHO and LP formulation also suggested for the same. The efficient fitness functions has been designed for the proposed algorithm which considers residual energy and various distance parameters

1.4 Article organization

The remaining section of this paper has been formulated as follows. In the next section, existing approaches based on brute force approaches and meta-heuristic based approaches for saving the energy in WSNs is presented. In Sect. 3, preliminaries are presented which consists of description of HHO, energy consumption model, network model and terminologies adopted for the proposed approach. In Sect. 4, explores the proposed approach which is based on harris hawk optimization. Section 5 discusses the simulation framework and obtained results with respected to standard benchmark indicators in brief. Finally, Sect. 6 concludes this study, which also paves the path for the future research.

2 Literature review

In this section, recently introduced techniques related to the unequal clustered based routing are presented.

In WSNs, energy saving is seen as one of the most prominent issues because, nodes are mostly deployed in hostile environment. Thus, making it impossible to replace or recharge the deployed nodes. To address this issue, researchers have introduced the novel energy saving architectures (Afsar and Tayarani-N 2014; Heinzelman et al. 2000, 2002; Zeng and Dong 2016; Sabor et al. 2016; Bara’a and Khalil 2012; Lalwani et al. 2017; Lindsey and Raghavendra 2002; Younis and Fahmy 2004; Akkaya and Younis 2005) based on unequal clustering mechanism which are presented below.

In Khalil and Bara’a (2011), researchers have introduced an evolutionary based approach to form the clustered wireless sensor nodes (EAERP). It selects a set of sensors from all the sensors which is some portion of nodes as CHs throughout the network for balancing the energy of the network. Thereafter, cluster formation process has been started in which all non-CH sensors joins the nearby CHs. But, after this process, it was observed that the plethora of sensors as CHs, which might not possess required amount of energy to perform the assigned task and the non-CH nodes make a connection with the nearest CHs. As a outcome, WSN not able to sustain for longer duration and various hot-spots. To encounter the hot-spot problem, some unequal clustered routing protocols were proposed in WSNs.

In Soro and Heinzelman (2005), investigators have suggested an unequal cluster formation mechanism termed as UGS. It forms the clusters based on network condition, i.e., size of clusters are proportional to the euclidean distance with respect to the BS. But, UCS takes the wrong assumption that the energy of the selected CHs are high. In addition, the cluster head was placed at the centre of each cluster which makes it infeasible for real life scenarios.

In location based clustered WSN scheme (Lee et al. 2011). They assumes that the nodes can mutually cooperate each other to form the unequal clusters by tracking the live position information and distance to the BS based on GPS receiver. However, the use of GPS in every node makes the network expensive, which is unfeasible for large scale applications and scalable networks.

In Yu et al. (2011), authors proposed a technique known as EAUDC, which is based on unequal clustering, which elects the CHs build upon important variables such as average leftover energy of the nodes in the nearby CHs as well as takes the adaptable rivalry ranges to frame of the clusters with respect to the network condition. They estimate the uneven competition ranges based on two factors, namely, distance and residual energy between the sensor to the BS. Both were taken jointly using the weighted factor. However, no criteria was suggested by the authors for the weighted factor selection.

In Liu et al. (2012), this article suggested an unequal clustering based approach for the energy balancing termed as EBCAG. It is also known as gradient cluster based routing. However, this approach is lacking into the consideration of various essential parameters one of them is leftover energy of sensors. As a outcome, uneven distribution of energy and effects badly on the network performance.

In Malathi et al. (2015), this article suggested a hybrid energy efficient scheme for unequal clustering of WSNs, called as HUCL. They applied both static and dynamic clustering for increasing the lifetime of WSNs. However, it increases the redundant data that also consumes energy during processing.

In Afsar and Younis (2014), this article presented an unequal clustered based technique for terrestrial WSNs termed as EPUC. The objective is network lifetime maximization. However, the author neglects to provide the critical factors in the routing and cluster creation phases. Furthermore, because computational complexity varies exponentially, this method is unsuitable for large-scale networks.

In Guru et al. (2005), this article suggested an clustered based framework for WSN using the well known meta-heuristic i.e., PSO. This algorithm considers the two essential parameters, namely, (1) sink/BS distance and (2) intra-cluster distance. But, unfortunately they miss to taken care of the leftover energy of sensors, as a outcome, sensors with low energy may play the role of CHs, that results uneven energy load of CHs and leads to one of the bigger issues in the network i.e., hot-spot problem. To encounter this rising issue, some well kind unequal clustered based routing algorithms like Jiang et al. (2010), Bagci and Yazici (2013) and Song and Zhao (2011) have suggested by researchers.

In Jiang et al. (2010), authors have suggested unequal clustered based routing algorithm termed as EBUC. They adopted one of the standard meta-heuristics i.e., PSO. But, it does not take care of the formation of clusters and also implemented a routing algorithm, as a outcome, proposed approach is not feasible for the scalable networks because the variation of exponential computational complexity.

In Bagci and Yazici (2013), suggested approach have introduced fuzzy based scheme for the cluster formation in wireless sensor networks termed as EAUCF. It outperforms over the standard clustering algorithms. But, when tested on scalable network then downfall in the performance of the algorithm has been observed, because it does not take care of the basic essential routing parameters, namely, node degree while route the collected data of sensors to the sink node. .

In Song and Zhao (2011), authors have suggested an unequal clustering mechanism termed as UFIA. This mechanism based on well know soft computing techniques, namely, fuzzy logic and improved ACO. The key objective is making the network energy efficient. But, it does not take care of inter-cluster routing phase, as a outcome, energy holes in the WSN architecture. Thereafter, some of the approach’s to capture the problem of energy holes were presented in Rao et al. (2015) and Banka et al. (2016). However, cost of find the solution for the scalable network is high.

Energy efficient algorithms have been proposed recently by Carrabs et al. (2015a, 2015b, 2016, 2017) with the purpose of prolonging the lifespan of WSNs These methods are based on constraints like connection, coverage, and interference.

3 Preliminaries

In this section, network model, energy model and terminologies opted in the proposed work are presented.

3.1 Terminologies

Before go through the proposed algorithm, some abbreviations and terminologies have been presented for the ease of understanding in Table 1.

Table 1 Abbreviations, notations and terminologies

All deployed nodes in the WSN design are homogeneous, which means they have equal computation power, and data transmission range. All of the sensors have circular sensing fields. All the connections between the nodes are wirelesses and symmetric. WSN network lifetime can be established in a variety of ways, for example, first node death(FND) or predefined percentage of nodes died due to insufficient energy, etc. However, in the proposed HHO based algorithm, the lifetime of WSN can be estimated using the time for the first node passing away is termed as first node death (FND) (Dietrich and Dressler 2009).

3.2 Energy estimation model

To estimate the energy consumption, the basic model is taken into account i.e., model of first order ratio (Heinzelman et al. 2000). Energy depletion during transmitting the L bits of data at the distance \(d_l\) between two sensor nodes is estimated using the Eq. 1, in which, \(E_{ele}\) is the predefined energy reduction rate in the transmitter circuitry, similarly, in the application process, \(E_{amp}\) represents the pre-defined energy reduction rate during amplification.

$$\begin{aligned} E_{Tx} = {\left\{ \begin{array}{ll} E_{elec} *L + E_{amp} *L*d_l^2 &{} \text { if}\ d_l<d_{th}; \\ E_{elec} *L + E_{amp} *L*d_l^4 &{} \text { if}\ d_l \ge d_{th}. \end{array}\right. } \end{aligned}$$
(1)

Energy reduction rate on receiving the L bits of data is represented in Eq. 2

$$\begin{aligned} E_{Rx}=E_{elec} *L \end{aligned}$$
(2)

3.3 Network model

For the proposed work, the network model is taken into account which is based on following properties (Sabor et al. 2016). The sensors were placed at random in a region of interest, and a node can assess the distance from the remaining nodes using the RSSI model (Xu et al. 2010). As a result, GPS is not required for any of the nodes. Nodes’ positions become fixed after deployment and cannot be modified (Pasupathi et al. 2021). All the nodes are homogeneous nature and can be used as both regular sensors and CH nodes.

4 Proposed methodology

The hot-spot problem in WSNs has been addressed using two techniques. The first algorithm proposed is the selection of cluster heads. Following that, a multi-hop routing technique is recommended. Both methods are based on the HHO method. In the CH selection method, all sensors first submit their residual energy to the BS, along with their position information, to see if they meet the threshold energy criteria to be considered for a CH. The non-CH nodes join the cluster heads based on the derived CH Assignment function, after finding the best locations for CHs, followed by a multi-hop routing technique. All of the aforementioned techniques are based on important characteristics such as distance, energy, and node degree.

4.1 Proposed cluster head selection algorithm: an optimized approach based on HHO

The idea underlying CH selection is to elect a large number of cluster heads close to the sink while conserving network energy. During the cluster formation phase, this process of CH selection encourages the creation of imbalanced clusters, with small sized clusters close to the base station and larger sized clusters in terms of number of sensors having a relatively long distance from the BS. A novel fitness function based on neighbour node distance, sink distance, and energy consumption ratio, which can be represented as a proportion of energy consumption to the residual energy of the cluster head, has been developed for better sensor selection as CHs.

4.1.1 Linear programming construction of CH selection problem

The HHO-based technique aims to select a larger number of sensor nodes as CHs that are close to the BS rather than far away. During the cluster formation phase, this mechanism of CH selection encourages the establishment of unequal clusters.

Let, f1 be a function that emphasises the distance between neighbouring sensor nodes. It indicates that CHs that are the shortest distance from their neighbours are preferred and selected. Therefore, f1 need to be minimized for efficient selection of nodes as CHs. Let, f2 represent a mathemetical expression with respect to the sink distance. It means, f2 need to be minimized. Finally, f3 represent a function with respect to the energy ratio. It elucidates the fraction of the energy dissipation of the CHs to the residual energy of the CHs. For the optimal CH selection process, f3 need to be minimized. Normalize each of the objectives inside 0 and 1 in a way which in turn, minimizes the functions of linear combinations efficiently.

Note: All the aforementioned functions f1, f2, and f3 will be taken into the consideration for the derivation of the fitness function which has been described in next Sect. 4.1.3 for the proposed approach based on HHO. The main focus is to minimize all the objective functions i.e., f1, f2 and f3. The most suitable way is to minimize their linear amalgamation. Hence, for optimal cluster head selection problem using the aforementioned objectives, the linear programming (LP) is as follows:

$$\begin{aligned} \mathbf{Minimize} \, F=\alpha _1 \times f_1 + \alpha _2 \times f_2 + \alpha _3 \times f_3 \end{aligned}$$
(3)

Subject to,

$$\begin{aligned} dis(s_i, CH_j)\le d_{max},&\forall ~ s_i ~\epsilon ~S,~ and~ CH_j ~\epsilon ~C \end{aligned}$$
(4a)
$$\begin{aligned} E_{CH-J}> T_{H},&1 \le j \le m \end{aligned}$$
(4b)
$$\begin{aligned} \alpha _1 + \alpha _2 + \alpha _3=1,&~(\alpha _1, \alpha _2, {\text {and}} ~\alpha _3) \epsilon (0,1) \end{aligned}$$
(4c)
$$\begin{aligned} \alpha _2 \ge (\alpha _1 + \alpha _3)&\end{aligned}$$
(4d)

The constraint 4(a) shows that the sensor node \(s_i\) is within range of cluster head \(CH_j\). The constraint 4(b) shows that the leftover energy of cluster head \(CH_j\) nodes must be more than TH. In the constraint 4(c), symbols \(\alpha _1\), \(\alpha _2\) and \(\alpha _3\) represents the control parameters (weights) of the respective function i.e., \(f_1\), \(f_2\) and \(f_3\) respectively. It also ensures that those values neither be 100% nor be 0% weight. The constraint 4(d) shows that, \(\alpha _2\) must be either equal or greater than the sum of the remaining weights, which will favor to choose efficient and more number of sensors as CHs having less distance with respect to the BS/sink.

4.1.2 Harris hawk encoding scheme for CH selection

Harris hawk(HH) portrays itself as a potential solution in the large search space. In CH selection problem, HH represents the set of CHs that has been taken from the normal sensor nodes. The dimension of a HH is the percentage of sensors selected as CHs (generally its 10% ). Let \(H_i = \{ W_{i,1}(t), W_{i,2}(t), W_{i,3}(t), W_{i,4}(t),\ldots , W_{i,D}(t)\}\) be the ith HH of the swarm of harris hawks, in which, individual member i.e., \(W_{i,d}(t)\) selects the CH from its neighbor sensor nodes, and \(1 \le i \le NP\), \(1 \le d \le D\). Then mathematical representation of HH is shown in Eq. 5.

$$\begin{aligned} H_i = \{ W_{i,1}(t), W_{i,2}(t), W_{i,3}(t), W_{i,4}(t),.., W_{i,D}(t)\} \end{aligned}$$
(5)

It is demonstrated in Fig. 2, where CH represents the index of CHs and s indicates the index of sensor nodes. It can be observed from the Fig. 2 that \(s_5\) is selected as \(CH_1\) along with \(s_{41}\) is selected as CH2 and so on. The component of dth dimension of a HH, i.e., \(W_{i,d}\) selects the sensor node \(s_d\) as a CH say \(CH_k\) as follows.

$$\begin{aligned} CH_k= Index (Comm(sd) \times W_{i,d}, n) \end{aligned}$$
(6)
$$\begin{aligned} n= & {} \left\{ \begin{array}{ll} floor(Comm(s_d)) \times W_{i,d}), &{} \\ if ~n \le |Comm(s_d)| &{} \\ \mathbf{Otherwise}. &{} \\ floor(Comm(s_d)) \times W_{i,d})-|Comm(s_d)| &{} \end{array}\right. \end{aligned}$$
(7)
Fig. 2
figure 2

Representation of a sample harris hawk

4.1.3 Formulation of fitness function

In this subsection, description of various objectives have been presented that are taken into the consideration for the formation of the fitness function.

  1. (a)

    Neighbor node distance It is the minimum distance from its neighbour sensors, i.e, dis(CHj, si). In the data transfer process, all sensors consume some part of energy while sending data to their representative CH node. In order to minimize this energy consumption, need to minimize the distance from its neighbors, which is practically not possible because after deployment position of sensor is fixed. This objective by another way i.e., select the CHs which are closer to the randomly initialized CHs. It means different sensor members are selected. The \(f_1\) objective is shown in Eq. 8. Objective 1:

    $$\begin{aligned} \mathbf{Minimize} ~~f_1=\sum _{j=1}^{m} dis(CH_j, s_i) \end{aligned}$$
    (8)
  2. (b)

    Distance from sink/BS : It is the sensor node distance which is selected for CH role i.e., \(CH_j\) from the the sink/base station BS, which is represented as dis (\(CH_j\), BS). The goal of this objective is to select a larger number of CHs with a shorter distance to the BS, hence assisting in the formation of an unequal cluster. The creation of tiny clusters around the sink is favoured by this mechanism. The \(f_2\) objective is shown in Eq. 9. Objective 2:

    $$\begin{aligned} \mathbf{Minimize} ~~f_2=\sum _{j=1}^{m} dis(CH_j, BS) \end{aligned}$$
    (9)
  3. (c)

    Energy ratio: In this objective, ratio of two energies have been taken. Firs is the consumed energy of cluster head \(CH_j\) and next is the residual energy of the \(CH_j\). If a cluster head \(CH_j\) consume less energy while sensing in the communication, and computation process, then more the leftover energy and has a better energy ratio. The \(f_3\) objective is shown in Eq. 10. Objective 3:

    $$\begin{aligned} \mathbf{Minimize} \, f_3=\sum _{j=1}^{m} \frac{E_c(CH_j)}{E_R(CH_j)} \end{aligned}$$
    (10)

In the fitness formulation process, it is observed that aforementioned objectives shown in Eqs. 810 are not antagonistic towards each other. This is reason, weighted aggregation method is taken into the consideration to minimize all the objectives. Therefore, use the following fitness function :

$$\begin{aligned} Fitness= \alpha _1 \times f_1 + \alpha _2 \times f_2 + \alpha _3 \times f_3 \end{aligned}$$
(11)

Note: Before applying the weighted sum approach, all the objectives are normalized between 0 and 1.

The motive is to minimize the value of derived function shown in Eq. 11 using HHO. If the value of obtained function is lower, then the harris hawk position is better, i.e., the better sensors are selected as CHs.

4.1.4 Pseudo code of proposed HHO based cluster head selection

The pusedo code of HHO based suggested CH selection algorithm is presented in Algorithm 1.

figure a

4.2 Derivation of cluster formation equation

The aim of this equation formation is to assign sensors to the CHs, after the CH selection process as follows. This process favors the formation process of unequal clusters and plays the vital role formation of small sized clusters close to the Sink/BS and relatively bigger sized cluster further away from the BS.

  1. (a)

    Leftover energy of cluster head: A sensor \(s_i\) should make a connection with the cluster head \(CH_j\) for the data transfer, which has more leftover energy than any other cluster head. Therefore,

    $$\begin{aligned} CH_{Assignment}(s_i, CH_j) \propto E_{CH_j} \end{aligned}$$
    (12)
  2. (b)

    Node degree of cluster head: A sensor \(s_i\) connects to a cluster head \(CH_j\),that has a lower node degree than the other cluster heads. Therefore,

    $$\begin{aligned} CH_{Assignment}(s_i, CH_j) \propto \frac{1}{N_d} \end{aligned}$$
    (13)
  3. (c)

    Distance between cluster head and sensor node: In order to dissipate less energy, a sensor node si make a connection with the cluster head \(CH_j\), which is closest in terms of distance to \(s_i\) in its communication range. Therefore,

    $$\begin{aligned} CH_{Assignment}(s_i, CH_j) \propto \frac{1}{dis(s_i, CH_j)} \end{aligned}$$
    (14)
  4. (d)

    Distance between sink/base station and cluster head: Aggregated data which is collected from the member sensor nodes at the Cluster heads (CHs) is forwarded to the BS. If it is closure then it would be better. Therefore, the sensors make a connection with the CHs which are closer to the BS. Thus,

    $$\begin{aligned} CH_{Assignment}(s_i, CH_j) \propto \frac{1}{dis( CH_j, BS)} \end{aligned}$$
    (15)

By combining aforementioned Eqs. 1215, the obtained resultant is

$$\begin{aligned} CH_{Assignment}(s_i, CH_j) \propto \frac{E_{CH_j}}{N_d(CH_j) \times dis(s_i, CH_j) \times dis(CH_j, BS)} \end{aligned}$$
(16)
$$\begin{aligned} CH_{Assignment}(s_i, CH_j) = K \times \frac{E_{CH_j}}{N_d(CH_j) \times dis(s_i, CH_j) \times dis(CH_j, BS)} \end{aligned}$$
(17)

where K is a proportionality constant in the aforementioned equation. Here, no loss of generality is taken into the consideration, therefor, value of K=1 is taken during the simulation. During the cluster formation, each sensor node calculates \(CH_{Assignment}\) using Eq. 17 for each CH in the target area. Thereafter, sensor join a CH which having the highest obtained value. If the value is same, randomly any CH is chosen among the highest valued CHs.

4.3 HHO based proposed optimized energy efficient multi-hop routing approach

In final step, after the formation of unequal clusters, marshalled data from the cluster heads to be forward towards the BS using the optimal route, which is suggested by the proposed approach. The detail description of this approach as follows.

4.3.1 Linear programming construction for routing process

The routing algorithm’s major goal is to extend the life of the WSN while reducing the energy drain on each sensor node, so that, total WSN energy consumption can be minimized. Let, h1 is the first objective function, where, CHs can select succeeding CHs with greater leftover energy for routing of data by the help of which maximum lifetime of the network can be achieved. Hence, in the first objective h1 can be maximized. Let, h2 is the second objective function. It is represented with respect to the minimum distance function, which is from CHs to the succeeding CHs, afterwards, from succeeding CHs to the BS. If h2 is minimized then energy dissipation of the network will be reduced Let, h3 is the final and third objective function. In this objective cluster heads can make the connection with the next-hop cluster heads with the consideration of less node degree. If h3 is minimized, then lifetime of the network will be improved.

Let, \(b_{ij}\) be a boolean variable, defined as follows:

$$\begin{aligned} b_{ij}= \left\{ \begin{matrix} 1 &{} if~ Successor(CH_i)=CH_j,~ \forall _{i,j}~1 \le {i,j} \le m\\ 0 &{} Otherwise \end{matrix}\right. \end{aligned}$$
(18)
$$\begin{aligned} \mathbf{Minimize} ~F = 1/h_1 \times \beta _1 + h_2 \times \beta _2 + h_2 \times \beta _3 \end{aligned}$$
(19)

Subject to,

$$\begin{aligned} dis(CH_i, CH_j) \times&\le d_{max}~CH_j \epsilon \{C+ BS\} \end{aligned}$$
(20a)
$$\begin{aligned} \sum _{j=1}^m b_{ij}=1&~and~ 1\ne j \end{aligned}$$
(20b)
$$\begin{aligned} 0< \beta _1, \beta _2, \beta _3 < 1&\end{aligned}$$
(20c)

The description of aforementioned constraints as follows:

  • The first constraint 20(a): It shows that successor of CHi should be within the limit of CHi and the succeeding node is CHj.

  • The second constraint 20(b): It shows that the selected next hop node of CHi is unique, i.e., CHj.

  • Finally, the third constraint 20(c) It shows that neither the weight is 0% nor the 100% on each of the objectives.

4.3.2 Harris hawk encoding scheme for multi-hop routing

In the encoding scheme, each harris hawk(HH) shows the complete multi-hop route from all selected CHs to the BS/sink in this algorithm. The dimension of a each harris hawk is equal to the percentage of CHs in WSNs. Let \(Ri = \{G_{i,1}(t), G_{i,2}(t), G_{i,3}(t), G_{i,4}(t),\ldots ,G_{i,D}(t)\}\) be the ith HH of the swarm of harris hawks, where each component \(G_{i,d}(t)\) maps to the next hop node of each CH in a HH and \(1 \le i \le NR\), \(1 \le d \le D\). Then the HH can be represented as follows:

$$\begin{aligned} Ri = \{G_{i,1}(t), G_{i,2}(t), G_{i,3}(t), G_{i,4}(t),\ldots ,G_{i,D}(t)\} \end{aligned}$$
(21)
Fig. 3
figure 3

In a sample WSN, it represents the random initialized harris hawk that shows the route from all CHs to BS

Every component is initialized randomly, \(1 \le R\) and \(\{1, 2\} \le 2\). The fragment of dth dimension of the harris hawk, i.e., \(G_{i,d}\) maps to the cluster head \(CH_l\) to a \(CH_k\) or BS as follows. Figure 3 shows the HH that was generated at random after the encoding process.

Illustration of Fig. 3: its shows that the CH1 can transmit the data to CH2 and CH2 can transmit the data to CH7 and so on.

$$\begin{aligned} CH_k=Index (Comm(CH_l) \times G_{i,d},n) \end{aligned}$$
(22)
$$\begin{aligned} n= \left\{ \begin{array}{ll} floor(Comm(CH_l) \times G_{i,d}) &{} \\ ~if ~n\le |Comm(CH_l)| &{} \\ \mathbf{Otherwise}. &{} \\ floor(Comm(CH_l) \times G_{i,d})-|Comm(CH_l)| &{} \end{array}\right. \end{aligned}$$
(23)

4.3.3 Formulation of fitness function for finding the energy efficient multi-hop route

The detail description of fitness function construction using the essential parameter as follows.

  1. (a)

    Leftover energy of successor CH: The remaining energy of the succeeding node is used to connect each cluster head to the next CH. A cluster head node can link to one of the possible consecutive hop nodes, leaving it with more energy than the others. Objective 1:

    $$\begin{aligned} \mathbf{Maximize}: ~~h_1=\sum _{j=1}^{m} E_{CH_j} \end{aligned}$$
    (24)
  2. (b)

    Distance of successor node and the Base Station: It is composed of two distances. First distance is computed between cluster head to the succeeding CH, thereafter, next is between the succeeding CH to the BS. A cluster head node can select the cluster head from possible successor nodes in a way that the obtained value of distance is lowest as compare to other successors. Objective 2:

    $$\begin{aligned} \mathbf{Minimize}: ~~h_2=\sum _{j=1}^{m} dis(CH_j, NH(CH_j))\nonumber \\ + dis(NH(CH_j) + BS) \end{aligned}$$
    (25)
  3. (c)

    Node degree of successor CH node: The objective of making this connection of each cluster head to the successor depends on the node degree of the successor CH.If node degree of successor is less then it will survive for the longer duration and connection breaking chances is very less. A cluster head can make connection with the successor node which having minimum node degree. Objective 3:

    $$\begin{aligned} \mathbf{Minimize}: ~~h_3=\sum _{j=1}^{m} N_d(NH(CH_j)) \end{aligned}$$
    (26)

Here, a weighted aggregation method is adopted to minimize all the objectives mentioned in Eqs. 38, 39 and 40 combinedly, due to all aforementioned objectives are not strongly opposing to each other. Therefore, final fitness function using Eqs. 38, 39 and 40 is derived as follows.

$$\begin{aligned} \mathbf{Minimize}~ Fitness = \beta _1 \times \frac{1}{h_1} + \beta _2 \times h_2 + \beta _3 \times h_3 \end{aligned}$$
(27)

where

$$\begin{aligned} 0< \beta _1, \beta _2 {\text {and}} \beta _3 <1 \end{aligned}$$
(28)

Note: Before applying the weighted sum approach all the aforementioned objectives are normalized.

4.3.4 Pseudo code of proposed multi-hop routing

The pseudo of finding the path from each CH to sink node is shown in Algorithm 2.

figure b

5 Result and analysis

5.1 Description of system configuration, target area and existing approaches

The proposed work is manoeuvred with the help of java programming NetBeans 8.0.2 environment and the derived outcomes are interpreted with the help of MATLAB (Version 9.6). System specification consists of core i7 processor (intel) with chip-set 2600, 16 GB RAM, 4.80 GHZ CPU, and executed with the help of Microsoft Windows 10 operating system. In node configuration, number of nodes employed (100–1000) and CHs employed (50–60). At the early stage, energy of every sensor node is 2.0 J. The other parameters (Heidari et al. 2019) taken into the consideration are presented in Table 2.

Several network scenarios have been pondered for the simulation, listed as follows.

  • Let the target vicinity, where all various WSN scenarios are tested be \(500 \times 500 \, {\text {m}}^2\).

  • Two locations are chosen for the placement of the BS/sink. Firstly, placed at the center of target vicinity i.e., at (250, 250), termed as WSN#1. Next location is (500, 250) i.e., WSN#2.

  • In the proposed algorithm , the considered parameters for HHO technique have been summarized in Table 3.

  • The harris hawk representation and fitness functions are derived differently for the cluster head selection and routing problems. Due to this reason, enhanced quality of solution and the faster convergence is expected. In the first proposed algorithm 60 hawks are taken while 50 hawks for the second algorithm.

However, the emphasis is on unequal cluster-based routing algorithms (Jain et al. 2020; Saxena and Mehta 2021) because the proposed methodology is related with the same concept. The proposed algorithm was executed with recently introduced unequal cluster-based routing algorithms, namely, EBUC (Jiang et al. 2010), EAUCF (Bagci and Yazici 2013), EPUC (Afsar and Younis 2014), OFCWA (Le-Ngoc et al. 2021) and unequal cluster-based routing using particle swarm optimization build on derived fitness functions termed as PSO-UCRA. In the performance analysis, proposed HHO-UCRA has been evaluated with standard benchmark network parameters of wireless sensor networks, these are energy consumption of WSN, lifetime of WSN network, total data packets received at the BS/Sink after certain number of rounds, convergence rate of meta-heuristics and alive nodes after certain number of rounds.

5.2 Performance indicators

The below mentioned indicators are used to measure the effectiveness of the algorithms.

5.2.1 Energy consumption

This is the quantity of energy exhausted by the network sensors (Kumar et al. 2020; Balakrishna et al. 2020; Zhang et al. 2020). In the proposed work, it is estimated after the certain number of rounds. In every round, sensor depletes energy for sending the data to the respective nominated CH and CHs deplete when it collects the data from sensors, aggregate and route it to the BS.

5.2.2 Network lifetime

After the certain number of rounds till the first node died is occurs referred as FND. In proposed work, FND was considered as the lifetime of the WSN.

5.2.3 Number of alive nodes

In WSNs, those nodes not having sufficient amount of energy to collect and forward the data referred as dead node. Remaining nodes are functioning mode referred as alive. Number of alive nodes over a period, referred after certain rounds in the proposed work.

5.2.4 Packets receipt at BS

It is represented by sum of total number of data packets receipt at the BS. In the proposed work, it is estimated after certain rounds during the simulation for the overall lifetime of network.

5.2.5 Convergence rate

It is estimated using the number of repetitions required for the optimization technique to achieve the global best position (Xiao et al. 2021).

5.3 Network and HHO parameters values

The Network and HHO parameter values taken into the consideration in the HHO based proposed algorithm is shown in Table 2.

Table 2 Simulation WSN parameters
Table 3 HHO parameters

5.4 Performance indicator 1: analysis of energy consumption of various WSNs

The proposed HHO-UCRA has been tested with variable number of sensors with respect to the total network energy consumption. In addition, aforementioned network scenarios were considered. In all the scenarios, the proposed HHO-UCRA achieves the better results than the existing variants.

Illustration of Fig. 4: it shows the obtained results in terms of performance indicator 1 i.e., energy consumption, when proposed HHO-UCRA executed with 700 sensors and 60 CHs. From the Fig. 4, it can be elucidated that the results of the HHO-UCRA is performed better as compared other tested existing variants of routing algorithms, namely, PSO-UCRA, OFCWA, EAUCF, EPUC and EBUC.

Fig. 4
figure 4

Performance indicator 1 for a WSN#1, b WSN#2: comparison analysis of obtained energy consumption

The superior performance was achieved, the reason behind that the derived fitness functions of both the proposed algorithms considers the essential parameters. In the first proposed algorithm, energy drain rate of the non-CH nodes was minimized by minimizing the two distance based parameters combinedly. First one is between sensors and their respective cluster heads, afterwards, CHs to the BS in the CH selection process. In the cluster formation process, the member sensors make a connection with the CHs using two level distance based criteria. In the first level, CH which having less distance is considered. Afterwards, the minimum distance from chosen CHs to the BS is applied in the next level. In the second proposed algorithm, HHO-UCRA make a connection with the successors CHs with minimum distance in the routing path for minimizing the energy drain rate of the WSNs.

5.5 Performance indicator 2: network lifetime analysis of various WSNs

In this performance indicator , number of sensors fall in the range inside (100, 1000) and 60 CHs were considered. The obtained performance and analysis with respect to existing algorithm is presented below.

Illustration of Fig. 5: in this figure, the obtained outcome of proposed HHO-UCRA algorithm with respect to the existing variants of routing, namely, EBUC, EAUCF, EPUC, OFCWA and PSO-UCRA, presented graphically. It can be elucidated from this figure that HHO-UCRA outperformed over the existing variants, when tested on various WSNs scenarios with the variation of node density in the network.

As we know, If a sensor is chosen with low energy, it may drain energy in a faster rate and hamper the WSN lifetime. To overcome this problem, in the selection process of CHs, proposed HHO-UCRA considers the leftover energy of the sensors. Cluster head in the realistic field exhausts more energy than the non-CH sensors. Next, in the cluster formation phase, non-CH sensor nodes can make a connection with the CHs with consideration of higher residual energy. In the routing phase, the next-hop node with more leftover energy is selected to extend the network lifetime.

Fig. 5
figure 5

Performance indicator 2 for a WSN#1, b WSN#2: comparison analysis of network lifetime

In both EBUC and OFCWA, authors have not taken care of cluster formation process efficiently, while sensors join the CHs. On the other side, EAUCF and EPUC suggested the unequal cluster formation process, but, both the algorithms have not focused on CH selection and routing phase. In proposed HHO-UCRA, all three essential phases of unequal clustering and routing were considered and focused, i.e., (1) CH election phase, (2) unequal cluster formation phase and (3) routing phase.

5.6 Performance indicator 3: analysis of number of alive nodes of various WSNs

In the simulation, proposed HHO-UCRA has been rigorously tested on variable node density and different WSNs scenarios with respect to the alive nodes obtained after the certain number of rounds.

In all the WSNs scenarios, the proposed HHO-UCRA shows the better performance over the existing variants. In Table 4, the obtained alive nodes of HHO-UCRA and existing variants after certain number rounds for WSN#1 is presented. In Table 5, the obtained alive nodes in WSN#2 after certain rounds for some of existing variants of routing and proposed algorithm is presented.

Fig. 6
figure 6

Performance indicator 3: comparative analysis of number of alive nodes for a WSN#1, b WSN#2

Tables 4 and 5, show that the number of alive nodes obtained reduces as the number of rounds increases. Existing algorithms, on the other hand, show a quick decrease in the number of living nodes when compared to the suggested HHO-UCRA methodology. The reason for this is that energy balancing and energy efficiency are taken into account when forming unequal clusters.

Table 4 Number of nodes alive with number of rounds (WSN#1)
Table 5 Obtained alive nodes with respect to number of rounds (WSN#2)

Illustration of Fig. 6: the obtained results with the node density of 400 and 35 CHs is presented. It show the proposed HHO-UCRA executed with some of the existing variants of routing in terms of obtained alive nodes. In the existing variants, namely, EBUC, EAUCF, EPUC, OFCWA and PSO-UCRA were used because all these algorithms are well know standard routing algorithms. From the figure, elucidated that the HHO-UCRA shows better performance over tested other variants i.e., EBUC, EPUC, EAUCF, OFCWA and PSO-UCRA in terms obtained alive nodes. The reason behind that the HHO-UCRA considers the essential parameters, namely, energy, node degree and various distances for the derivation of fitness functions in both the algorithm as well as in cluster formation process, whereas, the existing alternatives primarily evaluate two parameters: energy and distance, which could lead to a network energy imbalance and hotspots.

5.7 Performance indicator 4: packets receiving analysis for various WSNs

In this performance indicator, node density is fall inside (100, 1000) and 60 CHs were considered. For a sake of comparison, packet receiving analysis has been done in existing algorithms executed with the proposed algorithms.

Illustration of Fig. 7: it is observed the HHO-UCRA outperforms over some popular existing protocols EBUC, EPUC, EAUCF, OFCWA and PSO-UCRA with respect to the data packets received by the BS during the simulation. The received data packets is directly proportional to the lifetime of WSN and energy consumption of network. As it observed from the aforementioned results, HHO-UCRA has longer network duration i.e., lifetime and drain rate of energy is less in comparison with existing algorithms, therefore, it shows the receipt of the more number of data packets obtained at the BS.

Fig. 7
figure 7

Performance indicator 4 for a WSN#1, b WSN#2: comparative analysis of number of received packets by BS

It can be seen that when BS is placed in the middle of the target region, the number of data packets received increases. The decline of data packets was seen when the position of BS was relocated from the center to the edge of the target region. Because HHO-UCRA takes care of optimal CH selection for unequal cluster formation and multi-hop routing utilizing efficient fitness functions, the decline was reduced for the suggested approach.

5.8 Performance indicator 5: analysis of convergence rate of various WSNs

The acquired result in terms of convergence rate of the suggested HHO-UCRA algorithm has been severely tested with the current variations, EBUC and PSO-UCRA, in this section. Nodes ranged from 100 to 1000 to demonstrate the convergence rate on a scalable network.

Illustration of Fig. 8: it can be seen that the PSO-UCRA provides a high-quality solution with rapid convergence over tested WSNs scenarios with variable number of sensors. It shows the convergence with 700 sensor nodes and 60 CHs.

Fig. 8
figure 8

Performance indicator 5 for a WSN#1, b WSN#2: comparative analysis of convergence rate

From Fig. 8, it is seen that the HHO-UCRA attains better quality of the solution and converges quickly when compared to PSO-UCRA and EBUC. The reason for this is that the harris hawk optimization paradigm improvises the balance between exploration and exploitation search. The PSO-UCRA converges faster than existing PSO based algorithm called EBUC. Because, in PSO-UCRA, an improved fitness function was used by considering essential parameters. The iterations estimated for the convergence of proposed HHO-UCRA is taken as the mean of number of iterations of both the proposed algorithms. The reason behind that the the convergence rate of both the algorithms is different.

6 List of conclusions and future findings

In this paper, solution of hotspot problem was suggested. In order to capture the problem, CH selection and routing algorithms were proposed based on HHO. Firstly, LPs have been formulated for the CH selection and routing problems. Thereafter, for the aforementioned challenges, HHO-based algorithms have been presented that take into account the same set of critical factors. First algorithm elects more CHs nearby BS, rather than, away from the sink. A novel fitness function was devised for that by considering the various distance and energy parameters. Thereafter, devised CH_Assignment function was considered for the sensors assignment to the selected CHs. Finally, a novel routing approach based on HHO was suggested. It selects the next-hop CHs or the BS for forwarding the data based on leftover energy of CHs and the distance from the BS or sink.

Both the proposed algorithms have been simulated with derived assignment function to frame the WSN architecture. In order to test rigorously, different WSNs scenarios have been considered with the changing density of sensors and cluster heads. From the obtained results, it can be elucidated that the HHO-UCRA achieves better results than the standard PSO based algorithm called as a PSO-UCRA. Moreover, it also performs well known existing algorithms, namely, EPUC, EAUCF, FBUC and EBUC. in terms of tested benchmark performance indicators. Finally, convergence rate of HHO-UCRA was tested with EBUC and PSO. In the future research direction, various QoS metrics such as delay and fault tolerance of the network will be considered to improve the reliability of the network.