1 Introduction

Wireless sensor network (WSN) is a transition framework that has huge amount of spatially distributed nodes armed by micro sensors [1]. These smaller devices are utilized for sensing the data from certain areas and combined for collecting and processing. Data are later transferred to base station. Though WSN has presented for more than a few years, it is a major element of Internet of Things (IoT) based service and product. In fact, it plays a major part in several upcoming IoT application situations like smart cities, healthcare, and environmental monitoring [2, 3]. Sensors are compactly placed and they are constrained in memory, power, and computation capacities.

Based on the system framework and application needs sensor location should be recognized. Due to this, a SN should have a locating device [4]. However this is impossible in few situations, hence a localization scheme must be capable of self-localizing and offer a precise result without the utilization of additional hardware. Localization is a complex problem for several applications particularly for mobile enabled WSN when path planning is a major consideration [5]. A broad study was located for two dimension and static based schemes, however, no other method gives a precise result for mobile based WSN. The Global Positioning System (GPS) is employed, however, because of its severe need of the line of sight situation, GPS isn’t an accurate result [6]. Moreover, GPS isn’t often available and does not function on indoor platform. Additionally, the cost of GPS receiver is expensive, and it utilizes high energy compared to small sensor component. Furthermore, a mobile node always altering its location hence equipping a locating device doesn’t make it possible for accomplishing its process in a provided timespan. A WSN has (1) wire/wireless interconnected network; (2) localized or distributed nodes; (3) a application system; and (4) information cluster located in a central point. Indeed, the key computations are mainly made with the network, due to the huge quantity of techniques, data, and algorithms employed with the scheme [7]. All the sensor network application requires measuring the location of the SN hence all the system needs a method that is free from additional communication and hardware costs. Moreover, a localization scheme can self-localize and standardize in the event of other environmental modifications.

The design of an effective energy routing system is the major concern in WSN. The routing mechanism [8, 9] is significant in WSN since they give latency, lesser energy utilization, data throughput, and Quality of Service (QoS). Several protocols are developed to overcome the problem caused while routing the data packet. The present protocol solves the energy problems in WSN which is ranging from physical to application layer. The multihop routing helps the routing with the help of the network over the transmission range that is limited with energy factors. Now, delay was decreased, however, the energy utilization is higher and so, the routing should store the energy. Thus, researcher aim is to design an energy effective routing system [10]. The multihop routing system is depending upon 2 distinct classifications, data centric routing system, and Location routing system. The data centric routing utilizes sink node to transmit the enquiries to certain region [11]. Also, the hierarchical routing is used to maintain the energy utilization between the SNs by multihop transmission to reduce the transferred message to the BSs. A distinct routing protocols for sensor networks is implemented that requires position data of the nodes for additional processes. Now, the position data is utilized to compute the distance among the 2 nodes and evaluate the utilized energy.

This paper presents a novel metaheuristic optimization based NL and multihop routing protocol with mobile sink (MONL-MRPMS) for WSN. The MONL-MRPMS technique involves an efficient Coyote Optimization Algorithm (COA) for NL, (COA-NL) in WSN with the consideration of Euclidian distance as fitness. In addition, sea gull optimization based multihop routing (SGO-MHR) protocol is designed for the optimal selection of routes. Furthermore, a MS with route alteration strategy is employed to modify the routes depending upon the movement of MS. Extensive simulation results are performed to emphasize the improved performance of MONL-MRPMS algorithm over the recent techniques. The major contribution of the study are briefly discussed in the following.

  • An intelligent MONL-MRPMS technique, encompassing COA-NL and SGO-MHR technique is developed for WSN.

  • Design a new COA-NL technique for finding the position of unknown nodes based on the ACN and distance metric.

  • Develop a new SGO-MHR technique for optimal route selection strategy with a fitness function including 3 metrics, residual energy (RE), node degree, and distance to sink.

  • Employ a MS with route adjustment scheme to attain energy efficacy and connectivity in the network.

The rest of the paper is planned here. Section 2 analyses the recent NL and routing techniques in WSN. Section 3 provides the system architecture. Section 4 discusses the MONL-MRPMS technique and Sect. 5 explains the stimulation outcomes. Lastly, Sect. 6 concludes the paper.

2 Related Works

2.1 Existing Works on Node Localization

