A novel approach of localization with Single Mobile Anchor using Salp Swarm Algorithm in Wireless Sensor Networks

Wireless sensor networks (WSNs) have fabulous attributes to collect data by sensing the surrounding environment. WSNs have a large number of applications that are facing challenges of routing, security, deployment, prolonged lifetime, data computation, and localization. To achieve the high-level performance of WSNs, many researchers have proposed various computational Intelligence (CI) based algorithms for the above-mentioned challenges. The procedure to determine the location of the target node is called node localization. It is easy to determine the coordinates of static nodes accurately but challenging task for the mobile nodes. Localization accuracy directly aﬀects the WSN’s performance. In this paper, a range-based and distributed method are proposed by using the application of the Salp Swarm Algorithm (SSA), and the simulation results are compared with existing approaches such as Particle

swarm Optimization (PSO) and H-best Particle Swarm Optimization (HPSO). In this paper, a single mobile anchor node as a reference node traversing the entire network in the Hilbert path and localize the mobile target nodes that are randomly deployed in the networking area. The primary goal behind selecting the Hilbert trajectory is to reduce the issue of LoS. The simulation results show that the proposed method has low localization error and an approximate double number of localized nodes with less computing time as compared to existing methods.
Keywords Wireless Sensor Networks · Salp Swarm Algorithm (SSA) · Anchor node · Particle Swarm Optimization (PSO) · H-best Particle Swarm Optimization (HPSO) · Hilbert trajectory · Localization accuracy · Localized nodes 1 Introduction In past years, Wireless Sensor Network (WSNs) has gained large popularity in the research community and becomes the most promising technology for the future also. WSNs consist of homogeneous or heterogeneous sensor nodes that are randomly deployed in the network for sensing the surrounding environment [1]. These sensor nodes are small in size and having low cost. WSNs have various real-life based applications such as environmental monitoring like humidity, temperature, pressure, sound, etc. [2], [3]. In some applications, the main aim of WSNs is to determine the location of occurring events like fire in a forest, etc. This can be done by determining the location of the reporting sensor node and which is known as node localization. In a static scenario, this can be done very easily. But in the case of moving target nodes, this becomes more challenging to determine the exact location of the target nodes. The exact location is necessary because if the location is unknown then data collected by the sensing node is of no use [4], [5]. Node localization can be done either by using the Global Positioning System (GPS) or any other method. But in large networks, it is infeasible to equip each sensor node with GPS because of its high cost and large energy consumption [6]. Other methods for the location of unknown nodes can be determined by using anchor nodes having prior knowledge of their coordinates [7]. Localization techniques are further categorized as Range-based and range-free techniques. In range-based, the distance among target and anchor node can be estimated by Received Signal Strength (RSS), Time of Arrival (ToA), Angle of Arrival (AoA) and Time Difference of Arrival (TDoA) [8], [9]. On the other hand, in range-free, hop count is considered as distance between target and anchor nodes. Range-free methods include Multi-Dimensional Scaling (MDS), Distance Vector HOP (DV-HOP), and Ad-hoc Positioning System (APS) [10], [11]. Although in large networks, range-free techniques are more feasible due to low cost but results of range-based techniques are more accurate than range-free techniques.
As static nodes can localize easily but, deployment of nodes can never be visualized fully static in some cases. Secondly, the mobility of nodes has so many challenges and issues such as energy consumption, connectivity, coverage and it is necessary to minimize these challenges and the most important challenge is accurate localization. To localize each moving target node in the networking area with high accuracy and less computing time, the most important thing in the mobile scenario is the requirement of the number of anchor nodes and path planning followed by that anchor nodes. Many localization algorithms require a large number of anchor nodes to achieve higher energy which leads to an effect on system cost and high energy consumption.
In WSNs, node localization is considered as multi-dimensional and multimodal optimization problems. These types of problems can be solved by bio nature-inspired algorithms [12]. In this paper, for the first time, a single mobile anchor node traverses the whole network by following a specific path i.e. Hilbert trajectory at a constant speed to localize randomly deployed target nodes by using SSA. As anchor nodes can emit beacon messages only in one direction, so Hilbert path allows an anchor node to change the direction of emitting beacon messages. Moreover, in previous work, SSA has not been used for mobile scenarios. Initially, by using RSS, distance is estimated among target and anchor nodes. Once distance computed, six virtual anchor nodes are projected around the target node concerning the anchor node (at the same distance of computed distance) in the shape of the ring. The angle between two virtual anchor nodes is 60 degrees. Trilateration method (discuss in section 5) is applied for evaluating the accurate location of target nodes. After a fixed period, this algorithm is run again and again until all the target nodes get localized in the networking area. The performance of the proposed approach is compared with existing algorithms i.e. PSO and HPSO. The simulation shows that the proposed approach has better results in factors of a localized node, computing time, and localization accuracy.
In this paper, the proposed method has the following benefits.
1. A Range-based method in which single mobile anchor with six virtual anchors projected around the anchor in the shape of a ring with an angle of 60 degrees concerning the anchor node by using SSA for the first time. 2. One single mobile anchor node equipped GPS with six virtual anchor nodes are used to prevent the problem of LoS. In the presence of three anchor nodes, LoS has an important role to determine the exact location of the target nodes. 3. There is no need to increase the number of anchor nodes with the increase in target nodes. A single anchor node can be used to localize all target nodes in the network. 4. Unlike the static scenario method, the proposed localization method doesn't require parallel processing of anchor nodes and neighbor reference nodes which reduces the computational complexity.
The remaining part of the paper is categorized as follows: Related work in this field is presented in Section 2. Swarm intelligence based algorithms PSO, HPSO, and SSA are presented in detail in Section 3. The Hilbert-curve Trajectory is explained in Section 4 followed by Section 5 with the mathemat-ical formulation of node localization step by step is explained. The simulation results of the proposed work are discussed in Section 6 followed by the conclusion.

