1 Introduction

Wireless sensor networks (WSNs) comprises several sensor nodes. Real-world applications use these sensor devices to gather data about the surroundings. WSNs have been applied in various fields, including agriculture, healthcare, and the environment [1,2,3]. Sensor nodes play a crucial role in how WSNs function. The sensor nodes primarily have low battery capacities, a small range of memory sizes, and low computing capacities. Because the sensor nodes are designed to operate in adverse environments, their inbuilt batteries are irreplaceable, which limits their lifespan [4]. In a WSN, balancing energy efficiency with other essential factors such as quality of service, coverage, and connectivity, is critical. Sensor nodes may reduce the frequency of data transmission or use lower transmission power to save energy, resulting in data update delays or lower frequency, which affects the timeliness and quality of the collected information. Nodes in sleep mode or with limited transmission range may be inaccessible when needed, potentially resulting in data collection delays or loss. Adaptive routing protocols can aid in balancing energy efficiency and connectivity. These protocols can adjust routing paths dynamically based on network conditions and node energy levels to ensure data reaches its destination while consuming the least energy.

Some methods have added multi-hoping communication to reduce travel distance [5, 6]. Various routing approaches have been developed to facilitate multi-hoping, including physical arrangement, data-centric clustering, and hierarchy-based routing [7]. The information protocols start the data transmission between the vertices and the  base station (BS) through relay nodes [8]. These protocols limit the number of data packets transmitted and reduce data redundancy. These protocols also limit the network’s capacity to scale [9]. Finding the nodes’ geographic location is a significant challenge in this case. For data transmission, hierarchy protocols adhere to a multi-tier architecture [10]. Because of its energy efficiency, numerous researchers have focused on developing a variety of loose collection routing approaches to improve network longevity, bandwidth allocation, and scalability [11].

The network is created with infinite clusters, each with its cluster head (CH), thanks to the hierarchy protocols, which offer a multi-hop route and reduced energy consumption while data transmission is achieved by the WSN. A cluster head (CH) is a particular node in a sensor node group with additional responsibilities than regular sensor nodes. Each cluster contains a CH, which collects data from the sensor nodes and sends it to remote receiving nodes for processing and decision-making. It serves as a local leader or hub within the cluster, assisting in efficiently routing and managing data on the network. There are various methods for addressing this issue, most of which concentrate primarily on the energy factor and give less attention to other crucial factors like service quality, coverage, connectivity, etc. Some protocols need help in choosing the way that gives the highest throughput and the least latency when choosing optimal paths. Therefore, a challenge and goal of recent studies is to increase the lifespan of a wireless sensor network while considering competing factors.

Therefore, this work presents an optimal clustering, cluster head and energy-efficient routing approach. The particle swarm optimization (PSO)-based CH selection approach solely takes into account the considerations of energy and distance. The PSO method, however, has a hot spot issue [12]. Various approaches use the Genetic Algorithm (GA) procedure and the addition of an optimization technique for CH selection. Additionally, it operates poorly in a hectic setting due to the BS’s over-congestion [13]. It has been proven that the HCCHE-based cluster selection technique boost the increased energy consumption rate. However, it is discovered that the lifetime and energy of HCCHE decreases when the length between the base station and sensor node (SN) is reduced [14].

Hierarchical routing is a method of network organization in wireless sensor networks that involves dividing the network into multiple levels or layers of nodes with different roles and responsibilities. A network can have multiple levels of clusters, forming a hierarchical structure. The heads of clusters at a certain level can be regular nodes in higher-level clusters, resulting in a tree-like structure. The primary goal of hierarchical routing is to improve scalability, energy efficiency, and overall network performance. Hierarchical routing provides various levels of redundancy. If a cluster head fails, another node in the same cluster can take over as the new cluster head, ensuring that data collection and forwarding continues. Hierarchical protocols create a structured network topology with defined clusters and cluster heads by default. This structure enables multi-hop communication by allowing for efficient data aggregation and routing. Hierarchical protocols effectively balance energy efficiency, scalability, and fault tolerance in wireless networks.

In the past two decades, network clustering has been proven as an efficient approach for data collection and routing in WSNs. It provides several advantages over other methods in terms of energy efficiency, scalability, even energy distribution, etc. Optimization algorithms such as Genetic Algorithm (GA), Particle Swarm Optimization (PSO), Ant Colony Optimization (ACO), Artificial Bee Colony (ABC), Whale Optimization Algorithm (WOA), grey wolf optimization algorithm (GWO), Multi Swarm Optimization (MSO), Bat Algorithm (BA), social group optimization (SGO), and Simulated Annealing have played an essential role in advancing energy-efficient clustering and routing techniques for WSNs.

