1 Introduction

Concerned about the longevity of wireless sensor networks, nature-inspired mechanisms are emerging as a viable solution. For increasing the lifespan of the network or in order to decrease the sensing of unnecessary data by the battery-driven sensors, optimizing the scope of the network plays an important role. Many geographically distributed sensors communicated wirelessly to sense and store actual data from nature are formally known as "wireless sensor networks" (WSNs) [1]. Sensors are operating like repeaters, as they will accept the data, convert the analogue to digital form, and redirect the data to the other nodes, cluster head, and sink. The base station will collect the data, analyse it, and take a decision as per the application. There are various parameters on which wireless sensor network architecture depends, such as fault tolerance (sensor nodes will redirect the packet and acknowledge the packet if some of the sensors get drained), scalability (how the network will work if sensors are added or removed), stability, and power efficiency. These sensors are battery-powered. So, after some time, the power of the sensors will get depleted, and it will affect the entire lifespan of the network. The purpose of the study is to maximize the network lifespan by increasing the quantity of nodes per round, the amount of data sent to the BS, and the optimal quantity of cluster heads. In the extant case, optimal network scope, clustering mechanisms, and path choosing are mostly used in wireless sensor networks to elevate the lifespan of the network.

WSN consist of tiny sensors that are distributed over the entire network and have the capability of sensing the data, processing it, and conveying it from one node to another. These sensors sense the nature, evaluate it, send it, and accept it. Military, weather forecasting, industrial areas, medical services, agriculture, or many other applications use the WSN for data transmission. Sensors are limited, battery-powered, and very compact in size. Once sensors are placed in the harsh and unforgiving nature, these sensors will be used in an adequate way because they cannot be replaced or charged. Nodes drain their power in two ways, such as by sensing the natural data and conveying the data to the base station [2,3,4,5,6,7,8,9,10]. Most of the work has been done to maximize the entire lifespan of the network by saving the power of the sensors. Liank et al. [11] redirected the Huang mechanism, which aims to balance power utilization in the entire network by using optimal clustering throughout the network. But the restriction of this mechanism is that it is very complex, and if the data size of the packet is large, then it may block the channel. In contract, Cardei et al. [12] have put forward the redirect TianD mechanism, in which sensor nodes are arranged in disjoint set form to cover the maximal range. As compared to the Hunag mechanism, the TianD mechanism is less complex in nature. However, the mechanism will not be able to find the duplicate nodes and data in nature.

2 Literature Survey

The challenges faced by the wireless sensor network are power constraints, correct detection of data, and non-duplicate data. The sensors need to be placed in such a way that they are in appropriate interspace from each other while considering the uncovered area, which leads to the "scope hole" or "blind area" problem. For the above-stated problem, Wang et al. [13] have put in place a mechanism named the "Scope Configuration Protocol." The protocol is well suited for natural settings where the number of sensors is small or significant. After the literature survey, two problems have been observed, i.e., power depletion of the sensors and the sensor node scope problem, and there is back-and-forth between these two problems. Authors in the literature may have proposed solutions to individual problems but not to collective ones. After the survey, keeping the existing problems in mind, we collectively considered the problem and put in place the multi-purpose optimization mechanism. There are various mechanisms published in the literature for the wireless sensor network that use nature-inspired mechanisms [14,15,16,17,18]. There are multiple mechanisms put in place by the authors to cover the optimal scope of the wireless sensor network [19,20,21]. In Ref. [19], Metaheuristics for the deployment problem of wireless sensor networks: a review, the authors discuss the various types of issues while deploying the sensors in nature by using nature-inspired mechanisms. In Ref. [20], "Optimal sensor network layout using multi-purpose metaheuristics," the author equated the three protocols and highlighted the problems associated with mechanisms in terms of optimal scope. In Ref. [21], Transmutative intelligence in wireless sensor networks: routing, clustering, lateralization, and scope, we discussed the genetic, transmutative, theoretical, mathematical, and practical applications of cluster formation, the optimal scope of the network, and the lateralization problem in wireless sensor networks. Other challenges faced by the wireless sensor network include the insufficient power of the sensors, which leads to network failure [14,15,16,17].