Related work
In the past decades, WSNs becomes a hot topic due to their various fabulous features used in different real-life applications. Node localization is an essential part of WSN. To solve localization problems in WSNs, various localization algorithms have been proposed. In this section, some of the current works are described briefly.
Hu et al. [14] proposed a radio frequency-based Mobile Anchor centroid Localization method where one mobile anchor is used to localize nodes. Anchor node broadcasts its coordinates information in the network periodically. As there is no need for any hardware so it is cost-effective and the simulation outcome shows that it has less computing time and high accuracy. Kim and Lee [15] proposed a solution for localization named as Mobile Beacon-Assisted Localization (MBAL) Scheme that reduces anchor node's overhead by providing efficient path planning with less computational complexity.
Koutsonikolas et al. [16], studied three trajectories namely Scan, Double scan, and Hilbert curve for the mobile anchor node with static target nodes. The author observed at a small resolution, the scan trajectory has the lowest localization error. But when the resolution is large then Hilbert trajectory has the lowest localization error. In Scan, mobile anchor nodes move only in one dimension that causes the LoS problem. Anchor node moves in two dimensions in X-axis and the y-axis in double scans. But node traverses double path length, accordingly the battery overhead increases. To eliminate the double traversing of a path as well collinearity of beacon signals in signal direction, the Hilbert anchor node moves in a curved trajectory. Any trajectory can be judged based on path length, localization accuracy, and coverage. To overcome the problems of collinearity, Huang et al. [17] proposed two new paths CIRCLEs and S-CURVE. As circles are not able to cover all corners, therefore to cover the maximum area we need to enlarge circles with a greater radius which causes large path length also. Although range-based algorithms are more accurate still range-free algorithms are more convenient and to overcome the limitations of range-free. Kaur A et al. [18] presented a solution by improving the traditional DV-hop method. The entire network is divided into small squares so that each target node falls under this range at least once and the mobile anchor node follows linear path planning and triangular path planning. The least-square method is used to calculate the distance from the center of each square cell.
Singh P et al [19], elaborated on the RSS-based method in which mobile anchor follows a Hilbert path for node localization by using PSO and HPSO. Once unknown nodes fall under the communication range of the anchor node, the Euclidean distance is evaluated and at the same distance, six virtual anchor nodes are projected about the anchor node with an angle difference of 60 degrees to reduce LoS. Apply the trilateration method for estimated coordinates.
The localization approach based on Salp Swarm Algorithm (SSA) for a fully static randomly deployed network is available in [20]. The performance of SSA is analyzed and compared with existing optimization algorithms. The outcomes depicted that SSA has better performance in all the terms named as localized nodes, computing time, and localization accuracy. An algorithm for localization called Group of tri-Mobile Anchors (GMTA) follows an adjustable square trajectory in the WSN area improved the localization accuracy by using less number of anchor nodes [21]. There is only one anchor node equipped with GPS and the position of the other two anchor nodes can be calculated by motion and Trigonometric equations. These three anchor nodes are connected in the form of an equilateral triangle. The mobility of the anchor node is based on the density of deployed anchors in the network. An adjustable trajectory by using the proper order of Hilbert space-filling curve, to achieve overall network coverage and desired packet delivery ratio with less energy consumption is presented in [22]. This method is based on two factors. First, based on network size trajectory is constructed. Second, in particular, the subarea adjustable trajectory is based on the density of nodes. In the end, the whole trajectory is combined. The authors proposed a new non-linear optimization method called Intelligent water drops (IWDs) for localization [23]. Outside the WSNs, once a static sink node is deployed which it connects to processing units. Initially, each node undergoes position estimation by using multi-lateration then for optimal solution IWDs are applied. This method achieves large localization accuracy as compare to estimation method multi-lateration and existing optimization algorithms like an Ant Colony Optimization (ACO), PSO, and genetic algorithms (GA).
Han et al. [24] proposed two new paths planning GSCAN and GTURN for a group of mobile anchor nodes by using boundary techniques Translocation Method (TM) and Compensation Method (CM). The whole field is divided into small rectangles where three anchor nodes are deployed in the shape of a regular triangle, the edge weight equals to communication range. TM enhances its area of sense in such a way that its sensing area is greater than the monitoring area and CM increases beacon messages at the boundary of the field. As compares to other path planning methods, this method shows better results in terms of computing time and localization error. But the path length increases. Range-based node segmentation with improved particle swarm optimization (NS-IPSO) is proposed by Phoemphon [25], in which a group of anchor nodes is formed based on the shortest path between them, and the network area is divided into small segments by using boundary box techniques in which unknown nodes positioning into C-shape, S-shape an H-shape. Then, calculate the count of hops among anchors and unknown nodes. C-shape has the highest accuracy and S-shape has the least.
Singh P et al. [26] proposed a Range-Based based localization algorithm for moving target nodes with static anchor nodes that are deployed at the border of the network by using the application of PSO. Firstly, the distance between the anchors and unknown nodes is computed. Afterward, the Trilateration method is used to calculate centroid and to evaluate error estimation apply PSO. Stromberg et al. [27] have shown a dynamic behavior tree growth algorithm (DynsTGA) to enhance the balance of exploitation-exploration and swarm intelligence Hybridized Elephant Herding Optimization (HEHO) for static target nodes with dynamic anchor nodes deployed randomly. RSS is used to estimate the distance between the anchor and target node to apply trilateration. The simulation results are compared with BOA, FA, and PSO. A summary of the comparison of the existing work with the proposed work is given in Table 1.