Several routing protocols have been developed over the last decade to improve the overall efficiency of wireless sensor networks. Although most of the literature recognizes the need to maximize the energy efficiency of routing protocols, un which the transmission rate is of primary concern. Many conventional routing protocols do not adequately address energy efficiency issues, which results in sensor node energy depletion. This can result in shortened network life and higher maintenance costs. Some routing protocols may struggle to scale efficiently as the number of sensor nodes in the network increases. Conventional routing protocols can introduce delays due to multi-hop communication or excessive control overhead in specific applications that require low-latency communication. Some routing protocols may not provide strong support for ensuring quality of service requirements in applications that require specific levels of reliability, latency, or throughput. As a result, wireless sensor networks require an efficient clustering algorithm. To address the shortcomings of existing cluster routing protocols, we propose a fuzzy with SFO-based clustering and IEHO-based routing protocol for clustered WSNs.

1.1 Major contributions

The major contributions of this work are as follows:

  • This paper presents a  hybrid fuzzy with adaptive Sailfish optimization algorithm for CH selection. Fuzzy logic is used for clustering and ASFO was proposed for CH selection. Additionally, it was illustrated in this paper that energy-efficient clustering methods always result in the best QoS values.

  • This article proposed an Improved Elephant Herding Optimization (IEHO) algorithm to find the shortest path. The proposed routing algorithm minimizes the energy usage and data transfer delay.

  • The performance analysis of the proposed hybrid approach compared with conventional algorithms like GA, PSO and HCCHE based on QoS performance showed that the proposed approach outperformed exisiting approaches.

The clustering algorithm based on the Fuzzy with Sailfish Optimizer (SFO) is implemented in two stages. In the first stage, a fuzzy logic system is used to choose a set of suitable CHs. It allocates CH in an efficient and distributed manner based on three input parameters: residual energy (RE), NC, and NOVER. SFO is used in the second phase to improve the system’s overall performance. It is initialized using the fuzzy system output as a good initial solution to the SFO initial population. This phase employs a newly developed fitness function for SFO, which assists the Fuzzy with Sailfish Optimizer (SFO) reach the optimal clustering process. Furthermore, an energy-aware routing algorithm for cluster-based WSNs is proposed, which employs the EHO algorithm to solve optimization problems. The optimization process in EHO mimics elephant herding behavior.

A brief introduction is given in Sect. 1 of the article. Furthermore, research on hierarchical routing systems is covered in Sect. 2. The proposed fuzzy-ASFO protocol is discussed along with specifics of the SailFish optimization (SFO) method in Sect. 3. The performance analysis of the proposed work is detailed in Sect. 4. The investigation’s conclusion is provided in Sect. 5.

2 Related works

An enhanced meta-heuristic-driven energy-aware cluster-based routing (IMD-EACBR) method for IoT-WSN was presented by Lakshmanna et al. [15]. The IMD-EACBR model in their study aims to increase network lifetime and energy efficiency. In order to do this, the IMD-EACBR model enhances the Archimedes optimization algorithm-based cluster (IAOAC) technique for CH election and cluster architecture. The proposed network is then thoroughly evaluated using NS-3.26’s simulation features. The simulation results show an enhanced performance [15].

Kavitha and Velusamy [16] introduced the SAGA-H technique for a hybrid genetic algorithm. MATLAB was used to simulate and explain the technique that was provided. The results were also compared to a current genetic algorithm (GA)-based strategy regarding the number of packets transported between the BS and sink, typical residual energy, and network lifetime. The area of clustering in WSN was briefly reviewed by Amutha et al. [17], utilizing methods from the three fields of classical, machine learning, and optimization. This study considered a wide range of benefits, drawbacks, applications of each approach, opportunities for additional research, difficulties, and future directions. By giving crucial information via cluster-based wireless sensor networks, the researchers were prompted to conduct additional research.

An energy-efficient routing protocol and a fuzzy-GWO technique were developed by Singh et al. [18]. An energy-efficient opportunistic routing method and a fuzzy-based GWO approach are proposed in this research effort. Fuzzy-GWO achieved a new parameter for choosing the CHs. The working environment for MATLAB 2021b was utilized for simulation. Comparisons are made between LEACH, HEED, MBC, FRLDG protocols, and the suggested procedure, F-GWO. According to the results, the network lifetime has been enhanced by 20, 14.8, 12.5, and 3.8%, respectively. Authors in [19] introduced a resilient cluster-based tree-based paradigm for WSN-IoT based on the metrics of live iteration, bisection indexing, and algebraic connections. The WSN has a dense distribution of all categories. The authors additionally examine mobile synchronization nodes and tree all clusters by defining a full CH based on remaining energy, distance, and fast response.

