Introduction

The objective of localization in WSNs is to compute the exact location coordinates of each SN using a few ANs. The self-localization techniques in WSNs are broadly classified into “range-free” and “range-based” algorithms. Range-free localization schemes are hop-count based but not based on distance between SNs and ANs. These techniques are based on solutions to optimization or heuristic problems, and they are decentralized in nature. The advantage of these techniques is that they need fewer ANs to compute the location coordinates of unknown TN locations. As the SNs in WSNs are operated with limited hardware implementations, and energy resources, it is a good choice to select range-free localization algorithms for locating the SNs based on their connectivity in the network terrain. But these algorithms do not provide higher localization accuracy. The examples of these techniques are DV-hop, and Centroid. On the other hand, range-based localization techniques compute the Euclidean distances between the SNs and ANs, and locate the SNs using geometric techniques like TOA, TDOA, AOA, and RSSI1,2,3,4,5. These techniques provide higher localization accuracy. However, these techniques expect a greater number of ANs, which increases the cost of WSNs. The performance of any given localization technique is defined in terms of localization accuracy, computational complexity, energy consumption, and communication overhead6,7,8,9. Achieving localization accuracy is further challenging when the SNs are mobile in WSNs, and the static localization algorithms will fail to output the accurate location of SNs. The ANs which are equipped with GPS modules still have disadvantages particularly WSNs deployed in hard-to-reach areas as well as indoor applications. Therefore, it is essential to define the localization algorithms which are GPS information independent in computing SN locations.

Contributions

Motivation

In the proposed method, we have used only four ANs to localize the rest of the SNs in the network, using RSSI values of signals received from ANs. RSSI based localization is a cost-effective solution in WSNs, but most of the existing RSSI based localization algorithms perform efficiently in static scenarios. In the case of mobile SNs in the network, static localization algorithms refresh the localization process frequently that consumes higher energy and causes more localization errors. The existing range-based localization algorithms did not consider the anisotropy factors typically seen in WSNs, leading to poor positioning accuracy. Also, most of the existing localization schemes in WSNs select ANs randomly and they need a greater number of ANs for accurate location calculations of SNs, which increases the cost of WSNs. In this article, a low-complex range based self-localization algorithm that uses RSSI values is proposed to address the anisotropic nature of WSNs and achieve higher location accuracy. The existing CSO algorithm depends on the information exchange between populations to maintain the population diversity. In case of poor diversity, the CSO algorithm falls into local optima. We have proposed a true fitness function based on the distances between TNs and ANs to ensure the population diversity. Also, the conventional CSO updates the location and path through Lévy flight. Information exchange among populations is derived through communication between individuals and the best current population, which causes CSO to be susceptible to local optima and lower convergence accuracy. The proposed CERBLA improvised over the similar natural inspired algorithms used for localization where the signals from the best three anchor nodes are considered. The weighted centroid is used in locating TNs based on signals from ANs.

The main contributions presented in this article are as follows:

  1. i.

    Rigorous literature study on the existing localization techniques and algorithms is conducted that enhance the localization accuracy in WSNs.

  2. ii.

    For the first time, range-based localization algorithm is proposed that uses only four ANs. It exploits the co-planar properties of ANs to mitigate the localization errors.

  3. iii.

    Computationally cost-effective fitness function is defined to achieve global optimal location coordinates of TNs. During the initial rounds of localization, the TNs which are localized are designated as assistant ANs. These SNs help in enhancing the coverage in WSNs.

  4. iv.

    Intensive simulations are conducted to prove the efficiency of the proposed algorithm in terms average localization error and localization accuracy, by considering the metrics as node density and number of ANs.

  5. v.

    The comparative analysis is performed under the similar network deployment conditions and localization task.

The remaining content of the article is structured as follows: Sect. 3 briefs out the nascent localization algorithms, methods, and techniques that exists in the literature, Sect. 4 presents methodology of the proposed technique, the simulation results and discussions are mentioned in Sect. 5, also the results of the proposed method are compared with the existing nascent localization algorithms, and finally Sect. 6 mentions the conclusions of the proposed algorithm.

Related works