So, the main dissimilarity between the wireless sensor network and the other network is that the wireless sensor network is oversensitive and vulnerable to power. So, the optimal utilization of power mechanisms is a necessity for the wireless sensor network [20]. Nature-inspired mechanisms are best suited for cluster formation, and choosing the best path will elevate the life of sensors, along which we can elevate the entire lifespan, stability period, and scalability of the network [21,22,23]. A cluster has a cluster head who communicates with the other cluster heads in the network. Most of the power is consumed when the data is transferred between the cluster heads and the base station. To turn down the power utilization in the clustered wireless sensor network, a routing mechanism is used between the cluster heads and the base station [24,25,26,27]. However, none of the mechanisms deliver serious effects on the problem in the wireless sensor network to cover the optimal solution. The purpose of the paper is to reduce the power utilization of the network during the transmission of data through a literature survey of recent clustering and routing mechanisms. We have also briefed the nature-inspired mechanisms and their applications used in the wireless sensor networks in terms of capacity, robustness, and self-adaptability. We have also discussed the strengths and weaknesses of the work done by the different researchers in Sect. 3. The optimization mechanism is segregated into three types: model-based, simulator-based, and mechanism-based. Mechanism-based is further bifurcated into two parts, such as deterministic and stochastic mechanisms. The stochastic mechanism is further classified as heuristics and meta-heuristics. The meta-heuristic mechanism is further bifurcated into four parts, i.e. human-inspired, geography-inspired, physics-inspired, and bio-inspired. The bio-inspired mechanism is further bifurcated into three parts: transmutative, swarm-based, and plant-based [28,29,30]. Furthermore, there are more than thirty swarm-based optimizations that have been put in place by the researchers. The swarm-based mechanism is used in wireless sensor networks to resolve many existing problems, such as upgrading the power efficiency of the network, elevating the network lifespan, and maximizing the packet delivery ratio in the network. The conventional routing protocols are inefficient for upgrading the power constraints of the wireless sensor network. So, to upgrade the power constraint of the network, researchers used efficient clustering and routing protocols using a swarm-based approach. As per the research, the ant colony optimization [31] is used to upgrade the power efficiency of the network and is one of the efficient mechanisms for routing. Figure 1 depicts a review chronology of the research. The review is based on the publication of a paper in the fields of power efficiency, security-based delay, error-free protocol, and cluster-based computing. The majority of the paper was based on the cluster formation and the power efficiency upgrade of the network [32,33,34,35,36,37].

Fig. 1
figure 1

Review chronology

2.1 Classical Approaches

In 2002, LEACH was habituated by W. Heinzelman, and the sensors chose their cluster head and formed a cluster. The Cluster Head gathers all data from the nodes and sends it to the BS.The elected cluster head will lose their power very fast. In 2017, Wang et al. put forward a mechanism named LEACH-impt [38]. If LEACH-impt, communication takes the inter-cluster routing path.The route is chosen based on the quantity of hops per path, the path's remaining power, and the power utilization per round. The overall performance of LEACH-impt in terms of power efficiency has been upgraded, but due to the arbitrarily chosen cluster head and changes in topology, the data loss is high.

Haseeb et al. put in place a mechanism named the WECRR (Weighted Power-Efficient Clustering with Robust Routing) protocol. In WECRR [39], the cluster head chooses based on a deterministic strategy. Secondly, the routing decision is taken based on multiple factors, such as traffic density, remaining power, and packet error ratio. Furthermore, the route maintenance and load distribution among the nodes are improved by the protocol. But the restriction of the put redirect mechanism is that the interspace between the node and the base station is not considered by the protocol. Again, Haseeb et al. have put in place a mechanism named AECR (Aware Cluster Based Routing) [40]. The cluster head is chosen based on the node density and the position of the node. The mechanism's benefits include lower cluster overhead and communication costs, as well as a focus on node power.The disadvantage of the mechanism is that it does not focus on the interspace between the nodes [31].

Hang and Zhang established the WPO-EECRP mechanism [39]. In this protocol, the cluster head chooses based on remaining power, interspacing from the node, interspacing from the node to the base station, and the cluster density. The mechanism works well when there is an adjacent quantity of nodes present in between the cluster head and base station, and it will elevate the power utilization of the network.

2.2 Optimizations in WSNs Using Swarm Intelligence

An optimization is achieved by designing a model, using a simulation, and designing a mechanism. A detailed taxonomy of the swarm-based optimization used in wireless sensor networks is shown in Fig. 2. The swarm-based mechanism is bifurcated into two parts: local search (deterministic) and global search (stochastic). Local search provides the theoretical assumptions about the formulated problems and provides the analytical properties [41, 42]. Guarantee of reaching the global minimum and at least a local minimum, whereas global search provides the guarantee in terms of probability. However, global search is much faster than local search. Additionally, the global search method is further classified into two parts: heuristic mechanisms (problem-dependent mechanisms) and meta-heuristic mechanisms (problem-independent mechanisms). Both mechanisms are used to speed up the process of finding the global optimum solution when finding the solution is difficult. Because the heuristic mechanisms are based on an adaptive and greedy approach, they are more likely to get stuck at local optima, which results in failing to obtain global optima [38]. However, meta-heuristics are non-adaptive and non-greedy approaches that can find a global solution. The meta-heuristic mechanism is also known as a nature-inspired mechanism. The nature-inspired mechanism is further divided into four parts: bio-inspired, physics-inspired, geography-inspired, and human-inspired [43,44,45,46,47,48,49,50]. The bio-inspired mechanism is divided into three parts: transmutative, swarm-based, and plant-based. Because nature inspired the mechanisms, most of the mechanisms are inspired by the biological system. Therefore, most of the parts of the nature-inspired mechanisms are based on the bio-inspired mechanism. The transmutative mechanism is based on Darwin’s principle of choice, whereas the swarm is based on collective intelligence [51].