Pattnaik and Sahu [20] integrated Fuzzy clustering and the EHO-Greedy algorithm to provide an effective routing system for WSN. Nodes are initially created in several clusters with extended EM. For densely distributed heterogeneous WSN CHs or BSs, the suggested technique is challenging to handle such massive volumes of statistics, especially when the data is in its natural state. Additionally, a time-consuming data transfer process to the base station is required by WSN. Moharamkhani et al. [21] created a multi-objective fuzzy experience and understanding of bacterial foraging optimization to reduce road congestion. The moFIS-BFO protocol, based on the moFIS and BFO algorithms, is presented in this research as a hybrid protocol for energy-efficient clusters in WSNs. Hierarchy is enabled to control traffic, reduce severe package waste, and control the gender of cluster headers. As a result, enormous WSNs should refrain from using the moFIS-BFO protocol.

The Neuro-fuzzy Emperor Penguin Optimization (NF-EPO) method was presented by Preeth et al. [22] to create an energy-efficient path design for IoT-WSNs. The authors used the three input factors of residual energy, neighbor node share, and node behavior history to choose the best CH. Using the effective emperor penguin optimization routing technique, the mobile sink’s meeting locations and routes are calculated (EPO). The demonstrated results provided better performance. Mahajan and Badarla [23] suggested a Nature-Inspired algorithm-based Cross-layer Clustering (NICC) method with Bacterial Foraging Optimization (BFO), which illustrates the exchange between energy efficiency and optimum data transfer. The numerical outcomes show that in numerous WSN-assisted SF scenarios, the NICC protocol outperforms modern clustering techniques. The BFO-based clustering and routing of the NICC protocol were designed with energy usage, network lifespan, QoS enhancement, minimal communications latency, jitter, and overhead in mind.

A LEACH-based approach known as RE-LEACH was presented in Elavarasan and Chitra [24]. The authors’ main goal was to develop a protocol that was less energy-intensive than the previous ones and had less overhead. Additionally, included in this strategy is the reappointment step. The node has a more significant amount of remaining energy than the other nodes and is repeatedly given a task to complete. The method can lengthen the lifespan of WSNs by avoiding node death. The following findings from the thorough literature review [12,13,14, 24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45] are made: A CH over-burden brought on by improper cluster formation lengthens transmission delays, uses up a lot of CH energy and reduces the sensor networks’ overall performance. Qamar et al. [45] proposed ACO with PSO algorithm to improve the traveling salesman problem. The proposed hybrid provides a better optimal solution than conventional PSO and ACO algorithms [45]. PSO is a nature-inspired optimization technique that can solve many optimization problems, including continuous and combinatorial tasks. However, when faced with specific optimization problems, PSO may struggle to find solutions, and the term “hot spot” is used to describe one of these challenges. Hot spots are typically associated with a lack of particle position diversity. When the majority of particles converge in a single region of the search space, it is possible that they will not explore other regions where the global optimum may exist.

GAs are optimization techniques inspired by natural selection and genetics. Exploration (searching for new solutions) and exploitation (improving existing solutions) are inherently balanced in genetic algorithms. GAs may spend a significant amount of time exploring new routes in a congested network with limited available routes, which can exacerbate congestion and lead to inefficient network utilization. Hua et al. [46] proposed an efficient UAV-to-ground communication for channel modeling.

2.1 Problem statement

From the literature review, the main problems with clustering sensor nodes are routing and load balancing using the sensors and the cluster head [25]. Developing energy-efficient data collection methods is a primary issue in wireless sensor networks. Various optimization-based clustering and routing methods like GA, PSO, AHHO, SFO, Cross-layer Protocol and Levy Bat algorithm have been proposed for WSN and wireless network applications [14, 36,37,38,39,40,41,42,43,44]. Most existing systems only use distance-based clustering algorithms, although most of these efforts focus on cluster-based approaches. The decision-making process is complex while developing routing algorithms. The algorithm cannot guarantee optimal routes and CH selection based on congestion and link quality. Therefore, CH selection is the primary consideration in clustering techniques. In this research paper, we present an improved elephant herd optimization (IEHO) and a hybridization fuzzy with ASFO based on a clustering technique for WSN to enhance QoS performance.

3 Proposed methodology

In order to increase performance in terms of energy usage, dependability, and robustness, we present a hybrid fuzzy system that combines the SFO-based clustering technique with Improved Elephant Herd Optimization (IEHO). This section presents the suggested model and the network model’s concepts. Assume that each sensor is randomly placed throughout the surroundings to create the network. Each node has the same beginning energy, identical sensing, and connectivity.

Fuzzy logic is an efficient method for handling data imprecision and uncertainty. In WSNs, choosing cluster heads typically involves many factors, including node energy, vicinity to other nodes, and data traffic. These complicated decision criteria can be modelled using fuzzy logic by specifying the proper membership functions and rules. In order to choose the best cluster head, Sailfish Optimizer is used to optimize these fuzzy rules and parameters. Sailfish optimization continuously improves the fuzzy logic rules based on energy levels and data traffic conditions. Using this dynamic optimization, clusters that use the least power while preserving network connectivity can be chosen. Fuzzy logic and the Sailfish optimization algorithm used for selecting cluster heads in WSNs provide a stable and adaptable approach that takes advantage of the dynamic optimization of Sailfish optimization and the capacity of fuzzy logic to handle uncertainty.