Increasing the number of ANs causes higher energy consumption and cost in WSNs, but introducing mobility in ANs leads to not only higher localization accuracy but also less energy consumption10. Accurate TOA estimation demands higher signal bandwidth of 500 MHz in RF-based WSN localization which is highly power inefficient and complex. However, TOS estimation based on IEEE 802.15.4 ZigBee11 needs a narrow bandwidth of 2 MHz, at the same time the localization accuracy of 0.5 m at SNR of 8dB. The TOA based localization algorithms expect precise time synchronization which is energy inefficient. Therefore, the TDOA localization is introduced in which the mutual distances between SNs are computed based on the difference in received signal arrival times. These signals are received from spatially separated receivers. TDOA based localization combines the “Multilateral Maximum Likelihood” and “Trilateration Method” to achieve optimized localization effect12. Using the SNs that interconnect TNs, a subset of SNs is created as a backbone. This subset is used as a reference to locate the other SNs which are not part of this subset13. Optimal AN pairs selection in range-free localization can enhance the location measurements accuracy in anisotropic WSNs. In anisotropic WSNs, reliable and optimal AN pair are defined to get high localization accuracy by deriving the distance between TN and AN. Estimation of this distance uses average hop progress for enhancing the ANs utilization14.

DV-Hop algorithm considers the hop distance between AN and the closest unknown TN as the global average hop distance. It does not consider the effect of hop count in defining the location coordinates of TN, and it leads to localization errors. The improved version of “minimum mean square” based DV-Hop localization algorithm15 considers the effect of different hop SNs in the vicinity of TN is considered in computing the SN coordinates and it significantly enhances the localization accuracy. DV-Hop algorithm considers the number of hops between TNs and ANs, the average distance per hop at AN is defined to estimate the location of TN. When the hop count is uniform, the communication range is fixed, and it leads to poor localization. To establish the relation between physical distance and hop count, different communication powers are maintained at different SNs. The TNs calculate the average distance per hop between itself and the three closest ANs and take the average of them to get the more accurate location values of the TNs16]– [17. The breakdown of AN during the localization process affects the accuracy in location measurements in multi-hop WSNs. Online sequential DV-hop localization algorithm will address this problem and minimize the average location errors18. Improved version of DV-hop localization algorithm based on TLBO and collinear properties of ANs can improve the convergence rate and precision of location measurements19. The triangular pyramid spaces constructed by neighbor ANs of the TN are divided into subspaces. The centroid of the subspace computes the location of TN with minimal error20. One more way of addressing the drawbacks of DV-hop algorithm is to use “half-measure weighted centroid”21, in which TNs realize their locations using centroid algorithm, and use this location accuracy as weights for locating TNs.

In RSSI based localization, the RSSI values decrease with increasing range and causes poor localization. However, in the presence of known environment and decision upon multiple scans, the impairments in accurate RSSI measurements are minimized22. AN selection is an important aspect in RSSI based localization to mitigate the errors in location measurements. “Weighted centroid localization”2324 algorithm is based on RSSI that enhances positioning accuracy by tuning the correction coefficient. Even though RSSI based localization is a cost-effective solution, the shadowing effects introduce high errors in range measurements. Methods like majority rule approach, centroid-based outlier detection, and mean-shift clustering for outlier detection minimizes localization error in shadowing environments25. In RSSI-based localization, ML techniques along with its CRLB save the SNs energy26, and communication bandwidth27. Nature-inspired optimization algorithms28,29,30,31 show the solutions to the critical issues like network coverage, energy efficiency, connectivity, and localization in WSNs.

The state-of-the-art localization meta-heuristic algorithms and methods32,33,34,35 like GA, PSO, ACO, BOA, FOA, FPO, GWO, ABCOA, FSO are proposed to optimize the localization errors. Defining virtual ANs for localizing the moving TNs using meta-heuristic algorithms like PSO and FOA minimize the need of physical ANs in WSNs36,37,38. The performance metrics to analyze the performance of these localization algorithms include convergence rate, accuracy, number of localized nodes, complexity, cost, energy consumption, and scalability. SNs redundancy in underwater WSNs causes low positioning accuracy. PSO based AN optimization improves the localization accuracy under the consideration of SN’s residual energy and communication overhead3940. Heuristic approach using algorithms like GA shows optimal trade-off between intensification and diversification. But, in NLOS environments, there exists discontinuities in the fitness function evaluation of SN distribution and challenges during the exploration. Hybrid GA which is “Memetic Algorithm” with a Local Search strategy improves exploring process. The combination of hybrid GA and memetic algorithm enhances the node localization by 14.2% compared to GA based optimization41.

To enhance the performance of DV-hop localization algorithm, binary PSO is used to generate subsets of ANs. Using these subsets, each AN computes mean-hop size during self-localization stage, and broadcasts it to the nearest TNs. The TNs localize themselves using these subsets instead of depending on all the ANs and this procedure enhances the localization accuracy42. MCB algorithm localizes the TNs by exploiting the SNs mobility, and compute the average value of current location samples, but the lower ANs density in WSNs cause more localization errors. To address this issue, “Grey model prediction” based MCB algorithm43 is proposed to enhance the localization accuracy. This algorithm uses past time intervals’ location values in predicting the current location samples. CSO algorithm defines the set of ANs with certain weights, and they serve the TNs to locate themselves4445. Cooperative localization in low density ANs environment causes poor localization accuracy in WSNs due to the redundant information. In those scenarios, source optimization is introduced where each SN computes its own CRLB and informs the same to neighbors. Same way, each SN collects the CRLB from neighbors along with azimuth angle, distance to compute the final location. This scheme is based on fuzzy comprehensive evaluation46, and it enhances localization accuracy by 19.4%. The combination of three meta-heuristic algorithms called DEEC, “Gradient Distance Elimination”, and “Gaussian Elimination” are used to define the hyper-heuristic optimization model47 for SN localization in WSNs. It gives lower localization error compared to DV-hop, weighted centroid, compensation coefficient, weighted hyperbolic algorithms. Fuzzy based localization uses a weighted centroid technique48, where the TN position is estimated with high accuracy, which helps in increasing throughput and energy efficiency. Centroid iterative ML estimation in localization divides the WSN into tiers based on number of hops with respect to sink node. This helps to select optimal cluster heads and detect SN anomalies49.

The nascent works50 on location optimization are considered that includes swarm intelligence, evolutionary, and metaheuristic algorithms. Localization evaluation criteria are analyzed in terms of time complexity, convergence speed, and localization accuracy. DV-Hop with triangulation51 and “Bat-SA algorithm” aimed at fast convergence, but it gives higher location errors. DV-Hop with RSSI information52 and “triangle centroid” enhances the location accuracy of TNs by 58%. In this method, the hop distance matching factor is defined to accurately obtain the hop size and weigh the fitness of each AN. “geometric constraint” and “optimized weights” features in DV-hop53 finds location coordinates of TNs with minimal errors. least squares method. But the execution time is increased from 0.36s to 0.61s. “Chaotic crested porcupine optimizer54” replaces the least squares method in finding the TNs location coordinates. But the authors have maintained 300 m as communication radius, which is very high in energy constrained sensor networks, also it uses 20% of ANs which leads to higher deployment cost. “Multi-objective salp swarm with fuzzy selection55” is integrated into DV-hop algorithm aiming at the 50% reduction in location errors. However, it expects 30 ANs and a communication radius of 40 m which again leads to an increase in the deployment cost and poor energy efficiency. “PSO-Amorphous56” provides minimal localization error at the cost of local optima, premature convergence, and lesser scalability. It also expects a higher number of beacon nodes. “Crow Search weighted centroid localization57” minimizes the location error compared to DV-hop at the cost of additional communication packets in beacon selection process. An improved PSO58 based location finding expects higher SNRs for optimized sensor deployment and works efficiently only under LOS environments. When the sensor node’s communication range is set to 18 m with an error upto10% and the network size of 400 nodes, it is shown that59 the anchor node positions ratio is increasing from 5 to 35%, the localization errors are reduced due to the opportunity that target nodes receive signals from many anchor nodes. Also, when the communication range is increased from 15 to 45 m, the localization error is slowly decreasing.

Proposed method

In the existing localization algorithms of WSNs, once the optimal set of localized SNs are defined, all the rest of TNs use this set to locate themselves. This leads to inefficient utilization of ANs and causes more localization errors. Also, these algorithms need higher number of iterations to reduce the location deviation errors of individual TNs, and it leads to more energy consumption at each SN. Therefore, selection of optimal and more favorable ANs enhances the localization accuracy as well as energy efficiency. Assigning weights for the ANs signals received at TNs will mitigate the location measurement errors, compared to considering all signals received from ANs present in the communication range. As the RSSI values-based distance measurements are simple and efficient to implement in WSNs, in this section, we have proposed a low-complex range-based localization algorithm that uses RSSI values in selecting ANs and achieve minimal localization error compared with the existing techniques. The following assumptions are made by defining the proposed methodology:

  1. 1.

    The radio channels are anisotropic.

  2. 2.

    SNs are homogeneous with respect to communication range and hardware.

  3. 3.

    The channel irregularities and noise are considered.

  4. 4.

    All computations regarding localization are performed at TN to enhance energy efficiency.

At the initial stage, the TNs within the communication range of ANs calculate their own locations based on the RSSI values received from ANs. To perform localization, each TN needs a minimum of three RSSI values of signals received from various ANs. If the TN receives more than three signal RSSI values from ANs, then the TN chooses the best three RSSI values to calculate its location coordinates. We have proposed a localization technique by defining the fitness function as mentioned in Eq. 1 that involves range or distance measurements. The accurate location coordinates are achieved at TN by minimizing the fitness function values as shown in Eq. 1.

$$\:\text{F}\left({\text{x}}_{\text{m}},\:{\text{y}}_{\text{m}}\right)=\:\frac{1}{\text{N}}\sum\:_{\text{m}=1}^{\text{N}}{({\text{d}}_{\text{m}\text{n}}-{\text{d}}_{\text{m}\text{n}}^{1})}^{2}$$
(1)

Where \(\:\text{F}\left({\text{x}}_{\text{m}},\:{\text{y}}_{\text{m}}\right)\:\)is the MSE between the TN whose location coordinates are computing and all ANs present in the communication range of the given TN. \(\:\left({\text{x}}_{\text{m}},\:{\text{y}}_{\text{m}}\right)\) are the location coordinates of TN and \(\:\left({\text{x}}_{\text{n}},\:{\text{y}}_{\text{n}}\right)\)are the location coordinates of AN. \(\:{\text{d}}_{\text{m}\text{n}}\) and \(\:{\text{d}}_{\text{m}\text{n}}^{1}\) are the actual distance and the estimated distance between TN and AN respectively. The estimated distance between TN and AN is modelled using Eq. 2.

$$\:{\text{d}}_{\text{m}\text{n}}^{1}=\:{\text{d}}_{\text{m}\text{n}}+{\text{e}}_{\text{m}\text{n}}$$
(2)

where \(\:{\text{e}}_{\text{m}\text{n}}\:\)is the error in computing range between TN and SN. In the presence of LOS path between TN and AN, the free-space path loss model is used to calculate RSSI values as shown in Eq. 3.

$$\:{\text{R}\text{S}\text{S}\text{I}}_{\text{d},\:\text{L}\text{O}\text{S}}={\text{G}}_{\text{T}}{\text{G}}_{\text{R}}{\text{P}}_{\text{T}}({\frac{{\uplambda\:}}{4{\uppi\:}\text{d}})}^{2}$$
(3)

where \(\:{\text{G}}_{\text{T}}\) and \(\:{\text{G}}_{\text{R}}\:\)are the antenna gains at AN and TN respectively. \(\:{\text{P}}_{T}\) is the transmitting signal power at AN. ‘d’ is the distance between TN and AN, and ‘\(\:{\uplambda\:}\)’is the signal wavelength. In case of NLOS path between TN and AN, RSSI values are computed using log-normal path loss model as shown in Eq. 4 that accounts the shadowing and multipath effects of signals propagation in the radio channel.

$$\:{\text{R}\text{S}\text{S}\text{I}}_{\text{d},\:\text{N}\text{L}\text{O}\text{S}}={\text{P}}_{\text{T}}-10\text{a}{\text{l}\text{o}\text{g}}_{10}\left(\frac{\text{d}}{{\text{d}}_{0}}\right)-\text{P}\text{L}\left({\text{d}}_{0}\right)+{\text{X}}_{{\upsigma\:}}$$
(4)

\(\:\text{P}\text{L}\left({\text{d}}_{0}\right)\) is the path loss at reference distance \(\:{\text{d}}_{0}\). ‘a’ is the path loss exponent which varies between 2 and 4 according to environmental conditions. \(\:{\text{X}}_{{\upsigma\:}}\) is the gaussian noise whose “mean” is zero and standard deviation is ‘\(\:{\upsigma\:}\)’. The variance ‘\(\:{{\upsigma\:}}^{2}\)’ is proportional to the square of true distance \(\:{\text{d}}_{\text{m}\text{n}}\) between \(\:{\text{m}}^{\text{t}\text{h}}\) TN and \(\:{\text{n}}^{\text{t}\text{h}}\)AN as shown in Eq. 5.

$$\:{{\upsigma\:}}^{2}={\text{d}}_{\text{m}\text{n}}^{2}\times\:{{\upeta\:}}^{2}$$
(5)

where ‘\(\:{\upeta\:}\)’ is the distance error factor. In the real applications of WSNs deployment, larger distances between SNs leads to more localization errors. To reduce these location measurement errors and improve the localization accuracy, an optimal AN selection strategy is proposed based on RSSI values. The proposed algorithm presented in this section has mainly three stages: identification & classification of TNs, optimal selection of ANs, and finally, accurate range estimation to enhance the localization efficiency.

TNs identification & classification

The RSSI values of signals received from ANs are measured at each TN for LOS and NLOS paths using Eqs. 3 and 4 respectively. Calculate the difference between maximum and minimum of the measured RSSI values as RSSIdiff. This value is compared with a threshold distance to decide whether the given TN is either a boundary or non-boundary node as per the Eq. 6. If RSSIdiff value is above the threshold distance, then the corresponding TN is decided as a boundary SN, otherwise it is a non-boundary SN.

$$\forall ,TN_{K} = \left\{ \begin{gathered} boundary\,SN,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,RSSI_{{diff}} \ge D_{{th}} \hfill \\ non - boundary\,SN,\,\,\,\,otherwise \hfill \\ \end{gathered} \right.$$
(6)

where

$$D_{{th}} = 0.35 \times \left| {\max \left( {RSSI\left( k \right)} \right)} \right|$$
(7)

Usually, if the distance between TN and AN is maximum, then the corresponding RSSI value is smaller and vice versa. The value 0.35 in Eq. 7 is chosen as a scaling factor to define the optimal threshold value.

Fig. 1
figure 1

Flow diagram of the proposed CERBLA algorithm.

Optimal selection of ANs

The RSSI values of the signals received from ANs are highly dependent on temporal and spatial changes in the wireless channel. Accounting the signals received from farther ANs in computing locations of TNs lead to more localization error. The focus at this stage is to define more favorable ways to improve the localization accuracy by reducing noise in the received signals from the selected ANs. To achieve this, an optimal ANs selection strategy is proposed which depends on whether the given TN is a boundary SN or a non-boundary SN. In the case of a boundary TN, identify three highest RSSI values and select the corresponding ANs in locating the given TN. In the case of a non-boundary TN, consider all the RSSI values and select all the corresponding ANs present within TN’s communication area. After conducting rigorous simulations, we define 0.8 as the proportional factor for a boundary TN to minimize the effect of errors due to the farther ANs on localization accuracy.

Accurate location estimation

As shown in the flow diagram (depicted in Fig. 1) of the proposed method, we have considered atleast three ANs in computing the signal RSSI values and the location values. For achieving highest localization accuracy, the weights are assigned for the measured distances between every TN and the chosen ANs set. The assigned weights are inversely proportional to the measured distances and these weights are normalized as per Eq. 8.

$$\:{W}_{n}=\frac{{\left[{d}_{mn}^{1}\right]}^{-1}}{\sum\:_{n=1}^{{N}_{AN}}{\left[{d}_{mn}^{1}\right]}^{-1}}$$
(8)

\(\:{W}_{n}\) is the weight assigned for nth AN, \(\:{d}_{mn}^{1}\) is the distance between mth TN and nth AN. \(\:{N}_{AN}\) is the minimum number of ANs selected for location calculations. The contribution of AN in computing locations is less when it is much away from TN. The optimal fitness function is proposed to calculate the location coordinates as shown in Eq. 9. To achieve lower MSE of localization, the fitness function values should be less.

$$\:F\left({x}_{m},{y}_{m}\right)=\frac{1}{{N}_{AN}}\:\sum\:_{m=1}^{{N}_{AN}}{W}_{K}\times\:{({d}_{mn}-{d}_{mn}^{1})}^{2}$$
(9)

We have considered the optimization of localization in WSNs using improved CSO algorithm which is defined based on brood parasitism of cuckoo species. In improved CSO algorithm, new solutions are generated by either probability fraction ‘\(\:{P}_{m}\)’ of the total host nests or the Lévy flight (it is a random walk model with Lévy or power-law distribution with a heavy tail for the step-length). The best solution of global search in CSO algorithm depends mainly on mutation probability and the step size control factor. Keeping constant values for these parameters minimizes the convergence rate and localization accuracy in WSNs. Therefore, we have defined dynamic values for mutation probability and Lévy flight using Eqs. (10) and (11) in order to achieve global optimal solution with high localization accuracy.

Firstly, we define the mutation probability \(\:{P}_{m}\) based on the fitness of solutions to overcome the problem of local convergence and enhance the population diversity. If we choose \(\:{P}_{m}\) as too small value, localization accuracy is reduced and it needs more number of iterations to achieve optimal performance. On the other hand, if \(\:{P}_{m}\) is too large, convergence time is more. Therefore, it is essential to have an optimal values of mutation probability that is proportional to the objective function value and it is defined using Eq. (10).

$$\:{\text{P}}_{\text{m}}\left(\text{i}\right)=\:\left\{\begin{array}{c}\left({\text{P}}_{{\text{m}}_{\text{m}\text{i}\text{n}}}+\:{(\text{P}}_{{\text{m}}_{\text{m}\text{a}\text{x}}}-{\text{P}}_{{\text{m}}_{\text{m}\text{i}\text{n}}}\right)\times\:\left(\text{f}\text{i}\text{t}\text{n}\text{e}\text{s}\text{s}\left(\text{i}\right)-{\text{f}}_{\text{m}\text{i}\text{n}}\right)\:\:if\:\left(\text{f}\text{i}\text{t}\text{n}\text{e}\text{s}\text{s}\left(\text{i}\right)-{\text{f}}_{\text{m}\text{i}\text{n}}\right)<1\:\\\:\frac{\:{\text{P}}_{{\text{m}}_{\text{m}\text{a}\text{x}}}}{{\text{N}}_{\text{i}}},\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:otherwise,\:\:where\:i=1,\:2,\:3,\:\dots\:\dots\:\dots\:.s\end{array}\right.\:\:\:\:$$
(10)

\(\:{f}_{min}\) is the current global optimal fitness value and \(\:fitness\left(i\right)\) is the current fitness value of ith solution. \(\:\left(fitness\left(i\right)-{f}_{min}\right)\) represents the quality of ith solution. \(\:{P}_{{m}_{min}}\) and \(\:{P}_{{m}_{max}}\:\)are the minimum and maximum values of the mutation probabilities respectively.

Algorithm 1
figure a

Algorithm of the proposed CERBLA protocol.

Secondly, the Lévy flight based solution which is a most efficient way of exploring the search space and new solutions are generated as

$$s_{i}^{{\left( {k + 1} \right)}} = s_{i}^{k} + \Delta .Le^{\prime}vy\left( \gamma \right)$$
(11)

where \(Le^{\prime}vy\left( \gamma \right)\) is the step size and it is defined as \(Le^{\prime}vy\left( \gamma \right) = \frac{x}{{\left| y \right|^{{\gamma ^{{ - 1}} }} }}\). \(\:\gamma\:\) is a constant that takes values as \(\:1<\gamma\:\le\:3\) and \(\:\varDelta\:\) is the step size control factor. x and y are the normal distributions as \(x\sim N\left( {0,\sigma _{x}^{2} } \right),~y\sim N\left( {0,\sigma _{y}^{2} } \right)\) with corresponding variances are given using Eq. (12).

$$\:{\sigma\:}_{x}={\left[\frac{{\Gamma\:}\left(1+\gamma\:\right)\text{s}\text{i}\text{n}\left(\frac{\pi\:\gamma\:}{2}\right)}{{\Gamma\:}\left[\frac{1+\gamma\:}{2}\right]\gamma\:{2}^{(\gamma\:-1)/2}}\right]}^{{\gamma\:}^{-1}},\:{\sigma\:}_{y}=1$$
(12)

When the step size control factor \(\:\varDelta\:\) is less, few of the newly generated solutions shown in Eq. (11) walk around the existing best solution to speed up the local search. On the other hand, when \(\:\varDelta\:\) is high, the new solutions walk away from the present best solution and causes the absence of global optimal solution. Therefore, it is essential to define the variable step size as shown in Eq. (13).

$$\:\varDelta\:={\varDelta\:}_{max}-\frac{{N}_{i}}{{N}_{T}}\:({\varDelta\:}_{max}-{\varDelta\:}_{min})$$
(13)

where \(\:{N}_{T}\) and \(\:{N}_{i}\) are the total number of iterations and present iteration number respectively. \(\:{\varDelta\:}_{min}\) and \(\:{\varDelta\:}_{max}\) are the minimum and maximum step sizes respectively. From the Eq. (13), the size of \(\:\varDelta\:\) decreases when the iteration numbers are increasing. During the initial iterations, the higher step sizes maximize the global search and at a later stage the lower step sizes intensifies the local search. Overall, we can achieve global optimal solution and higher conversion rate with enough number of iterations.

As WSN has energy constrained devices, it is essential to analyse the computational complexity of the localization algorithms. The computational complexity analysis is conducted to find the worst-case execution and completion times. If ‘s’, ‘a’, ‘g’, ‘i’, ‘d’, and ‘p’ are the total number of sensor nodes, anchor node, generations, iterations, spatial dimension, and population respectively, then the computational complexity of various techniques are analysed and compared as shown in Table 1. Though DV-Hop algorithm is simple and robust, it may not be suitable for locating SNs due to its higher localization error. Attempts were made to integrate DV-Hop and CSO for achieving precise location values60, but the execution time is higher. Also, the time complexity of DV-Hop algorithm is O((n-m)4) where ‘n’ total number of sensor nodes and ‘m’ is the number of anchor nodes. To increase the localization accuracy, an improved CSO is introduced61 having features of population grouping and drifting strategy (used for information exchange and population update), but the localization errors are up to 22.21%. The ANs ratio is 30%61 and 40%60 which leads to higher deployment cost of WSN. Its time complexity is O (T Nd D) where ‘T’, “Nd” and ‘D’ are the number of iterations, number of populations, and the spatial dimension respectively. Also, the communication radius maintained is about 30 m60 and 40 m61 which needs higher transmitting powers causing the faster depletion of sensor node’s battery.

Table 1 Computational complexity comparison.

Results and discussions

The performance of the proposed CERBLA is analyzed by conducting rigorous simulations in MATLAB 2024b environment. The SNs are deployed randomly as shown in Figs. 2a and f and 3a to 3f and the other simulation parameters are shown in Table 2. We have used only four static ANs and they are deployed inside the network terrain with 25 m and 125 m distance away from the corners of the network dimensions for \(\:100\:m\:\times\:\:100\:m\) and \(\:500\:m\:\times\:\:500\:m\:\) network sizes respectively. Mean localization error and mean localization accuracy are the performance metrics used to assess the performance of CERBLA. The performance comparison is conducted between the proposed CERBLA and the nascent localization algorithms. In Figs. 2a and 3a, the true locations and the measured locations of TNs are depicted using the CERBLA under the ideal scenarios of localization. In Figs. 2b and f and 3b to f, practical location measurements are presented under noisy conditions. In all cases, the location measurements using CERBLA are very close with their true locations, particularly when the node density is higher.

Table 2 Simulation parameters of the proposed CERBLA protocol.

The mean localization error is calculated as.

$$Mean{\text{ }}localization{\text{ }}error = \frac{{\mathop \sum \nolimits_{{i = 1}}^{N} \sqrt {\left( {x_{m} - x_{n} } \right)^{2} + \left( {y_{m} - y_{n} } \right)^{2} } }}{N}$$
(14)

In Eq. 14, ‘N’ represents the number of TNs. \(\:({\text{x}}_{\text{m}},{\text{y}}_{\text{m}})\) and \(\:\left({\text{x}}_{\text{n}},{\text{y}}_{\text{n}}\right)\:\)are the true location coordinates and estimated location coordinates of the TN respectively.

Fig. 2
figure 2

(a) Ideal case of localization for 100 SNs in 100 m\(\:\times\:\)100 m area. (b). Practical case of localization for 100 SNs in 100 m\(\:\times\:\)100 m area.c Practical case of localization for 200 SNs in 100 m\(\:\times\:\)100 m area.(d) Practical case of localization for 300 SNs in 100 m\(\:\times\:\)100 m area. (e) Practical case of localization for 400 SNs in 100 m\(\:\times\:\)100 m area. (f) Practical case of localization for 500 SNs in 100 m\(\:\times\:\)100 m area.

Fig. 3
figure 3

(a) Ideal case of localization for 100 SNs in 500 m\(\:\times\:\)500 m area. (b) Practical case of localization of 100 SNs in 500 m\(\:\times\:\)500 m area. (c) Practical case of localization for 200 SNs in 500 m\(\:\times\:\)500 m area. (d) Practical case of localization for 300 SNs in 500 m\(\:\times\:\)500 m area. (e) Practical case of localization for 400 SNs in 500 m\(\:\times\:\)500 m area. (f) Practical case of localization for 500 SNs in 500 m\(\:\times\:\)500 m area.

Fig. 4
figure 4

Comparison of Normalized localization accuracy versus number of Anchor nodes.

DV-Hop algorithm provides accurate location estimation in isotropic WSNs. DV-max Hop65 is a variant of DV-Hop algorithm meant for anisotropic WSNs to achieve higher location accuracy at minimal computational and communication overhead. It offers faster convergence at lower energy consumption. Range-free localization techniques are suitable for large-scale WSNs due to their low-cost hardware implementation. The range-free algorithms utilize only the neighborhood connectivity information in measuring the location of SNs. On the other hand, these techniques give poor localization accuracy and coverage in anisotropic WSNs. The combination of hop-based and geometric features can increase the localization accuracy in range-free localization by achieving trade-off between AN utilization and location measurements. PSO based66 location measurements of TNs enhance the mean localization accuracy by 31.4% compared to DV-max Hop algorithm. Range-free localization algorithm called LRAPJA is proposed that combines the geometric and hop based features of SNs to address the anisotropic nature of WSNs67. The anisotropic factors in WSNs limit the location precision of range-free localization algorithms. RAPS and QSSA techniques can enhance the localization accuracy in anisotropic WSNs68. Even in the presence of lower number of ANs particularly for less than ten, the localization accuracy is higher using the proposed CERBLA technique compared to other range-free and hop based algorithms as shown in Fig. 4. The proposed algorithm assures minimum of 88.92% localization accuracy in the presence of at least four ANs in the network and the accuracy improves further with the number of ANs up to 99.18% when 50% of SNs are act as ANs as shown in Table 3.

Table 3 Normalized localization accuracy versus number of anchor Nodes.
Fig. 5
figure 5

Comparison of Normalized localization accuracy versus Node density.

From the results shown in Fig. 5, hop based localization gives poor accuracy in the low node density conditions compared to meta-heuristic based localization algorithms. The proposed CERBLA algorithm outperforms the nascent localization algorithms due to its low complex nature of the fitness function. From Table 4, the higher localization accuracy is achieved using the proposed CERBLA algorithm even at the lower node densities compared to the hop-based localization and other meta-heuristic algorithms. However, the proposed CERBLA gives maximum localization accuracy of 98.62% at the node density of 0.03 per m2.

Table 4 Normalized localization accuracy versus node density (per m2).
Fig. 6
figure 6

Average localization accuracy vs. number ANs.

The performance of average localization accuracy vs. ANs is compared between the proposed CERBLA and heuristic approach-based localization techniques in Fig. 6. DCK-GWO69 algorithm works based on degree of collinearity and it is performing better than other meta-heuristic algorithms. However, the disadvantage of this algorithm is that its localization accuracy is in the acceptable range only when the ANs are beyond 20% of the total number of SNs in the network and also the minimum communication distance should be 35 m. DECPSOHDV-Hop algorithm7071 gives localization accuracy of 84.62% only if the ANs are above 50% of total SNs and the minimum communication range of 50 m. In Fig. 6, localization based on WOA-QT72 gives poor localization accuracy than the other algorithms. However, the proposed CERBLA provides localization accuracy of 86.81% when the number of ANs are only four. For the sake of comparison, we have also increased the number of ANs in simulations, and it is observed that the localization accuracy of CERBLA is further increased with increasing number of ANs. The reason to achieve higher localization accuracy with CERBLA is that the selection of more favorable and optimal number of ANs leads to the higher localization accuracy and minimizes energy consumption. Also, the TNs are not dependent on a particular set of ANs instead of the location measurements are performed in a distributed manner and it leads to minimal number of iterations. The localization accuracy using the proposed CERBLA algorithm is enhanced by 25.32%, 25.19%, and 21.47% compared to DCK-GWO, WOA-QT, DECPSODV-Hop algorithms respectively as shown in Table 5.

Table 5 Mean localization accuracy (in %) with increasing number of ANs.
Fig. 7
figure 7

Mean localization error (in meters) vs. ANs in the network.

In Fig. 7, the localization error is measured in meters with increasing number of ANs for different localization algorithms like ECS-NL73, QABA74, IDE-NSL-AWSN75, and compared with CERBLA. When the number of ANs are four, the localization error is 2.12 m using CERBLA and it is higher for other algorithms. In other algorithms, to achieve mean localization error in the range of 2 m, minimum ten ANs are essential which increases the network cost as ANs are associated with GPS modules. Also, the average localization error of CERBLA is limited to 1.18 m when the ANs are varied from 4 to 50. At the same time, the average localization errors of ECE-NL, QABA, and IDE-NSL-AWSN are 2.706 m, 2.18 m, and 3.34 m respectively. The localization error in IDE-NSL-AWSN is more and it expects the minimum communication range of 75 m and 15 m in large-scale and small-scale environments respectively. QABA gives higher localization accuracy when the minimum communication range is 30 m and the average error is limited to 2.18 m. From Table 6, the localization error using the existing localization algorithms is mitigated to minimum levels only after the number of ANs are increased to 10 whereas the need of ANs is limited to four using the proposed algorithm to reach the same error values.

Table 6 Mean localization error (in meter) vs. number of ANs.

Conclusions

The aim of this proposed method is to decrease the number of ANs required in the localization process and minimize the cost of the WSN. We have used only four ANs which need GPS modules to know their locations and the rest of the SNs use the signals received from these ANs to locate themselves through CERBLA algorithm. Results of simulations show that the CERBLA algorithm limits the location measurement error to 1.18 m and improves the average localization accuracy up to 99.24%. CERBLA selects more favorable and optimal number of ANs to achieve higher localization accuracy and minimize energy consumption. Also, TNs are independent of ANs set instead the location measurements are performed in a distributed manner and it leads to minimal number of iterations. The localization accuracy using the proposed CERBLA algorithm is enhanced by 25.32%, 25.19%, 21.47%, 128.21%, 84.48%, and 181.35% compared to DCK-GWO, WOA-QT, DECPSODV-Hop, ECS-NL, QABA, and IDE-NSL-AWSN algorithms respectively. Overall, the localization error is minimum using the proposed CERBLA algorithm compared to other algorithms especially when the number of ANs is less than 10. This feature is attractive to build cost-effective localization algorithms for IIoT and other indoor applications of WSNs.