This section reviews the existing NL techniques particularly developed for WSN using metaheuristic algorithms. Range based localization, a 2D optimization problem was tackled by [12] as a multistage exercise with biologically inspired metaheuristics. The study developed a modified shuffled frog leaping algorithm (MSFLA) for the NL. Strumberger et al. [13] enhanced basic version of the tree growth method and the elephant herding optimization SI metaheuristic approach and employed them for solving the problems of WSN localization. In Kanoosh et al. [14], a NL method was projected according to new bioinspired method named Salp Swarm Algorithm (SSA) The projected technique was executed and authenticated in WSN deployment with the help of distinct amount of anchor and target nodes (TNs). In Han et al. [15], DEIDV Hop is projected, an improved wireless SN localization method depending upon enhanced DV-Hop method and the differential evolution (DE) that enhances the problem of possible errors with respect to average distance.

Mihoubi et al. [16] a robust Bat algorithm is desgined for the NL problem, the efficiency depends on the adaptation of velocity of Bats with hybridization, with Doppler Effect to increase the efficacy, known as Dopeffbat and iteratively compute the node location by the Euclidian distance as fitness. In Mihoubi et al. [17], projected an Enhanced Fruit Fly Optimization Algorithm (EFFOA) for solving the localization. The presented method has a robust capability for calculating the location of unknown nodes and converge iteratively towards the optimal solution. Yadav et al. [18] proposed an iterative Hessian regularization method for node. In Wu et al. [19], a hybrid adaptive MCB-PSO NL method is presented to 3D MWSN that consider unknown and mobility of ACN. An enhanced PSO method is developed by Monte Carlo localization boxed (MCB) for mobile node localization.

2.2 Existing Works on Multi-Hop Routing

This section discusses the recent multi-hop routing techniques developed for WSN using metaheuristic algorithms. In Sahoo et al. [20], proposed a hybrid mechanism that considers the GA and PSO methods correspondingly for BS mobility and CH election. The strong behaviour of GA aids in enhanced the CH selection, where, PSO assists in detecting an improved route for BS mobility. Wang et al. [21] maximized the survival time of WSN routing with a sink node with the development of an effective routing method depending upon best hybrid metaheuristic optimization method. This technique comes as an original system which creatively combines the global search ability of the PSO method, variance operator of differential method, and pheromone of ACO method for avoiding local search and retains population diversity. Barzin et al. [22], proposed a Multi Objective nature inspired method named MOSFA with distinct conditions (viz., distance from the sink, RE of nodes, load of clusters, overlap, inter and intra cluster distances,) for selecting a proper CH at every rounds. Furthermore, other multi objective functions are presented for selecting the forward nodes in the routing stage.

Vinodhini and Gomathy [23] presented a MOMHR technique for optimum data routing for gaining the network lifespan. Initially, the K-means algorithm is exploited for splitting the nodes to k clusters. Then, the ABC optimisation method is employed for obtaining an optimal CH with every clusters after utilizing a multiobjective function lastly the multihop routing protocol detect a multi hop path with minimal transmission cost from node to BS. In Singh et al. [24], a combined altered GA for CH selection in WSN is presented for increasing the network lifespan represented by ModifyGA. The energy efficacy of ModifyGA is improved by combining dynamic criteria and sensing range is utilized to develop FF.

Benmahdi and Lehsaini [25] proposed a new routing protocol by GA and K-means technique for expanding the network lifespan in WSN. They involved k-means technique for creating cluster where CH is chosen according to distance, RE, and the existence of nodes condition as CH. Furthermore, they utilize GA method for establishing CH to CH routes from nodes to BS. Vinitha et al. [26] designed an energy effective routing in WSN by y hybrid optimization method, C-SSA elects an optimal hop in developing the routing. Firstly, the CH is elected by the LEACH protocol which reduces the network traffic. Rathore et al. [27] designed a hybrid whale and GWO (WGWO) based clustering method for energy harvesting (EH) WSN. In the presented study, they utilize 2 Metaheuristic methods, such as whale & grey wolf for increasing the efficacy of the clustering method. The exploration and exploitation abilities of the projected hybrid WGWO method are greater compared to conventional present metaheuristic method in the assessment.

3 System Model

Given that network using \(N\) sensor in a targeted area with \(R\) transmission range. The \(N\) SN is represented as: \(\{{N}_{1}, {N}_{2}, \dots , {N}_{n}\}\). A MS is positioned in the sensing area it moves freely in the located area. Some assumptions are provided as follows.

3.1 Network Model

In the node placement, the succeeding network module and few assumptions are compared with sensors are given.

  • Every sensor are homogenous

  • The sensor is immobile and placed arbitrarily in the network

  • The sink is mobile and the moving trajectory of sink is predetermined by the unlimited energy and broadcast radius.

  • Each SN is disseminated to a distinctive ID in the IoT.

  • Based on the communication distance, the broadcast power of SNs could be changed.