Fig. 2
figure 2

Taxonomy of the swarm-based optimization

As per the research, the most popular mechanism used for the cluster head choice is the butterfly optimization mechanism; for the cluster formation, the particle swarm optimization mechanism is popular; and for the efficient route choice, the ant colony optimization mechanism is used by the researchers to upgrade the power efficiency of the wireless sensor network [52]. The ant colony optimization mechanism works with other popular mechanisms to upgrade the power efficiency of the network, such as fuzzy logic [53]. Xie et al. [54] put in place a mechanism based on ant colony optimization for wireless sensor networks named the Type-2 Mamdnai Fuzzy Logic System. The route between the cluster heads is determined by ant colony optimization, and the cluster heads are determined by remaining power, interspace to the base station, and the number of nearest nodes. The cluster heads choose all the statistics from the nodes and send them to the base station. Arjunan and Sujatha put in a redirect mechanism based on fuzzy logic to develop the inadequate clusters, and the routes were chosen using the Ant Colony Optimization technique. The cluster heads are choosing based on remaining power, node degree, interspace from the base station, node centrality, and interspace from the nearest nodes [55]. The mechanism is well suited to maintain the lifespan of the network [56]. Many researchers use Ant Colony Optimization, Particle Swarm Optimization, and Butterfly Optimization Algorithm to optimize existing problems in wireless sensor networks, such as optimal route choosing, optimal quantity of cluster heads choosing per round, optimal quantity of nodes choosing per round, and elevating the packet transmission between the cluster head and the base station [57, 58].

3 WSN and Optimizations

The main issues related to the wireless sensor network are categorized into three main sections, such as power efficiency, quality of service, and security. The optimization mechanisms are used in wireless sensor networks to solve the existing problems, i.e., optimal scope of the sensors, data aggregation, power-efficient clustering and routing, and sensor lateralization. There is a correlation between all the stated problems, such as if we go for service quality, we must trade off the lifespan of the network. The same is true for security; in order to achieve security, we must once again trade off network lifespan. If we approach the problem piecemeal, many gaps will remain, and the problem will never be solved. So, to discover a balanced wireless sensor network, we must build an optimized mechanism that can handle all the problems simultaneously. The solution to the problem is to create a multi-purpose function and optimize the mechanism by using an appropriate optimizer mechanism. For choosing the appropriate mechanisms, various factors have been considered, such as problem type, time constraint, availability of resources, and accuracy desired. To achieve better network performance, the researchers have used many approaches in nature-inspired mechanisms, such as classical approaches [31, 38, 43,44,45] and swarm intelligence-based approaches [46,47,48,49,50,51, 53,54,55, 57, 59]. There are various types of mechanisms present in the literature focused on the different types of problems faced by wireless sensor networks, named optimal scope, data aggregation, power-efficient clustering, power-efficient routing mechanisms, and sensor lateralization [60, 61]. Table 1 provides a detailed examination of the existing mechanism in terms of parameters such as power efficiency, latency, scalability, connectivity, load balancing, packet loss ratio, reliability, and complexity.

Table 1 Survey of the extant mechanism with various parameters

3.1 Optimal Scope in WSN

Optimal the scope of sensors in the wireless sensor network is an essential part of the network to elevate the network's lifespan. Scope of the area in such a way that it targets the entire area with a minimum quantity of secondary nodes. The key parameter in choosing the area is the shape of the test area. There are various shapes available in the existing literature, such as irregular, solid, hexagonal, or circular. In the figure, we show the four two-dimensional geometrical-based sensing shapes [62,63,64,65]. In the present case, the outline of the test area is uneven and multifaceted due to territory properties and its solid shape. However, the hexagonal or circular shape is used for its computational and conceptual ease. The hexagonal shape is commonly used by researchers and industry experts due to its flexibility and overlapping properties. Though the circular shape is more prominent because of its low complexity, the restriction is compensated by increasing the radius of the circle. Another issue arises as a result of the increase in the radius of the circle: duplicate data sensed by the sensor. As more duplicate data is sensed by the sensor, there will be more power utilization [66,67,68]. We can turn down the problem by enhancing the single-purpose optimization problem into a multi-purpose problem by choosing the other parameters.