H-best particle Swarm Optimization
In 1955, Eberhart and Kennedy [28] proposed PSO based on the behavior of fish schooling and the flocking of birds. PSO consists of swarms sm called particles deployed in search space where it finds source food in n-dimension.
In search space, every search particle have initial position x id and initial speed S id in any d-dimension where 1 ≤ i ≤ sm and 1 ≤ d ≤ n.
In search area, the PSO employs a set of solutions where every individual particle is allowed to learn from its own experience and from neighbor particle's location. The cost function i.e. the difference among estimated value and actual value of each particle is calculated. Each particle moves towards best solution by calculating its personal best (p best ) and then out of personal best, global best (g best ) is selected. Although g best has good quality of quick evolution but due to less number of computations the chances of g best trapped in local optima is high. In order to increase accurate solution, the entire swarm is divided into sub-swarms and the swarms has best position in these sub area is called local best (l best ). The convergence of l best is more mature but slow. The enhanced version of PSO is HPSO, in which the i th particle belongs to sub-swarm collectively attracted towards its old p best position i.e. p i , and over all best position p g is explained below. In ddimension , the i th particle of swarm is represented as Consider, in past the best position of i th particle is denoted by pt i = [pt i1 ,pt i2 ,pt i3 ,. . . pt id ]. When entire swarm is divided into sub-swarm, each sub-swarm has its own best particles denoted by pt l =[pt l1 , pt l2 , pt l3 , . . . .pt ld ], and globally best particle is denoted by pt g =[pt g1 ,pt g2 ,pt g3 ,. . . pt gd ]. The updated speed and location of particles is evaluated by following (1) and (2) x Where x id+1 and S id+1 are updated position and speed of swarms resp. ξ is inertia weight. C 1 , C 2 and C 3 are cognitive learning , social learning and neighborhood learning parameter resp. r 1 , r 2 and r 3 are random values in interval of [0,1].