Routing algorithm parameters, such as weights, thresholds, and convergence criteria, are optimized by IEHO. In order to obtain the best routing performance in terms of power dissipation, reliability, and latency, the proposed hybrid approach is employed. This hybrid system aims to build wireless sensor networks with an intelligent and adaptive routing mechanism. It combines ASFO for cluster formation and topology learning, IEHO for parameter optimization, and fuzzy logic for decision-making and uncertainty management. Together, these elements allow the routing algorithm to make effective, context-aware decisions, adapt to shifting network conditions, minimize energy consumption, and enhance the overall performance and robustness of WSN routing.

3.1 Network model

A massive collection of sensor nodes and one ground station (BS) comprise the system infrastructure. There are two categories for all sensor nodes. Common nodes make up one, and cluster head nodes make up the other. Figure 1 depicts the WSN clustering and energy sharing approach.

Fig. 1
figure 1

WSN Clustering

3.2 Energy model

To obtain the energy model, we take into account energy use during the communication phase. The energy dissipation caused by data transmission, reception, and aggregation makes up the total energy usage: a common node and a cluster leader node exchange L-bit data in this paradigm.

$$E_{Tx} \left( {L,d} \right) = E_{elec } { } \times {\text{ L}} + \varepsilon_{amp } \times L{ }$$
(1)
$${ }E_{Rx} \left( {L,d} \right) = E_{elec } { } \times {\text{ L }}$$
(2)

\(E_{Tx} \left( {L,d} \right)\) is the energy consumed during the phase of sending an L-bit packet, and \(E_{Rx} \left( {L,d} \right)\) is the energy consumed during the phase of receiving. The total electricity used by electronics in both receiver and transmitter sensor nodes is denoted by the symbol \(E_{elec }\). Equation (3) is used to compute the amplifier’s energy usage during the transmission phase.