3.2 Power Efficient Clustering and Routing in Wireless Sensor Network

Because wireless sensor networks are made up of sensors that have built-in batteries for a limited time, these batteries cannot be recharged, so the need for power-efficient networks is of the utmost importance in the present case [69]. The sensors dissipate their power by sensing the data from nature and sending it to the base station using multi-hop communication. For reducing the power utilization of the nodes, first clusters are formed, then cluster heads are chosen based on the remaining power, and thirdly, the path is chosen for the data transmission using optimum routing techniques.

In the given domain, the problem faced by the networks are:

  • The choosing of the cluster head having high power and choosing of routing path from each round.

  • Maximization of network lifespan and packet delivery ratio to the base station.

  • Interspace from the sensor node to the cluster head and cluster head to the base station should be minimized.

4 Problem Statement

The problems faced by the wireless sensor network are: finding the appropriate purpose function to preserve or create a power-efficient network; Weighted power-efficient clustering with robust routing for wireless sensor networks [70] and aware cluster-based routing [40] are implemented to conserve power. The overall power of the network is preserved by considering both power and interspace. The number of member nodes in the cluster head influences the lifespan of clustering and routing in wireless sensor networks using the harmony search mechanism [71]. In an energy-efficient clustering routing protocol [39] based on parameter optimization in WSN, the information communication from the cluster head to the base station also affects the network lifespan. The proactive and reactive mechanisms of ant colony optimization cause packet loss. The solution is to design a mechanism centered on the node's power and the interspace between the node and the cluster head, as well as the cluster head and the base station. The best path will be implemented by multi-purpose functions. And the packet drop ratio is minimized by considering the power of each node. The remaining power and interspacing from the node to the cluster head, as well as the interspacing from the cluster head to the base station, must be considered when creating the purpose function. As a result, it will work in both a small and large network.

4.1 Preliminaries

This section describes the network and power model as well as describe the PSO (Particle Swarm Optimization) is used to formulate the clusters, BOA (Butterfly Optimization Algorithm) technique for finding the cluster head, ACO (Ant Colony Optimization) technique for finding the route from the source to the sink (Fig. 3).

Fig. 3
figure 3

Trends of the mechanism

4.1.1 Network Model

  • Sensors are arbitrarily deployed in the network, later they are constant in nature.

  • BS receives the data such as remaining power of the node, interspace from the sensors from all the sensors in the nature.

  • To configure the network model of wireless sensor network, all the knob are comparable to each other in terms of original energy and the dispensation period.

  • The interspace amongst the sensor knob to the Cluster Head and from Cluster Head to the base station is intended grounded on the Euclidean interspace.

  • Clusters are formed using Cluster formation mechanism, then cluster heads are chooses using choosing mechanism. Then the routing mechanism is used to find the route from source to the sink.

4.1.2 Energy Model

Given in the research, an elementary radio model (1st order) is measured to compute the power of the nodes. For conveying the l bits from the source to the sink over the interspace d is calculated by using the Eqs. 1 and 2 respectively:

$${E}_{TX}\left(l,d\right)=\left\{\begin{array}{c}{LE}_{elec}+LEfs{d}^{2} if \,d<do\\ {LE}_{elec}+LEmp{d}^{4} if\, d\ge do\end{array}\right.$$
(1)

where \({LE}_{elec}\) is the power used to run the converter (ETX) or (ERX) and the threshold value is d0. For the experimental survey, free space and multi-path models is expressed as \({E}_{fs}\) and \({E}_{mp}\). These values are depended on the converter amplifier model. Where d0 is expressed as

$${d}_{0}= \sqrt{\frac{{E}_{fs}}{{E}_{mp}}}$$
(2)

5 Proposed Method

The put redirect model has three mechanisms: the first is used to form clusters; the second is used to choose the cluster head by considering the remaining power and the interspace from the sensors; and the third is used to find the path or route over the entire network. The particle swarm optimization is used to form the cluster, the butterfly optimization algorithm is used to find the optimum quantity of cluster heads in each round, and ant colony optimization is used to find the route from the source to the sink or from the cluster head to the base station. The entire process is described in Fig. 4.

Fig. 4
figure 4

Flow chart

5.1 CH Choosing Using BOA (Butterfly Optimization Algorithm)

BOA (Butterfly Optimization Mechanism) is introduced in 2019 by Sankalap Arora [72]. The mechanism shows the butterfly's food search and it’s mating behavior. In general, butterflies are fascinating to everyone, along with a host of other apprehensions. The butterfly's crusade is also conducted haphazardly or in the manner of the other butterflies, who produce the stronger cologne. The purpose function is used to compute the inducement strength. The butterfly optimization mechanism chooses the ideal quantity of cluster heads using certain parameters: node notch, node uniqueness, interspace to its nearest, interspace between the base station and the cluster head, and the remaining power of the sensors. The author used the algorithm proposed by Prachi M. et al. [43]. The steps of the algorithm are as follows:

Node degree: It is defined as the quantity of sensors connect to the Cluster Head. The Cluster Head with the less quantity of knob are chooses as cluster head with the higher quantity of connected sensors deplete their power fast. The degree of the node is calculated as sum of power of all the sensors belongs to the cluster head. The weight value for the purpose function is 0.1.

$$ND=\sum_{i=1}^{m}{I}_{i}$$
(3)

Node centrality: It is defined as how much a node is halfway situated from the nearest nodes. The weight value for the purpose function is 0.1 and it is calculated by using the eq:

$${C}_{n}={\sum }_{i=m}^{m}\frac{\sqrt{\frac{{\sum }_{j\in n}{dist}^{2}(i,j)}{n(i)}}}{\text{Network dimension}}$$
(4)

where n(i) quantity of nearest node to the cluster head i.

Remaining Power of the node: The node with the higher remaining power will become the cluster head because the cluster head need to perform the various task such as aggregate the data, remove the duplicate data, data transmission to the base station. The weight value for the purpose function is 0.3. Thus, the node with higher remaining power will chose as the cluster head and the remaining power is calculated as:

$${R}_{e}={\sum }_{i=1}^{m}\frac{1}{{E}_{CHi}}$$
(5)

where the remaining power of the ith cluster head is \({E}_{CHi}\).

Interspace between the sensors: It is defined as the interspace from the sensors to the cluster head and from nearest sensors with in the cluster. Lesser the interspace, less power will be consumed in the transmission. The weight value for the purpose function is 0.2. Thus, the interspace is calculated by using the formula:

$$Dij={\sum }_{i=1}^{m}\left(\sum_{j=1}^{Ii}dis({s}_{j},{CH}_{i })/{I}_{i}\right)$$
(6)

where \(dis({s}_{j},{CH}_{i})\) is interspace from sensor node to the cluster head and \({I}_{i}\) shows the ith sensor node within the cluster.

Interspace from the cluster head and base station: it shows the interspace from the from the cluster head to the base station. If the cluster head is far away from the base station, then it consumes more power for the data transmission. So, the nodes near to the base station is used to convey the data to the base station. The weight value for the purpose function is 0.25. The purpose function used to calculate the interspace from the base station to the cluster head is calculated as:

$${D}_{CH-BS}={\sum }_{i=i}^{m}dis({CH}_{j},BS)$$
(7)

So, the single purpose function to find the cluster head from the set of nodes is calculated as

$$F={\alpha }_{1}ND+{\alpha }_{2}{C}_{n}+{\alpha }_{3}{R}_{e}+{\alpha }_{4}{D}_{ij}+{\alpha }_{5}{D}_{CH-BS}$$
(8)

Mechanism

figure c

5.2 Cluster Formation Using PSO (Particle Swarm Optimization)

Particle Swarm Optimization (PSO), one of the oldest mechanisms, is the nature-inspired mechanism used by the researchers to find the optimum results in the wireless sensor network. Kennedy and Eberhart established the mechanism in 1995. The mechanism is inspired by the social behavior of bird flocking and fish schooling. It is an effective method to solve the clustering problem in wireless sensor networks. Based on centralized clustering, the clusters are formed by the base station. For this, the base station sends the data collection message to all the sensors in nature. Nodes send data to the base station after receiving it, such as node id, location (interspace from the BS in and position), power loss and power loss ratio (velocity), and current power. Then the base station initiates the clustering process in the following steps:

figure d

5.3 Routing Mechanism Using ACO (Ant Colony Optimization)

Ant Colony Optimization is a metaheuristic mechanism inspired by the performance of the ants. Commonly, ant colony optimization is applied to discrete problems. Ant Colony Optimization is used to find the shortest path from the source node to the destination node using a graph in which the ant colony (nodes associated with the cluster head) is represented as a node and the L represents the link between the nodes with different weights. In the initial phase, the weight of the link is calculated as the actual interspace in between the nodes by using an arbitrarily large quantity, which is calculated by the mathematical formula. The disadvantage of the ant colony optimization mechanism, i.e. undefined conjunction, is overcome by improving the ant colony optimization in terms of remaining power, interspace from the destination, and the knob degree. The route-finding procedure using ACO is as follows:

  1. 1.

    In the formed cluster head, the ants are situated in every cluster. Cluster heads will create the way from the Cluster Head to the destination (base station). These routes data are known as redirect data.

  2. 2.

    Based on the probability matrix, the redirect containers are arbitrarily converted to the following cluster head. The redirect program packet is conveyed to the next cluster head until the packet is acknowledged by the base station.

  3. 3.

    The redirect packet will maintain the local data base about the visited cluster head, remaining power of the nodes and the cluster head (Remaining power of the nodes are calculated as the quantity of data conveyed along the network), interspace from the cluster head to the base station and the node degree.

  4. 4.

    The redirect data base is used to create the backward data base or backward packet. We need to create the backward packet because to extend the path until the packet reaches to the base station. The backward packet path is same as the path followed by the redirect packet.

  5. 5.

    The pheromone level of the link is updated by the remaining power, interspace to the base station and the node degree.

  6. 6.

    The next node for the transmission is chooses based on Eq. 9 which shows the chance of selecting the knob j as the subsequent knob i by means of ant k.

    $$ P_{{ij}}^{k} (t) = \left\{ {\begin{array}{*{20}c} {\frac{{[\tau _{{ij}} (t)]^{\alpha } [\eta _{{ij}} ]^{\beta } }}{{\sum\limits_{{l \in {\text{N}}_{k} }} {[\tau _{{ij}} (t)]^{\alpha } } [\eta _{{ij}} ]^{\beta } }}} & {if\,j\epsilon {\text{N}}_{k} } \\ 0 & {otherwise} \\ \end{array} } \right. $$
    (9)

where the heuristic value and pheromone intensity are represented as \({\eta }_{ij}\) and \({\tau }_{ij}\) respectively. To control the relative importance of the both the values, parameter \(\alpha \) and \(\beta \) is used. Submission of nodes who has not visited yet is represented as \({\mathrm{\rm N}}_{k}\). Base on the data stored in the routing table by the cluster head, the heuristic and pheromone intensity are updated. Both the values are updated by the following formulas:

$${\eta }_{ij}=\frac{1}{{d}_{CH}}$$
(10)

and

$${\tau }_{ij}=\left(1-\rho \right){\tau }_{ij}^{old}+\sum_{k=1}^{m}\Delta {\tau }_{ij}^{k}$$
(11)

where \({d}_{CH}\) shows the interspace from the CH, m shows the quantity of ants initialized and the pheromone deterioration quantity is shown as \(\rho \epsilon [\mathrm{0,1}]\). Where \(\Delta {\tau }_{ij}^{k}\) is calculated as:

$$ \Delta \tau _{{ij}}^{k} = \int {\frac{Q}{{c_{k} }}} if\,the\,k^{{th}} \,ant\,traversed\,link\left( {i,j} \right),\,otherwise\,0 $$
(12)

where the value of Q is constant and the route cost is found by the ant is calculated as \({c}_{k}\).

$${c}_{k}={\boldsymbol{\varphi }}_{1}{E}_{r}+ {\boldsymbol{\varphi }}_{2}{d}_{CH,BS}+{\boldsymbol{\varphi }}_{3}{N}_{D}$$
(13)

where the weighted values of \({\boldsymbol{\varphi }}_{1}\),\({\boldsymbol{\varphi }}_{2}\), \({\boldsymbol{\varphi }}_{3}\) are 0.5,0.3 and 0.2. For the successful communication, remaining power of the nodes should be considered as the priority because the node failure me leads to the communication failure. After that, to obtained the shortest interspace in between the cluster head and the base station is considered as the second priority because it consumes the minimum power or we can say that the power utilization is low in order to find the shortest interspace as compare to maintain the remaining power of the sensors. Lastly, we consider the node degree as a third priority, in which we choose the next cluster head as a hop having lesser quantity of member nodes. To find the route in between the source node to the destination node following steps need to be followed:

figure e

5.4 Cluster Maintenance

In the literature survey present, the cluster preservation phase is one of the most significant stages to stable the load amongst the clusters. The cluster closer to the base station drain their power so fast because of the traffic of inter cluster. So, the preservation of the cluster is important factor to turn down the problem of knob disaster. Node failure mains to the network failure and maintenance of the cluster heads to the maximization of the lifespan of the cluster or the entire network. In the put redirect mechanism, if the power of the cluster heads drains to the below the threshold value, the butter fly optimization mechanism is used to initialized the cluster, partial swarm optimization mechanism is used to elect the cluster head and then ant colony optimization mechanism is used to find the optimised path in amongst the knob to the cluster head and cluster head to the base station to maximize the network lifespan. Furthermore, it leads to the maximize the quantity of data conveyed to the base station.

6 Performance Measurement

The performance of the put redirect mechanism is measured by considering various factors such as:

Number of active nodes: The quantity of active nodes elevates the lifespan of the network. It describes as the quantity of active nodes in the network.

Dead nodes: The stability period of the network is calculated till the first node die. The network life time will decree when the quantity of dead nodes will elevate per round.

Data send to the BS.

Throughput: quantity of bits conveyed to the BS and it will measure in quantity of bits conveyed per second.

Stability period: It is measured along at what round the first node die, quantity of rounds when half of the nodes die in the network.

Power utilization in each round: The total power utilization is calculated by the power loss of each node in the network.

Packet Drop Ratio: Quantity of data lost during the transmission from node to the cluster head and from cluster head to the base station.

Congestion in the network: It is calculated as quantity of acknowledged data by the base station to the quantity of produced data by the nodes in the network.

7 Simulation Setup

The put redirect power efficient protocol is implemented and tested on the MATLAB. The reason for using MATLAB is that it is very appropriate for the data survey and gives mathematical operations. There are 300 devices arbitrarily positioned in the test reason of 200 × 200 m. The first order radio model for the power efficiency is considered for analysing the put redirect model with the extant model. The simulation parameters used for the examination purpose is shown in Table 2. The purpose of the put redirect mechanism is to turn down the power utilization in wireless sensor networks. So, to achieve the object, author used the Butterfly Optimization Algorithm (BOA) for the cluster head choosing, particle swarm optimization (PSO) is used for the cluster formation process and Ant Colony Optimization (ACO) is used for the routing process.

Table 2 Simulation parameter

Parameter that are considered for the butterfly optimization algorithm are: population size considered as 200, switch probability has taken as 0.8, power exponent considered as 0.1 and sensor mobility is considered as 0.01. Now for the cluster formation, the parameters considered as Quantity of Particles, Number of iterations, Inertia Weight, Local Weight (c1), Local Weight (c2), Fitness are as 200, 100, 0.8, 1.49, 1.49, Predication accuracy. For the optimal route consideration, the parameters chosen as Quantity of ants, Pheromone exponential weight, experiential exponential weight, disappearance rate are as 200, 1, 1, 0.1.

The put redirect mechanism is validated in 3 cases.

Case 1: In the 1st case, the Base Station is placed at the centre of the test area (100, 100) in Fig. 5, which is used to analyses the shorter interspace communication.

Fig. 5
figure 5

Illustration of Case 1

Case 2: In the 2nd case, the Base Station is placed at the last area which is in the range of the sensing reason (100, 200) in Fig. 6. It is used to analyse the means range communication.

Fig. 6
figure 6

Illustration of case 2

Case 3: In the 3rd case, the Base Station is placed at the outer area (100, 250) in Fig. 7, which is situated far away from the examination zone. This case is used to analyse the extended rang communication.

Fig. 7
figure 7

Illustration of case 3

7.1 Performance Evaluation in Terms of Active Nodes

The quantity of active nodes in put redirect mechanism is correlated with the LEACH, DEEC, EDEEC, DDEEC for 500 nodes in different cases such as in the 1st case, the base station is placed at the centre of the test area (250, 250) which is used to analyses the shorter interspace communication, in the 2nd case, the base station is placed at the last area which is in the range of the sensing reason (100, 250). It is used to analyse the means range communication, in the 3rd case, the base station is placed at the outer area (100, 550), which is situated far-off from the test area. This case is castoff to analyse the long rang communication. The put redirect mechanism prolongs the network lifespan as compare to the other protocols (Fig. 8).

Fig. 8
figure 8

Number of active nodes

7.2 Performance Evaluation in Terms of Stability Period

The stability period is measured till the round when 1st node dies after the certain quantity of iterations. Figure 9 shows the quantity of dead nodes in the case 1, Fig. 10 shows the quantity of dead nodes for the case 2 and the Fig. 11 shows the quantity of death node for the case 3.

Fig. 9
figure 9

For the case 1

Fig. 10
figure 10

For the case 2

Fig. 11
figure 11

For the case 3

7.3 Performance Evaluation of Average Power Utilization

The performance evaluation of average power utilization of the put redirect mechanism is correlated with the extant mechanisms like LEACH, DEEC, MEEDEEC, SEP, EDEEC, DDEEC is shown in the Fig. 12. The power utilization is calculated when the base station is situated in centre of the region (100, 250) and second comparison is based when the base station is situated far away from the base station (100, 250) respectively. As per the result obtained from the mechanism, it is clearly shown that the put redirect mechanism gives higher power efficiency as compare to the LEACH and other mentioned protocols. The put redirect mechanism gives the higher power efficiency because it considers the optimal quantity of cluster head choosing per round, it includes the interspace while choosing the cluster head and optimal route when sending the data from one node to the other node. The reason behind the higher power utilization is that LEACH choose the cluster head arbitrarily and use single hop transmission whereas DEEC does not consider the interspace during cluster head choosing. The overall comparison in terms of remaining power of the put redirect mechanism with the extant mechanism is shown in the Table 3.

Fig. 12
figure 12

Remaining power

Table 3 Comparison of the remaining power of the extant mechanism with the put redirect mechanism

7.4 Performance Evaluation Based on the Packet Transmission to the BS

The put redirect mechanism gives the higher packet acknowledged by the base station is that, the fitness functions of Butterfly Optimization Algorithm, particle swarm optimization and Ant Colony Optimization reserve the power utilization of the nodes due to which leads to elevate the quantity of active nodes in the network along which the data packet will be conveyed to the base station. The fitness function chosen for the cluster head choosing and route choosing, it helps to minimize the overhead in the routing process due to which a smaller quantity of nodes dies in each round during the data transmission and it leads to the higher quantity of data acknowledged by the base station. In the extant mechanism, the inappropriate quantity of cluster head choosing and routing overhead, the lesser quantity of data is conveyed to the base station. Figure 13 shows the quantity of data acknowledged by the base station if there are 250 nodes are present in the case and Fig. 14 shows the quantity of data acknowledged by the base station if there are 150 nodes are present in the case.

Fig. 13
figure 13

Packet transmission for the 250 Nodes

Fig. 14
figure 14

Packet transmission for the 150 Nodes

7.5 Performance Evaluation of Throughput

The inappropriate choosing of cluster head in the extant mechanism is the main reason for the higher power utilization in the data transmission. The put redirect mechanism chooses the cluster head and the route in the efficient way due to which higher data are conveyed to the base station and achieve the efficiency. The comparison of put redirect mechanism is correlated with the extant mechanism.

7.6 Performance Evaluation of the Network Lifespan

Network lifespan is totally dependent on the remaining power of the nodes and the lifespan of the network got exhausted when entire node will lose their power. The network lifespan of the entire network is correlated when the first node die, half of the nodes die and last node die in the network. It is well said by the researchers that the demise of the 1st node in the network does not disturb the network execution but the system performance is affected when half of the node die in certain rounds or in the data transmission. Furthermore, the entire network gets drained when all the nodes die. So, to upgrade the network lifespan, the optimal quantity of cluster head choosing per round and chosen of optimal path from node to base station is mandatory requirement in the present case.

7.7 Comparative Survey of the Put Redirect (Proposed) Procedure with Further Cluster-Based Routing Mechanisms

The comparative survey of the put redirect mechanism is correlated with some extant mechanism is shown in the Fig. 15. Table 4 shows the Comparative survey of Delay, Packet Drop Ratio, Throughput to the base station with the extant routing protocol.

Fig. 15
figure 15

Comparison survey with CPSO, BERA

Table 4 Comparative survey of delay, packet drop ratio, throughput to the BS with the extant routing protocol

8 Conclusion

In the current case of a wireless sensor network, the power utilization of the network is very high, due to which the network's lifespan gets shortened. So, to upgrade the network lifespan, the author focuses on the following parameters: optimal quantity of cluster heads chosen per round, quantity of cluster formation, and optimal route choosing. The author uses the Butterfly Optimization Algorithm, particle swarm optimization, and ant colony optimization to reduce the power utilization per round and elevate the network lifespan. The Butterfly Optimization Algorithm is used to choose the cluster head, and the fitness function is used with consideration of five parameters such as the remaining power of the node, the interspace between the nodes and the base station, the node's centrality, and the node's degree to determine the cluster head per round. The particle swarm optimization is used to form the cluster by using certain parameters, such as the distance between the cluster head and the base station. The ant colony optimization is used to find the best route from the source to the destination by considering parameters such as the interspace to the neighbor node, the remaining power of the nodes, and the node degree. The performance of the proposed redirect mechanism was measured in three different cases in which the base station was situated at different positions. The proposed redirect mechanisms were correlated with the existing mechanisms, and the result shows that the proposed redirect mechanism gives a higher result in terms of stability. The proposed algorithm has a low convergence rate into the local optimum, a low exploration and exploitation rate, and a slow convergence speed.