Salp Swarm Algorithm optimization
As meta-heuristic belongs to the category of stochastic optimization techniques and due to the advantages of meta-heuristic techniques like gradient-free and flexibility they found in science and industry. These advantages solve problems with only input and output instead of calculating the derivation of the search space. Meta-heuristic techniques are of two types: evolutionary and swarm intelligence. Swarm intelligence in nature mimics the intelligence of fishes, birds, bees, ants, etc without having any central control. In nature, no one can tell how and where these species find their food [13].
Salps look like a jellyfish in movement and texture having a transparent limpid cylinder design body and is pushed by the water. In the mathematical model, the salp chain is divided into two parts: only one leader and the rest are followers. The position of leader salp is first in the chain and other salps follow the leader as shown in Figure 1. Like other swarms-based methods, in SSA the position of the SALP chain is illustrated in an n-dimensional search space. Here, given problem n is the number of variables and position of all salps in-store in 2D matrix named as X. The swarm's target is to find out food source "f" in space search. The position of leader salp is update by following (3).
Where in i th dimension, x 1 i is the location of the leader salp, f i is the location of the source food, ub i demonstrate the upper bound, lb i is the lower bound, r 1 , r 2 and r 3 are random numbers. The parameter r 2 and r 3 precept the next move should be either positive or negative infinity with step size and generated uniformly in the interval of [0,1]. As important parameter r 1 balances the exploration and exploitation is given below (4): Where k and K are the current and maximum number of iterations respectively.
According to Newton's law of motion, the position of followers can be updated by (5): Where the value of i 2, depicts the position of j th follower salp in i th dimension, Where v ϕ is the initial velocity, t is the time.

Hilbert curve
In 1981, David Hilbert proposed a Hilbert space-filling curve [29]. In Hilberttrajectory, the mobile anchor node should traverse all the target nodes in the network only one time to collect data from sensing nodes timely and efficiently.
To traverse the entire network, in the initial step Hilbert curve divide twodimensional square S×S onto two-dimensional sub-squares s × s. Suppose, the network is divided into N number of sub-squares and the sub-squares can be evaluated by (7).
Where β is the order of curve (β=1,2,3..). For various values of order and the sub-square can be evaluated by (8).
The best order means, the Hilbert curve traverses the whole network with a minimum order and the correct order of Hilbert is depends upon network estimation. In this paper order of Hilbert trajectory is 2 as shown in Figure 2.

Mathematical representation of node localization problem
In WSNs, The primary objective of node localization is to determine the coordinates of randomly deploy N unknown target nodes coordinates (X t ,Y t ) by using GPS equipped M anchor nodes coordinates (X a ,Y a ) in a total number of nodes n = N + M having communication radius R with distance information among anchor, target node and single hop range-based distributed method. In two dimensional, 2N is the total number of unknown coordinates. θ = θ x + θ y , where θ x is x-coordinates and θ y is y-coordinates of unknown nodes. A target node is only considered to be localized if it falls under the communication radii of three anchor nodes.In this paper, only one mobile anchor node follows sixteen position in the sensing area as shown in Figure 3. and is used to localize nodes of the whole network and algorithm is explained step by step in this section:  The Nodes N are randomly deployed in a network. The whole network is divided into small squares. Initially, the anchor node is placed at [0, 0] coordinates and following Hilbert curve trajectory to go through each square as shown in information. Based on received signal strength, the distance among the target and anchor node is evaluated by (9) as shown in Figure 5. 2. The estimated distance is disturbed with some gaussian noise N i equation (10).D 3. Once estimated distance is calculated, at the same distance in the shape of ring six virtual anchor nodes having coordinates (XV 1 ,Y V 1 ), (XV 2 ,Y V 2 ), , and (XV 6 ,Y V 6 ) are projected around anchor node. To evaluate centroid (X c ,Y c ), Out of six virtual anchor nodes, only two virtual anchor node and a third is anchor node (total three) are used in the shape of an equilateral triangle for Trilateration Method as shown in Figure 6. by using (11).
The evaluated centroid is considered as estimated coordinated (X e ,Y e ) of the target nodes. 4. Deploy salp particles around evaluated centroid as shown in Figure 6.
Where m 3, according to the trilateration method, in 2D at least three anchor nodes are required to calculate centroid (see, Figure 7). 5. Once all target nods are localized N L , Localization error E L is computed as the mean of square of distance between the actual node coordinates (X t ,Y t ) and estimated node coordinates (X e ,Y e ) (13) as shown in Figure  8.
6. The efficiency of the algorithm is computed by average localization error E L and the number of non-localized nodes.
The higher the value of E L and N N L , the lower the efficiency and performance of the algorithm.  The complete flow diagram of the proposed algorithm is shown in Figure  9.