3.2 Energy Model

Since the battery in IoT based WSN is fixed and it is impossible to recharge or replace, the available energy need to be properly used for prolonging lifespan of the network. The sensor consumed energy for distinct processes includes data reception, sensing, transmission, and processing. Previous research reported that masses of sensor energy is consumed for transmitting data. The study used initial order radio energy module and displayed in Fig. 1. The quantity of energy \(E_{tx}\) required to transfer \(k\) bit data on the distance \(d\) is given in Eq. (1).

$$\begin{aligned} E_{tx} = & E_{elec} \left( k \right) + E_{amp} \left( {k,d} \right) \\ = & \begin{array}{*{20}c} {kE_{elec} + kE_{fs} d^{2} ,{ }d < d_{0} } \\ {kE_{elec} + kE_{mp} d^{4} ,{ }d \ge d_{0} } \\ \end{array} \\ \end{aligned}$$
(1)
Fig. 1
figure 1

First order radio energy model

In Eq. (1), the radio electron energy can be represented as \(Elec\), and transmitter amplification energy has free space propagation energy \({E}_{fs}\) is denoted by \({E}_{mp}\) is formulated in the subsequent formula:

$$d_{0} = \sqrt {\frac{{E_{fs} }}{{E_{mp} }}}$$
(2)

When the transmission distance doesn’t go beyond \({d}_{0}\), \({E}_{fs}\) is used and when it goes beyond \({d}_{0}\), \({E}_{mp}\) is exploited. Also, the energy expended for receiving \(k\) bits of data can be expressed as:

$$E_{rx} = E_{elec} \times k$$
(3)

4 The Proposed MONL-MRPMS Model

The overall framework of the MONL-MRPMS approach is demonstrated in Fig. 2. The figure demonstrated that the WSN nodes are placed arbitrarily in the environment. The proposed MONL-MRPMS technique involves two major stages namely COA-NL based node location, SGO-MHR based route selection, route alteration with MS. The working process can be briefly deliberated in the following.

Fig. 2
figure 2

Overall process of proposed model

4.1 Design of COA-NL Technique

Once the nodes are initialized, the COA-NL technique gets executed to determine the actual locations of the SNs. COA is developed depending upon the metaphor of the social lives of coyotes. The coyote’s population is separated into smaller groups/packs.

All the groups are usually made up of alpha pairs of female and male coyotes. Additionally, coyotes are living in a group, occasionally they left the group for joining other groups. Depending upon social life of coyote, COA can be modified to resolve the optimization problems. In this work, the population is separated to \({N}_{p}\) packs using \({N}_{c}\) coyotes in all the packs. The social circumstance of all coyotes (sc) denoted using \([{x}_{1},{x}_{2},\)…,\({x}_{D}]\) is deliberated as a solution to the optimization issue which has \(D\) parameter and the alteration of all coyotes to the setting is given using adaptive function \((f)\) value of the issue. With all groups, the coyote using optimum adaptive function value is chosen as alpha \((al)\). Consider, in COA alpha is deliberated in all the groups. The social lives of arbitrarily chosen coyote in the pack is given by:

$${\text{new}}_{ - } {\text{sc}}_{c}^{p} = {\text{sc}}_{c}^{p} + {\upmu }_{1} \times \left( {al^{p} - {\text{sc}}_{r1}^{p} } \right) + {\upmu }_{2} \times \left( {st^{p} - {\text{sc}}_{r2}^{p} } \right)$$
(4)

where \({\text{sc}}_{c}^{p}\) denotes social condition of cth coyotes in pth packs using \({\text{c}} = 1\), 2,..., \(N_{c}\) and \({\text{p}} = 1\), 2,..., \(N_{p} .\) \(N_{p}\) and \(N_{c}\) indicates amount of packs and coyotes in all the packs. \({\upmu }_{1}\) and \({\upmu }_{2}\) is arbitrary amount in zero and one \(.\) \(a{l}^{p}\) and \(s{t}^{p}\) represents alpha and the social trend of pth packs. \({\mathrm{sc}}_{r1}^{p}\) and \({\mathrm{sc}}_{r2}^{p}\) denotes social condition of arbitrarily chosen coyote in the pth packs.

When the adaptation of novel social condition is higher compared to the present social condition, they would be chosen as social condition of corresponding coyote [28]. Else, when the adaptation of novel social condition is worsened compared to the present social condition, then the social conditions won’t be upgraded. When the social condition of all the packs is rehabilitated. The coyote using worst social condition equivalent to the worst environment adaption would be decease and be substituted with novel coyote (pup) born by the communication of the coyote is given by:

$$x_{{pup_{;} j}}^{p} = \left\{ {\begin{array}{*{20}l} {x_{{r1,j}}^{p} ;} \hfill & {if~\mu _{{3,j}} < pr_{1} } \hfill \\ {x_{{r2,j}}^{p} ;} \hfill & {if~\mu _{{3,j}} < pr_{1} + pr_{2} } \hfill \\ {x_{{r,j}}^{p} ;} \hfill & {otherwise} \hfill \\ \end{array} } \right.$$
(5)

where \({x}_{ne\mathrm{w},j}^{p}\) denotes \(j\) th parameter of the social condition of the novel coyote. \({x}_{r1,j}^{p}\) and \({x}_{r2,j}^{p}\) indicates \(j\) th parameter of the 2 arbitrarily chosen coyotes in the \(p\) th pack. \({x}_{\mathrm{r},\mathrm{j}}^{p}\) denotes arbitrarily created parameter in the permitted range of the \(j\) th parameter. \({\upmu }_{3,j}\) denotes \(j\) th arbitrary amount in zero and one \(.\) \(p{r}_{1}\) and \(p{r}_{2}\) aredetermined by:

$$\left\{ {\begin{array}{*{20}l} {pr_{1} = { }1/D} \hfill \\ {pr_{2} = \left( {1 - pr_{1} } \right)/2} \hfill \\ \end{array} } \right.$$
(6)

whereas \({\text{D}}\) indicates dimension of the problem. The last stage is the interchange of social conditions among groups as defined by:

$${\upmu }_{4} < 0.005 \times N_{c}^{2}$$
(7)

where \({\upmu }_{4}\) denotes arbitrary amount in zero and one\(.\)

The COA-NL localization approach is exploited to determine the coordinate point of the sensor. The study aims to measure the coordinate points of desirable node by decreasing the objective function. Considered localization problems of WSN as an optimization problems developed using several metaheuristic methods. The provided approach was utilized to locate the sensors in WSN:

  1. 1.

    Place \(M\) target and \(N\) ACN in an arbitrary way in the sensor region. All the ACN are made up of location attentiveness to identify the location. All the anchor and TNs encompass transmission range \(R\).

  2. 2.

    Distance between target and ACN are assessed and modified by means of additive Gaussian noise. The TN defines the distance by \({\widehat{d}}_{i}={d}_{i}+{n}_{i}\) while \({d}_{i}\) represents real distance which was evaluated amongst the location of the TNs \((x, y)\) and location of beacon \(({x}_{i},{y}_{i})\) using the provided task:

    $$d_{i} = \sqrt {(x - x_{i} )^{2} + (y - y_{i} )^{2} }$$
    (8)

The variable \({n}_{i}\) denotes the noise that affect the expected distance from \({d}_{i}\pm {d}_{i} (\frac{{P}_{n}}{100})\) whereas \({P}_{n}\) denotes ratio of noise in the evaluated distance.

  1. 3.

    The desirable nodes are called as localizable node once it encompasses three ACN in the communication radius of the TN. A cause after this need is depending upon trilateral positioning module, coordinate of three ACN \(({x}_{1}, {y}_{1}),\) \(B({x}_{2}, {y}_{2})\), and \(C({x}_{3}, {y}_{3})\), and the distance between TN \({d}_{i}\) and three ACN are identified. Afterward, the application of trigonometric laws of sine/cosine, the coordinate of TN is defined. Likewise, in multi alteration TN evaluated module, distance metrics of huge ACN are employed to reduce the error from an original distance and estimated distance.

  2. 4.

    For the localizable node, the COA-NL technique can be autonomously performed to find the position of the TN. The coyotes are enforced by the centroid of ACN within transmission radius by the provided task:

    $$\left( {x_{c} , y_{c} } \right) = \left( {\frac{1}{N}\mathop \sum \limits_{i = 1}^{N} x_{i} , \frac{1}{N}\mathop \sum \limits_{i = 1}^{N} y_{i} } \right)$$
    (9)

Whereas \(N\) denotes total amount of ACN within the broadcast range of the localizable TN.

  1. 5.

    The COA-NL methodology is used for finding \((x, y)\) coordinates of the TN that decreases the localization error (LE). The primitives employed in localization problem is a mean square distance between target and ACN which is decreased by the application of provided concept:

    $$f\left( {x, y} \right) = \frac{1}{N}\left( {\mathop \sum \limits_{i = 1}^{N} \sqrt {(x - x_{i} )^{2} + (y - y_{i} )^{2} } - \hat{d}} \right)^{2}$$
    (10)

Whereas \(N \ge 3\) denotes amount of ACN within a transmission radius of TN.

  1. 6.

    The optimum measure \((x, y)\) was defined by COA-NL module when the amount of rounds are constrained.

  2. 7.

    The total LEs are defined when evaluating the localizable TNs \({N}_{L}\). It can be estimated as the mean square of distance from the \(({X}_{i}, {Y}_{i})\) coordinates where the original \(({x}_{i}, {y}_{i})\) coordinates are given by:

    $$E_{1} = \frac{1}{{N_{1} }}\mathop \sum \limits_{i = 1}^{N} \sqrt {(x_{i} - X_{i} )^{2} + (y_{i} - Y_{i} )^{2} }$$
    (11)
  3. 8.

    The process of two to six is continued until the TN is localized. The localization module is based on the maximal LE \({E}_{1}\) and amount of unlocalized nodes \({N}_{{N}_{L}}\) are defined in the application of \({N}_{{N}_{L}}=M-{N}_{L}\). The minimal score of \({E}_{1}\) and \({N}_{{N}_{L}}\) improves an efficient localization.

The amount of NL gets improved as an iteration improves. Likewise, it reduces the ACN amount within the transmission radius of the localizable TN, and estimated position of the TN act as an ACN. It is exploited to limit the problem of flip uncertainty which makes maximal LE. Therefore, process duration to localization information of the TN improves once the iteration is enhanced.

4.2 Design of SGO-MHR Technique

During the route selection process, the SGO-MHR approach is employed to select an optimum set of routes to destination. SOA method is based on the attack and migration behaviors of seagulls in nature. They are so smart birds which make use of their wisdom for searching food and attacking prey. Especially, they use their feet for mimicking the rain sound to attract the hidden underground earthworms and utilize breadcrumbs for attracting fish. The essential behavior of the seagulls are migration and attack strategies. Attack behavior is determined by the attack behavior from the seagulls towards the bird migrating at sea. Migration behavior is determined by the source of food for seagulls. During migration, the method mimics how seagulls migrate everywhere. In this phase, seagulls should see the succeeding scenarios [29]. For avoiding collisions among seagulls and nearby seagulls, parameter A is included for calculating the novel search agent position. Figure 3 illustrates the process flow of SOA.

$$\vec{C}_{s} = A \times \vec{P}_{s} ,$$
(12)

whereas the position of search agent can be denoted by \(\vec{C}_{s}\), \(\vec{P}_{s}\) signifies existing position of search agent, \(x\) shows existing iteration, and \(A\). represent the mobile behavior of search agent.

$$A = f_{c} - \left( {x \times \left( {\frac{{f_{c} }}{{{\text{Max}}_{{{\text{iteration}}}} }}} \right)} \right)$$
(13)
Fig. 3
figure 3

Process flow of SOA

Equation (13): \(x = 0, 1, 2, \ldots , {\text{Max}}_{{{\text{iteration}}}} ,\) while \(f_{c}\) denotes for controlling the usage frequency of \(A\) parameter, that is declined linearly from fc to \(0\), and \(f_{c}\) is fixed to two.

$$\vec{M}_{s} = B \times \left( {\vec{P}_{bs} \left( x \right) - \vec{P}_{s} \left( x \right)} \right),$$
(14)

In Eq. (14), \(\vec{M}_{s}\) denotes location of search agent \(\vec{P}_{s}\) indicates optimal search agent \(P_{bs}\) represents optimum seagull using smaller fitness value). The behavior of \(B\) is random that is in charge of appropriate balancing amongst exploitation and exploration.

$$B = 2 \times A^{2} \times {\text{rd}},$$
(15)

Now, \(rd\) symbolizes arbitrary amounts ranges from 0 to 1\(.\) Lastly, the search agent upgrades the location comparative to better search agent.

$$\vec{D}_{s} = \left| {\vec{C}_{s} + \vec{M}_{s} } \right|,$$
(16)

Let \(\vec{D}_{s}\) be the distance amongst the search agent and optimal search agent (optimum seagull where the fitness value is lesser). During prey attack, seagulls would spiral movement behavior as follows:

$$x^{\prime} = r \times {\text{cos}}\left( k \right),$$
(17)
$$y^{\prime} = r \times {\text{sin}}\left( k \right),$$
(18)
$$z^{\prime} = r \times k,$$
(19)
$$r = u \times e^{kv} ,$$
(20)

whereas radius of every turn of spiral can be symbolized as \(r\) and arbitrary amount within \(\left[0, 2\pi \right]\) range is indicated as \(k.u\) and \(v\) represents constant that determines the spiral shape, and \(e\) characterizes base of natural logarithm.

$$\vec{P}_{s} \left( x \right) = \left( {\vec{D}_{s} \times x^{\prime} \times y^{\prime} \times z^{\prime} } \right) + \vec{P}_{{bs}} \left( x \right),~$$
(21)

Here \(\vec{P}_{s} \left( x \right)\) save a better solution and other search agent position can be upgraded. For multi-hop routing technique, the fitness score of seagulls denotes a whole path from CHs to BS. Assume \(M_{1i} = \left[ {Y_{i,1} \left( t \right),{ }Y_{i,2} \left( t \right),{ }Y_{i,3} \left( t \right),{ }Y_{i,4} \left( t \right), \ldots ,Y_{i,D} \left( t \right)} \right]\) be \(it\) seagull from a Pop. The feature of seagull is similar to amount of CHs, where the element \(Y_{i,d} \left( t \right)\) selects future hop CH ID which is represented by the transmission of CH, \(1 \le i \le N_{M1} ,1 \le d \le D.{ }\)

$$M_{{{\text{l}}i = }} \left[ {Y_{i,1} \left( t \right),{ }Y_{i,2} \left( t \right),{ }Y_{i,3} \left( t \right),{ }Y_{i,4} \left( t \right),{ }Y_{i,D} \left( t \right)} \right]{ }$$
(22)

The generator seagull is utilized for selecting the future hop CH within a transmission range. The employed module is autonomous for the early generation of seagulls. The derivative of the possible energy function is depending upon the provided features.

Remaining energy level The major goal of this variable is that CH for forthcoming hop node is depending upon on RE of subsequent hop node. A CH node could select the upcoming hop CH on probable hop nodes where it has maximal RE.

Objective 1: Maximalize

$$g_{1} = \mathop \sum \limits_{{j = {\text{l}}}}^{m} NextHop\left( {E_{R} \left( {CHj} \right)} \right)$$
(23)

Distance to BS Every CHs to following hop node, is based on distance from concerned node to sink and the distance to future hop nodes.

Objective 2: Minimalize

$$g_{2} = \mathop \sum \limits_{{j = {\text{l}}}}^{m} {\text{dis}}(CH_{j} ,{\text{ Next}}\;{\text{Hop}}\left( {{\text{CH}}_{j} } \right) + {\text{dis}}\left( {{\text{Next}}\;{\text{hop}}\left( {{\text{CH}}_{j} } \right),{\text{ BS}}} \right)$$
(24)

Node degree The main aim of every CHs to the following hop node is depending upon node degree. The CH is stated to the future hop node using low node degree.

Objective 3: Minimize

$$g_{3} = \mathop \sum \limits_{{j = {\text{l}}}}^{m} {\text{Node}}\; {\text{degree}}\;{\text{ of}}\;{\text{ Next}}\; {\text{Hop }}\left( {CHj} \right)$$
(25)

It has employed the weight summation method for optimization procedure since the aims are susceptible to each other.

Minimalize

$${\text{Potential}}\;{\text{ energy}}\; {\text{function}} = \beta_{1} \times 1/g_{1} + \beta_{2} \times g_{2} + \beta_{3} \times g_{3}$$
(26)

where \(0 < \beta_{1} ,\beta_{2} ,\beta_{3} < 1 and 0 < g_{1} ,{ }g_{2} ,{ }g_{3} < 1\).

Then, the MOSSA CR method would select the following hop node using maximal energy function. Later, the CH forwards the aggregated data from its member to BS through the selected optimum path.

4.3 Route Adjustment Scheme of MS

The MS is broadly utilized as load balancing and routing in IoT based WSN. The MS aids to attain an efficient LB, but, minimizing the overall energy consumption and decreases broadcast delay. This research utilized route adjustment technique when the sink moves around. The MS gets shifted to a steady angular velocity and existing position of MS could be defined using early trajectory time and location. The MS transmission starts the position and angular velocity in this manner that the transmitting message in the IoT systems is significantly reduced. The early position of the MS represent \(P0\) and when a ∆t time, the MS is moved to a novel position \(P\Delta t\). At the time of route alteration, the MS broadcast the position detail of the 1-hop coordinator. An accurate location of the sink could be evaluated for example node \(i\) is located at \(\left(x, y\right)\) coordinates. The 1-hop coordinators receives the location detail, it transmits to the remaining coordinators and broadcast the adjusted routes by sending the packets.

5 Performance Validation

This section validates the NL and routing performance of the presented approach by using varying aspects. The presented MONL-MRPMS approach can be simulated by means of MATLAB tool. The parameter settings are depicted in Table 1.

Table 1 Parameter settings

Firstly, the NL results of the COA-NL technique with other methods take place interms of number of localized nodes (NLN) and LE. Secondly, the routing performance of the SGO-MHR method takes place with respect to throughput, network lifetime, and energy consumption.

The localization performance of COA-NL approach with existing models [30] is validated interms of NLN under diverse ACN in Table 2 and Fig. 4. The outcomes stated that the COA-NL methodology has shown improved outcomes with highest NLN. For example, with 10 anchors, the COA-NL method has achieved maximum NLN of 132 while the BOA-NL, GSA-NL, CSO-NL, and KHA-NL system have acquired a minimum NLN of 118, 116, 109, and 106 respectively.

Table 2 Analysis of Localized Node by using different Number of Anchors
Fig. 4
figure 4

Result analysis of COA-NL technique interms of NLN

Eventually, with 30 anchors, the COA-NL model has accomplished a highest NLN of 166 however the BOA-NL, GSA-NL, CSO-NL, and KHA-NL methods have acquired a lowest NLN of 146, 142, 125, and 116 correspondingly. Meanwhile, with 50 anchors, the COA-NL model has attained a maximum NLN of 191 while BOA-NL, GSA-NL, CSO-NL, and KHA-NL methods have obtained a minimum NLN of 171, 158, 146, and 135 correspondingly.

A brief LE investigation of the COA-NL approach take place by using distinct anchors in Table 3 and Fig. 5. The figure portrayed that the COA-NL system has showcased superior outcomes with least LE. For example, under 10 anchors, the COA-NL methodology has resulted in the least LE of 0.320 while the BOA-NL, GSA-NL, CSO-NL, and KHA-NL algorithms have achieved a raised LE of 0.390, 0.490, 0.650, and 0.660 correspondingly. In addition, under 30 anchors, the COA-NL methodology has resulted in least LE of 0.200 while the BOA-NL, GSA-NL, CSO-NL, and KHA-NL methods have attained an improved LE of 0.330, 0.420, 0.490, and 0.500 correspondingly. Similarly, under 50 anchors, the COA-NL methodology has resulted in minimum LE of 0.120 while the BOA-NL, GSA-NL, CSO-NL, and KHA-NL methodologies have acquired a maximum LE of 0.250, 0.340, 0.398, and 0.440 correspondingly.

Table 3 Analysis of LEs vs. the number of anchors
Fig. 5
figure 5

LE analysis of COA-NL model

A brief LE examination of the COA-NL method takes place with respect to ranging error and transmission range in Table 4. Figure 6 exhibited that the COA-NL manner has outperformed superior results with the least LE. For example, under 10 error, the COA-NL manner has resulted in a minimum LE of 0.250 while the BOA-NL, GSA-NL, CSO-NL, and KHA-NL methodologies have accomplished highest LE of 0.360, 0.410, 0.610, and 0.620 correspondingly. Also, under 20 error, the COA-NL approach has resulted in a minimal LE of 0.130 while the BOA-NL, GSA-NL, CSO-NL, and KHA-NL systems have accomplished a raised LE of 0.310, 0.370, 0.490, and 0.520 correspondingly. Concurrently, under 30 error, the COA-NL method has resulted in least LE of 0.104 while the BOA-NL, GSA-NL, CSO-NL, and KHA-NL systems have attained a superior LE of 0.270, 0.290, 0.400, and 0.440 correspondingly.

Table 4 Analysis of ranging error vs LEs and transmission range (m) vs LEs
Fig. 6
figure 6

Range error analysis of COA-NL approach

Figure 7 demonstrated that the COA-NL technique has showcased superior results with the least LE. For example, under 10 transmission range, the COA-NL methodology has resulted in least LE of 0.180 while the BOA-NL, GSA-NL, CSO-NL, and KHA-NL methodologies have achieved a highest LE of 0.310, 0.330, 0.480, and 0.510 respectively. Besides, under 20 transmission range, the COA-NL system has resulted in the least LE of 0.120 while the BOA-NL, GSA-NL, CSO-NL, and KHA-NL approaches have attained a highest LE of 0.180, 0.276, 0.430, and 0.480 correspondingly. Likewise, under 30 transmission range, the COA-NL methodology has resulted in a lower LE of 0.070 while the BOA-NL, GSA-NL, CSO-NL, and KHA-NL systems have obtained a raised LE of 0.110, 0.200, 0.330, and 0.390 correspondingly.

Fig. 7
figure 7

Transmission range analysis of COA-NL model

Next, the routing performance of SHO-MHR methodology is inspected interms of energy consumption (EC), packet delivery ratio (PDR), and throughput in Table 5. Figure 8 examines the comparative results of the SHO-MHR system interms of energy under varying numbers of nodes. The figure depicted that the SMO-MHR method has gained lower EC over the other existing approaches. For example, with 200 nodes, the SMO-MHR technique required the least EC of 64 mJ whereas the PSO-MHR, GWO-MHR, BSA-MHR, and BGO-MHR techniques have needed a higher EC of 178 mJ, 169 mJ, 95 mJ, and 84 mJ respectively. Concurrently, with 600 nodes, the SMO-MHR manner required a minimum EC of 120 mJ whereas the PSO-MHR, GWO-MHR, BSA-MHR, and BGO-MHR techniques have needed a higher EC of 229 mJ, 216 mJ, 173 mJ, and 138 mJ correspondingly. Followed by, with 1000 nodes, the SMO-MHR approach required the least EC of 87.26 mJ whereas the PSO-MHR, GWO-MHR, BSA-MHR, and BGO-MHR approaches have needed a maximal EC of 90.75 mJ, 93.61 mJ, 95.46 mJ, and 96.34 mJ correspondingly.

Table 5 Result analysis of proposed SGO-MHR with existing approaches in terms of varying measures
Fig. 8
figure 8

Energy consumption analysis of SGO-MHR model

Figure 9 inspects the comparative outcomes of the SHO-MHR technique with respect to energy under varying number of nodes. The figure showcased that the SMO-MHR approach has gained highest PDR over the other existing systems. For samples, with 200 nodes, the SMO-MHR method required a higher PDR of 99.87% whereas the PSO-MHR, GWO-MHR, BSA-MHR, and BGO-MHR algorithms have desirable a lesser PDR of 95.35%, 97.67%, 98.57%, and 99.45% correspondingly. Likewise, with 600 nodes, the SMO-MHR technique required a highest PDR of 98.24% while the PSO-MHR, GWO-MHR, BSA-MHR, and BGO-MHR techniques have needed a minimum PDR of 91.57%, 94.48%, 95.5%, and 97.55% correspondingly. Along with that, with 1000 nodes, the SMO-MHR algorithm required a superior PDR of 96.34% while the PSO-MHR, GWO-MHR, BSA-MHR, and BGO-MHR manners have needed a reduced PDR of 87.26%, 90.75%, 93.61%, and 95.46% correspondingly. Figure 10 determines the comparative results of the SHO-MHR approach interms of energy in various numbers of nodes. The figure depicted that the SMO-MHR approach has gained highest NLT over the other existing algorithms.

Fig. 9
figure 9

Packet delivery ratio analysis of SGO-MHR model

Fig. 10
figure 10

Network lifetime analysis of SGO-MHR model

For instance, with 200 nodes, the SMO-MHR approach required a higher NLT of 5611 round whereas the PSO-MHR, GWO-MHR, BSA-MHR, and BGO-MHR techniques have needed a lesser NLT of 4215, 4415, 4909, and 5122 rounds correspondingly. Similarly, with 600 nodes, the SMO-MHR method required a maximal NLT of 5148 whereas the PSO-MHR, GWO-MHR, BSA-MHR, and BGO-MHR techniques have needed a minimal NLT of 3713, 3906, 4515, and 4829 rounds correspondingly. Finally, with 1000 nodes, the SMO-MHR approach required a superior NLT of 4831 whereas the PSO-MHR, GWO-MHR, BSA-MHR, and BGO-MHR methodologies have needed a minimal NLT of 3134, 3188, 4014, and 4227 rounds correspondingly.

6 Conclusion

This paper has developed a novel MONL-MRPMS approach to achieve NL and multihop routing in WSN. The presented MONL-MRPMS approach includes two most important stages namely COA-NL based node location, SGO-MHR based route selection, route alteration with MS. The proposed COA-NL technique utilizes Euclidian distance as fitness function to localize the unknown nodes. Besides, the SGO-MHR methodology derives a fitness function including dissimilar parameters to choose optimal routes to destination. Along with that, a MS with route adjustment scheme is employed for improved energy efficiency of the WSN, which allows adjusting the routes depending upon the movement of MS. Extensive simulation results emphasized the better performance of MONL-MRPMS algorithm over the recent approaches. In future, data aggregation and time synchronization methods are intended to improve the overall efficacy of resource utilization in WSN.