$${ }\varepsilon_{amp} = \{ \varepsilon_{fs} \times d^{2} , when d \le d_{0} \varepsilon_{amp} \times d^{4} , when d > d_{0}$$
(3)

where \(d_{0}\) is a threshold related to the sensor node’s transmission model. The multipath propagation channel model is utilized instead. The communication energy parameters are \(\varepsilon_{fs}\) and \(\varepsilon_{amp}\). Equation (4) calculates the value of d0.

$$d_{0} = \sqrt {\frac{{\varepsilon_{fs} }}{{\varepsilon_{mp} }}} .$$
(4)

3.3 Cluster formation using fuzzy logic

Cluster formation in WSNs has a fundamental difficulty with respect to optimal CH selection. Fuzzy logic has proven to be now more helpful to researchers in WSN for choosing the best CH. Fuzzy logic determines three criteria for choosing CH [18, 26,27,28]. To save energy and extend the life of sensor networks, a parameter NC, NOVER, and the remaining energy of SNs are considered. The input variables are described as follows:

3.3.1 Residual energy

The CH will be chosen from the nodes with the best energy. Consider Ei to be the node’s initial energy. After t time has passed, the node’s energy consumption is given as

$$E\left( t \right) = \left( {n_{tpkts } *\alpha } \right) + \left( {n_{rpkis} *\beta } \right)$$
(5)

where ntpkts and nrpkts stand for the quantity of data packets that were sent and received, respectively as given by Eq. (6). The constants fall between (0, 1).

$${ }E{\text{res }} = Ei - E\left( t \right){ }$$
(6)

3.3.2 NC

It identifies the degree to which the chosen CH dominates its neighbors across the whole network. NC can be calculated using Eq. (7).

$${\text{NC}} = \frac{{\sqrt {\frac{{\sum d^{{2(c_{i,j)} }} }}{T}} }}{M}{ }$$
(7)

where d represents the distance seen between CH node and its mobile nodes (Ci, j). T denotes the number of neighbors. M represent the size of the sensing field region.

3.3.3 NOVER

The NOVER technique is used to determine how close together a link’s termination nodes are to one another. A connection with a large NOVER is intended to connect nodes that are all a part of the same network, while a link with a lower NOVER is intended to connect two separate networks. The areas around nodes u and v as determined by N(u) and N(v), respectively is determined using Eq. (8).

$$NOVER \left( {u - v} \right) = \frac{{2*\left| {N\left( u \right) \cap N\left( v \right)} \right|}}{{\left| {N\left( u \right)} \right|{ + }\left| {N\left( v \right)} \right| - 2}}$$
(8)

NOVER will be zero if neither u nor v has any neighbors in common. Therefore, the value of NOVER will range from 0 to 1.

3.4 CH selection using SFO algorithm

An objective function called the fitness function is utilized to ascertain if the sailfish will succeed in reaching the sardine in the search window. Here, we evaluate the fitness function by considering the parameters Residual Energy (RER), Number of Neighbors (NoN), and Distances, which denote the Euclidean distance between the node and the sink.

3.4.1 Residual energy

The Residual Energy (RER) shows the energy that is currently available in the nodes of the performance. The expended energy and the node’s beginning energy are used to calculate the RER. There is an RER computation Eq. (9).

$${\text{RER}}\left( {\text{n}} \right){ } = \frac{{E_{spent} }}{{E_{initial} }}{ }$$
(9)

where \(E_{spent}\) and \(E_{initial}\) represent the energy that is now accessible and the initial energy, respectively.

3.4.2 Distance

The range between the sensor network and the destination nodes is computed using the Euclidean distance equation in Eq. (9) includes the distance calculation, which gives Eq. (10).

$${\text{Distance }}\left( {{\text{n}},{\text{ CH}}} \right){ } = \sqrt {\left( {x_{i} - x_{j} } \right)^{2} + \left( {y_{i} - y_{j} } \right)^{2} } { }$$
(10)

3.4.3 Number of neighbors

The Number of Neighbors (NoN) is the total number of neighbours that are accessible to the specific node I. It is determined by NoN(n) and it is given in Eq. (11).

$${\text{NoN}}\left( {\text{n}} \right){ } = { } \frac{{N_{neighbor} }}{{N_{total} }}{ }$$
(11)

where Nneighbor and Ntotal represent total nodes and the number of neighbors, respectively. Equation (12) displays the generated sailfish fitness function. The weight values might be between 0 and 1. When the weights w1, w2, and w3 are correspondingly 0.33, 0.33, and 0.33, the suggested SOA algorithm performs better.

$$SFish\left( {i,m} \right)_{Fitness} = w_{1} \times \left( {1 - RER\left( {SFish_{i,m} } \right)} \right) + w_{2} \times Distance(SFish_{i,m} ) + w_{3} \times NoN(SFish_{i,m} )$$
(12)

where \(w_{1} ,w_{2} and w_{3} are weight values\)\(.\)

In this work, we developed an assimilation of the Fuzzy with Sailfish Optimizer (SFO) based clustering approach and an improved elephant herding optimization algorithm for efficient routing in WSN.

  • Initially, the number of nodes is divided into several clusters. The fuzzy approach can then select the optimal CH from the appropriate nodes based on the essential measures of NC, residual energy, and NOVER. The fuzzy concept is used to find a better CH node to reinforce and balance the clustering process to increase wireless network lifetime and reduce energy consumption. The fuzzy if then mapping rule is used in the fuzzy logic part that forms CHs from inputs.

  • Fuzzy logic is added as a solution within the SFO’s initial solutions. Furthermore, a new fitness function has been developed to minimize the total intra-cluster distance between each CH node and its cluster members and the inter-cluster distance between the CH nodes and the base station.

  • Finally, the IEHO algorithm routing protocol achieves efficient data transmission. IEHO assesses the quality of links in a routing path. IEHO finds the shortest path between the sources and sink nodes. It enables the routing process on recognized paths through nodes.

3.5 Adaptive sailfish optimizer

In WSN, after clustering, the selection of CH is proposed by ASFO algorithm. It is believed that SFO [29,30,31] is a population-based meta-heuristic algorithm. A candidate’s solutions are thought of as sailfish, and the location of a sailfish is assigned as a problem’s parameter in the search space. The population in the solution space is produced at probability sampling. Depending on the position of the vectors, the search behaviour of sailfish may occur in hyper/three, two, or one-dimensional space. The present position of the ith member, SF, is found at the beginning of the kth search I = 1, 2… m). The SF matrix in Eq. (13) lists the location of every single sailfish.

$${\text{SF}}_{{{\text{position}}}} { } = { }\left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {SF_{1,1} } \\ {SF_{2,1} } \\ \vdots \\ {SF_{d,1} } \\ \end{array} } & \begin{gathered} SF_{1,2} \hfill \\ SF_{2,2} \hfill \\ \vdots \hfill \\ SF_{d,2} \hfill \\ \end{gathered} & \begin{gathered} \cdots \hfill \\ \cdots \hfill \\ \vdots \hfill \\ \cdots \hfill \\ \end{gathered} & \begin{gathered} SF_{1,n} \hfill \\ SF_{2,n} \hfill \\ \vdots \hfill \\ SF_{d,n} \hfill \\ \end{gathered} \\ \end{array} } \right]$$
(13)

The best solution might have gone unnoticed while the search agents’ positions were updated. The process of elitism is necessary since the updated positions may be weaker than the previous ones when compared to them. When elitism is used, the best possible solution(s) is/are obtained. The quickness and flexibility of sardines can be significantly hampered by elite-quality sailfish because of their high fitness level. The expert sailfish and injured sardine positions have intense fitness levels at the ith iteration.