Simulation results and Discussions
The WSN localization simulation is done in MATLAB software by utilizing the applications of SSA in a network of 15m * 15m where 1 mobile anchor node in the Hilbert curve path with 50 static target nodes as shown in Figure 4. The simulation is performed on a personal computer having an Intel Core i5 2.50 GHz processor and 8 GB of RAM. Below is the author's proposed strategy settings are particular for the application of SSA. The parameters used by PSO, HPSO, and SSA are given in Tables 2 and 3 respectively. The communication radius can be increased according to the size of the network area. In this paper, the author has been used 15m * 15m, so the communication range is 5m. For a large number of localized node communication range can be increased up to 10 or more than that.
In the scenario of the mobile anchor node, the authors investigated SSA based localization of target nodes. This algorithm is stochastic, therefore for the same deployment, no identical solutions will be available. In this paper, the   The simulation results of the proposed algorithm are in terms of the localization error (distance among actual target nodes and estimated target nodes) and the number of localized nodes. The simulation results are compared with the applications of PSO and HPSO [19]. At a specific position of anchor node, Max LE is the maximum localization error, Min LE is the minimum localization error and ALE is the average localization error as given in Table 3. Localized nodes mean the number of nodes in the communication radius of anchor nodes at a specific position having their estimated coordinates. The simulation results of the average localization error of SSA, PSO, and HPSO are shown in Figure 10, where SSA has the lowest localization error and PSO has the highest localization error. The localization error of PSO, HPSO, and SSA are 45%, 38%, and 28% respectively.
The computational time of the localization algorithm should be less i.e in less computing time the algorithm should localize the maximum number of nodes. Figure 11 shows that specific sixteen positions of anchor nodes, the computational time for PSO, HPSO, and SSA respectively. With the purpose of less computing time, only 100 iterations are used. To increase localization accuracy, the number of iterations can be increased. The average computing time for PSO, HPSO, and SSA are 0.0745 seconds, 0.0349 seconds, and 0.0294 seconds respectively.  On the other hand, the localized nodes by SSA are almost double as compared to the PSO and HPSO as shown in Figure 12 and the count of localized nodes at a specific position of anchor node is also given in Table 4.
In literature, there are many localization algorithms available for the static scenario but in the case of a mobile scenario, very less work is done. Table 4 distinguishes the proposed algorithms from various approaches available in related work. When mobile anchor traverses network by following sixteen positions and the simulation results of each anchor position are shown in Figure  13. where the blue diamonds show the actual target positions and red plus shows the estimated position of nodes. The red circle in the center is an anchor node surrounded by six virtual anchor nodes in the shape of the ring.

Conclusions
In this paper, a range-based localization method with a single mobile anchor node following Hilbert trajectory by utilizing the application of SSA is presented. When the target node falls under the communication range of the anchor node, distance is calculated by the use of RSS among target and anchor nodes. Once the distance is calculated, at an angle of 60 degrees, six virtual anchors are projected in the shape of the ring around the target node with the same distance. The localization accuracy and number of localized nodes of the proposed algorithm are better as compared to applications PSO and HPSO with less computing time. The localization error of the proposed approach is 10 % less than HPSO and 17 %less than PSO. The proposed algorithm can be used for military applications or in a difficult environment like a forest and ocean where a human cannot go and fix nodes. The proposed algorithm can be implemented for single-hop/multi-hop range-free localization for a fully mobile scenario. Future work is focused on the hybrid algorithm with different path planning which can be used to gain high accuracy.

Funding
Not applicable.

Conflicts of interest/Competing interests
The authors declare no conflict of interest.

Availability of data and material
The data that support the findings of this study are available from the first author upon reasonable request.

Code availability
The code is available from the first author upon reasonable request.