3.5.1 Attack-alternation strategy

Most sailfish hunt is done with impromptu cooperation and typically has a high success rate. The placement of other hunters near the prey school influences where the sailfish choose to hang out. The SFO algorithm validates the sailfish’s attack alternation technique when it engages in group attacks. Within a constricting circle, these sailfish have the potential to strike from every angle. As a result, the location of the sailfish has changed concerning the best solution found in that decreasing circle. This can be obtained using Eq. (14).

$$X_{new\_SF}^{i} = X_{elite\_SF}^{i} - \lambda_{1} \times (round\left( {0,1} \right) \times \left\{ {\frac{{X_{elite\_SF}^{i} + X_{injuredS}^{i} }}{2}} \right\} - X_{oldSF}^{i}$$
(14)

3.5.2 Hunting and catching the prey

Sailfish have much energy at the start of the hunt, and the sardine is likewise in good health and has not run out of energy. Sardines can therefore move fast and are free to flee. Additionally, the sailfish’s movement and position are used by the sardine to update its power and position. The sardine received a new position as Xi new_S during the ith iteration using Eq. (15).

$$X_{inew\_S} = r \times \left( {X_{eliteSF} - X_{oldS} + AP} \right)$$
(15)

The locations of sardines and sailfish are created at random by the SFO algorithm. Depending on elite sailfish and afflicted sardines, each sailfish is updated. The sailfish often complete the sardine position in just one repetition. The objective function determines each sardine and sailfish’s position once their positions have been updated—likewise, the location of damaged sardines and top-tier sailfish changes at every phase of the algorithm. Once the hunted sardine has been taken out, the procedure is repeated till the required condition has been met.

3.6 Efficient shortest path routing using IEHO algorithm

The elephants’ social behaviors are the central theme of EHOA. One of the most crucial creatures for preserving the biodiversity of forests is the elephant. Elephant species can be found all over the world. As with any other social animal, these elephants typically live-in herds. Each group consists of several clans. Each clan has a matriarch who will act as the group’s head. The matriarch refers to the oldest female elephant in the herd. A few female elephants and their kids make constitute a clan. The male elephants will decide to live apart once they are adults. However, it has been shown that male elephants use low-frequency vibrations to talk to their neighbours. By creating three guidelines, the elephant herding behaviour is used to address optimization problems [32,33,34,35]. Figure 2 shows the proposed hybrid Fuzzy with sailfish optimizer and IEHO algorithm.

Fig. 2
figure 2

Proposed hybrid Fuzzy with sailfish optimizer and IEHO algorithm

The EHOA initially defines the population size (Npop) and the number of iterations. An elephant’s placement indicates a solution. There are a fixed number of clans in the population, each having a predetermined number of elephants [14, 36,37,38]. The elephants’ positions are decided at random. The function f value is calculated for each elephant. An elephant regarded as the clan’s matriarch has the highest objective function value. The clan operational operator, which takes the matriarch’s position into account, updates the positions of the other elephant in the clan. When an elephant does poorly objectively, it will quit the clan [39,40,41,42,43,44,45,46,47]. This is accomplished by using the separation operator. The population of elephants has been updated. The procedures above are repeated until the necessary number of iterations to establish a new population have been finished.

3.6.1 IEHO algorithm

Some enhancement has been made to the Improved Elephant herd optimization algorithm (IEHOA).

  1. (1)

    One of the early options is favored to use a dispatching rule rather than randomly producing an initial population of elephants. This would be applied to raise the calibre of the solutions.

  2. (2)

    Elephant mating behaviour was not considered in the EHOA reviewed in the literature. The activity of male and female elephants during mating is examined in the current paper.

  3. (3)

    The solution in the EHOA can become trapped at locally optimal. The fundamental IEHOA is enhanced with a local search mechanism to prevent this.

The following lists the processes in the IEHOA:

An integer vector represents each member of the population with a dimension of 2N, where N is the total number of unknown sensor nodes. There are originally n clans that make up the population. The effect of the matriarch ci, who has the greatest fitness value in the creation, on each answer j in the clan ci is used to represent the updating operator which can be obtained using Eq. (16).

$$x_{new,ci,j} = x_{ci,j} + \alpha \times \left( {x_{best,ci} - x_{ci,j} } \right) \times r$$
(16)

where \(x_{new,ci,j}\) denotes the new role of solution j within clan \(ci\), \(x_{ci,j }\) is the previous position of individual j within clan \(ci\), and \(x_{best,ci}\) denotes the best solution within clan \(ci\) so far discovered. Matriarch \(ci\) influence on \(x_{ci,j }\) is indicated by the scale factor [0; 1], while the random variable [0; 1] r has a uniform distribution. The fittest response in each clan \(ci\) is updated using the following expression [20].

$$x_{new,ci,j} = \beta \times x_{center,ci}$$
(17)
$$x_{center,ci,d} = \frac{1}{{n_{ci} }} \times \mathop \sum \limits_{j = 1}^{d} x_{ci,j,d} { }$$
(18)
$$x_{worst,ci} = x_{min} + \left( {x_{max} - x_{min} + 1} \right) \times rand$$
(19)

where \({x}_{max}\) and \({x}_{min}\) stand for the individual’s upper and lower bounds of position, \({x}_{worst,ci}\) denotes the member of clan ci with the worst fitness, and rand [0; 1] is a random variable generated via uniform distribution. Algorithm 1 contains the pseudo-code for the EHO algorithm.

figure f

4 Results and discussion

The proposed approach is implemented in MATLAB 2021b. The performance of the suggested technique outperforms the present clustering and routing protocols created by PSO [36], GA [37], IABC-C [38], and HCCHE. The performance parameters of system lifetime, energy consumption, throughput, bit error rate, end-to-end delay (E2ED), buffer occupancy, and packet delivery ratio (PDR) are computed using 500 nodes and compared to existing methods. The proposed method outperforms existing methods in terms of performance parameters such as packet delivery ratio, throughput, energy consumption, end-to-end delay, packet loss ratio, buffer occupancy, network lifetime, jitter, and bit error rate. The MATLAB software is used for simulation. In comparison to PSO, the throughput has increased by 46.26%. This QoS improvements provide better solution for real world WSN deployments. The simulation parameters are presented in Table 1.

Table 1 Simulation parameters

Table 2 presents the results of the evaluation of the proposed PDR model’s analysis using various existing methods. Figure 3 shows that the PSO strategy attained a low PDR. At the same time, the GA framework has achieved a moderate PDR compared to the earlier models. However, PDR has been marginally improved using IABC-C technology. The HCCHE approaches have also shown significant PDR. The suggested method, however, has demonstrated exceptional results with increased PDR. In terms of the sample, the suggested framework has a maximum PDR of 99.8%, whereas the HCCHE, IABC-C, GA, and PSO techniques have the lowest PDRs at 98, 96, 94.5, and 92%, respectively.

Table 2 Packet delivery ratio (%)
Fig. 3
figure 3

Comparison of packet delivery ratio

The suggested model’s throughput analysis is compared to several earlier methods in Table 3. The results suggest that the PSO model gains throughput at a lesser rate. In the interim, the GA framework outperformed the compared  techniques with respect to throughput. The IABC-C technology has achieved a little higher throughput. Similarly, the HCCHE approach achieved improved throughput. The suggested approach has demonstrated qualified outcomes with increased throughput. For instance, under a node count of 100, the suggested framework achieved a maximum throughput of 98, whereas the HCCHE, IABC-C, GA, and PSO technologies achieved low throughput of 89, 80.5, 78, and 67 bps, respectively.

Table 3 Throughput (bps)

The energy-saving analysis of the Fuzzy with SFO approach in terms of energy consumption is shown in Fig. 4. The PSO model was shown to be ineffective in Fig. 4 by achieving a maximal energy dissipation. Additionally, the GA model demonstrates a somewhat better energy dissipation than the preceding approach. The IABC-C model has shown modest outcomes with an average amount of energy dissipation compared to earlier techniques. Additionally, the HCCHE model has come close to achieving its ideal level of energy dissipation. Finally, the suggested model has achieved the lowest energy dissipation compared to other strategies. For instance, the Fuzzy with SFO model has reduced energy dissipation by 10.90 mJ under the maximum node count of 100, whereas the HCCHE, IABC-C, GA, and PSO models have gotten a more significant energy consumption of 66, 76, 146, and 154 mJ respectively.

Fig. 4
figure 4

Comparison of energy consumption

The End-to-End (ETE) delay assessment of the Fuzzy with SFO method is shown in Fig. 5, along with a selection of existing methods. The graph suggested that by achieving a longer ETE delay, the PSO strategy is inconsequential. A moderate ETE delay was achieved by the GA framework in comparison to the conventional framework. Additionally, the IABC-C method has demonstrated superior results with respect to the typical ETE delay compared to the conventional models. Accordingly, the HCCHE approach has improved and has an equivalent ETE latency. In addition, the proposed method has a lower ETE delay than the conventional methods. The larger node count of 100 yielded a minimum ETE delay of 1.12 s for the suggested scheme and maximum ETE delays of 3.98, 5.28, 6.87, and 7.13 s for the HCCHE, IABC-C, GA, and PSO frameworks, respectively.

Fig. 5
figure 5

Comparison of End to End delay

The proposed packet loss ratio values are presented in Table 4 using various conventional methods. By reaching a more excellent packet loss ratio, the PSO architecture was observed in Fig. 6 to perform poorly. Additionally, the GA approach achieved a significant packet loss ratio above the comparative model. Then, as compared to earlier technologies, the IABC-C scheme achieved improved results with the average packet loss ratio and the HCCHE model achieved its optimal packet loss ratio. As a result, among all the earlier strategies, the suggested model achieved the lowest packet loss ratio. For instance, the proposed approach achieved a low packet loss ratio of 0.6% with a higher node count of 100. In contrast, the HCCHE, IABC-C, GA, and PSO models obtained maximum packet loss ratios of 2, 4, 6, and 7%, respectively.

Table 4 Packet loss ratio
Fig. 6
figure 6

Packet loss ratio

The buffer occupancy capability of the suggested (Fuzzy with SFO) and existing techniques are displayed in Fig. 7. As the number of nodes increases, the buffer occupancy decreases. The suggested system has a high (26%) buffer occupancy of 100 nodes compared to existing approaches. Current approaches such as HCCHE, IABC-C, GA, and PSO each have a buffer occupancy of 23, 20, 19, and 15.5% in 100 nodes, respectively.

Fig. 7
figure 7

Buffer occupancy

The network lifespan analysis of the suggested strategy using various existing techniques is presented in Table 5. Figure 8 demonstrates how the PSO algorithm achieves the shortest network lifespan. In addition, the GA model has a marginally longer network lifetime compared to the existing model. The IABC-C model, however, has made efforts to improve network longevity. The HCCHE model has also produced a relatively minimum network lifespan. The suggested model, however, has shown higher performance with the most extended network lifetime. The HCCHE, IABC-C, GA, and PSO models, for example, produced minimal network lifetimes of 4900, 4700, 4200, and 4000 rounds, respectively, whereas the suggested model produced a higher network lifespan of 5400 rounds with a node count of 100.

Table 5 Network life time (rounds)
Fig. 8
figure 8

Comparison of network lifetime

The jitter performance is shown in Fig. 9. The results show that the 100 nodes is closely matched with existing techniques, and our suggested (Fuzzy with SFO) method achieves a low jitter of 0.54 ms. The jitter performance degrades as the number of nodes increases. The jitter performance of the present schemes HCCHE, IABC-C, GA, and PSO is 0.62, 0.71, 0.75, and 0.85 ms, respectively, in 100 nodes. The BER performance is shown in Fig. 10. The 100 nodes matched the existing techniques, and the suggested (Fuzzy with SFO) method achieves a low BER of 4. The BER performance increases as the number of nodes increases. The BER performance of the present schemes HCCHE, IABC-C, GA, and PSO is 6, 8, 11, and 16, respectively, for 100 nodes.

Fig. 9
figure 9

Comparison of Jitter

Fig. 10
figure 10

Bit Error Rate

4.1 State of the art algorithm

The suggested IEHO method uses the WSN’s transmission characteristics to ensure that the best node is chosen for transmission, thereby improving the WSN’s throughput and performance. Power consumption is a crucial factor when assessing the performance of wireless sensor networks because it depends on data processing, transmission power, and the best cluster selection. All of these concerns about WSN cluster heads (CH), routing protocols, and node performance are addressed in the present research. Table 6 presents a comparison of the proposed approach with state-of-the-art algorithms. The introduced Fuzzy with ASFO algorithm provides a better CH selection. The ASFO algorithm finds the best CH node to improve the WSN energy usage. The suggested technique also limits its attention to locating the shortest path with the fewest iterations compared with other GA, PSO, HCCHE, IABC-C algorithms.

Table 6 Comparison of the proposed approach with State-of-the-art algorithms

5 Conclusion

In this paper, the shortest path and data reliability has been achieved using the proposed enhanced elephant herd optimization (IEHO) routing protocol. For cluster creation and cluster head (CH) selection, the Fuzzy with Sailfish Optimizer (SFO) technique was used, which proved to be the best algorithm for sending data from the transmitter to the receiver without any data loss. The suggested solution outperforms the methods currently used in packet delivery ratio (PDR), packet delay, throughput, energy use, packet loss ratio, end-to-end latency, network lifetime, and bit error rate. The results achieved are the packet delivery ratio (99.8%), packet latency (1.12 s), throughput (98 bps), energy usage (10.90 mJ), network lifetime (5400 cycles), and packet loss ratio (0.6%). Compared to the current GA, PSO, IABC-C, and HCCHE techniques, the proposed Fuzzy with SFO method performs better than other existing algorithms. Sailfish Optimization’s performance depends on various factors, including the population size, maximum iterations, and search interval. It is difficult to modify these parameters for various problem areas. When used to solve complex optimization problems or issues with many choice factors, IEHO was observed to be computationally expensive. Researchers frequently adjust parameters, use hybrids of other algorithms, or employ metaheuristics to enhance their performance on specific optimization issues to overcome these restrictions. Also, privacy preservation is an essential challenge to maintain trust of transmitted data and minimize the energy usage in WSN-IoT Applications. In the future, the authors intend to propose a prediction-based efficient data transmission method for wireless sensor networks (WSNs).