Localization Based on MAP and PSO for Drifting-Restricted Underwater Acoustic Sensor Networks

Localization is a critical issue for Underwater Acoustic Sensor Networks (UASNs). Existing localization algorithms mainly focus on localizing unknown nodes (location-unaware) by measuring their distances to beacon nodes (location-aware), whereas ignoring additional challenges posed by harsh underwater environments. Especially, underwater nodes move constantly with ocean currents and measurement noises vary with distances. In this paper, we consider a special drifting-restricted UASN and propose a novel beacon-free algorithm, called MAP-PSO. It consists of two steps: MAP estimation and PSO localization. In MAP estimation, we analyze nodes’ mobility patterns, which provide the priori knowledge for localization, and characterize distance measurements under the assumption of additive and multiplicative noises, which serve as the likelihood information for localization. Then the priori and likelihood information are fused to derive the localization objective function. In PSO localization, a swarm of particles are used to search the best location solution from local and global views simultaneously. Moreover, we eliminate the localization ambiguity using a novel reference selection mechanism and improve the convergence speed using a bound constraint mechanism. In the simulations, we evaluate the performance of the proposed algorithm under different settings and determine the optimal values for tunable parameters. The results show that our algorithm outperforms the benchmark method with high localization accuracy and low energy consumption.


Introduction
Underwater Acoustic Sensor Networks (UASNs) have been widely applied in many fields such as underwater surveillance, pollution detection and disaster prevention [1,2]. Generally, an UASN is comprised of different types of nodes, which can be floating sensor nodes, surface buoys, Autonomous Underwater Vehicles (AUVs) and other application specific devices [3,4]. These nodes communicate with each other and sense underwater environments collaboratively. The sensed data is then analyzed to provide decision support for the upper applications. In this process, the locations of nodes need to be aware to interpret the sensed data meaningfully. Hence, localization is one of the critical services in UASNs.
The whole localization process consists of two steps: MAP estimation step and PSO localization step. In the former step, the nodes that can communicate with each other form a cluster. The distances between cluster nodes are estimated using the TOA method. Then, the priori localization information and the distance measurements are fused to obtain the posterior probability distribution of unknown nodes' locations and derive the weighted objective function by maximizing the logarithm of posterior distribution under the Bayesian framework. In the latter step, a swarm of particles are initialized according to its movement area, and then updated iteratively towards local and global best solutions with a certain speed. By calculating the fitness value of the objective function and communicating with each other, the particles collaboratively determine best location solution. Specifically, our contributions are mainly as follows: • This paper proposes a novel localization method without the presence of beacon nodes for DR-UASNs, which achieves higher localization accuracy and lower computational cost compared with the benchmark method.

•
The noises varying with distances are taken into account, which is modeled by additive and multiplicative noises. Hence the noises in distance measurements can be efficiently filtered for improving localization accuracy.

•
The reference selection and bound constraint mechanisms are proposed to combat the problems of localization ambiguity and low convergence speed in the PSO step.
The rest of this paper is organized as follows: in Section 2, we briefly review existing works on UASN localization. Then, the network model is presented and the localization problem is formulated in Section 3. Section 4 presents the localization process of the MAP-PSO algorithm. In Section 5, we evaluate the performance of the MAP-PSO algorithm under different settings and conduct comparison with the AFLA algorithm. Finally, conclusions are drawn in Section 6.

Related Work
Existing localization schemes can be divided into two categories: range-free and range-based. While range-free schemes provide coarse-grained location estimations with low communication cost, range-based schemes can achieve a relatively high localization accuracy, but with additional communication and hardware cost. In this work, we are interested in range-based schemes. Next, we briefly review some works related to our method, and more detailed research review can be found in [4,27].
In general, range-based localization consists of two stages: distance estimation and location calculation. The ranging method commonly used is TOA, which gets the difference between packet sending and receiving time and estimates the distance by multiplying the time difference and the acoustic speed. However, it suffers from low accuracy due to multiple factors such as time synchronization, multipath effect and stratification effect. In [3,25] , the localization does not require time synchronization. It is assumed that beacon nodes move in the vertical direction and unknown nodes are stationary, which are unpractical in underwater environments. Several works jointly consider the time synchronization and localization problems [6,9,19,28], in which time synchronization is first performed to obtain clock skew and offset, and then the locations are estimated based on synchronized distance measurements. In [10], a novel ranging method is proposed under the assumption of isogradient sound speed profile (SSP), i.e., the sound speed is linearly related to the depth in each SSP layer. Given the depths of two nodes and the TOA measurements, it calculates the horizontal distance through a root finding algorithm. This method has high accuracy, but with high computational cost. Further, RAR [29] is proposed to enable real-time localization based on Bellhop model. Its main drawback is that the Bellhop model can't reflect time-varying characteristic. In [8], TOA measurements from multiple paths are assumed to follow a mixture of three Gaussian distributions corresponding to LOS, SNLOS and ONLOS links, and then an EM algorithm is used to accurately classify different types of links.
In a 3D UASN, the locations of unknown nodes can be figured out by using classic multilateration algorithm and the ranging measurements to at least four beacon nodes. Further, the number of beacon nodes can be reduced to three by projecting them onto unknown node's horizontal plane [7,12]. In [30], a hyperbola-based localization method is proposed, in which the ambiguity existing in multilateration can be eliminated. For large-scale and sparse UASNs, many unknown nodes can't be localized due to lack of sufficient beacon nodes. Hence, an iterative localization strategy is commonly adopted to improve the localization coverage [15,25,31,32], in which unknown nodes that have been localized with high accuracy can be regarded as reference nodes to help other unknown nodes' localization.
All of these algorithms mentioned above assume the nodes drift freely with ocean currents and need the presence of beacon nodes prior to localization. Moreover, the number of beacon nodes often increases with the network scale. This increases both the network cost and the difficulties of network recycling and maintenance. In [21], the authors assume nodes drift in a restricted manner and propose a localization algorithm without beacon nodes, called AFLA. The algorithm takes advantage of the geometrical relationship of three adjacent nodes and forms six equations to figure out their locations. However, AFLA does not take into account the noises varying with distances and has a high computational cost due to direct search in the solution space, which makes it inapplicable for UASN localization. In this paper, we adopt the similar network architecture and propose the MAP-PSO algorithm to solve the problems of varying noises and computation complexity.

Network Model and Problem Definition
In this section, we present the network model, analyze the drifting characteristic of underwater nodes and present formal definition of the localization problem.

Network Model
We consider an UASN that consists of a number of nodes deployed at the surveillance area. To reduce the network cost, each node is low-complexity with constrained energy and limited computational ability. Due to the intrinsic fluid property of underwater environments, the nodes move continuously with ocean currents. This requires the localization should be accomplished in a short time, otherwise the estimated locations will become obsolete as the nodes move to new locations. Hence, it is necessary to design a fast and energy-efficient algorithm to provide real-time localization in this resource-constrained network.
As a consequence of the continuous mobility, some nodes may drift out of the deployment area, which increases the difficulties of network recycling and maintenance. Aiming at this problem, we follow a drifting-restricted UASN. Its network architecture is shown in Figure 1. Each node is linked to an anchor point by a cable and thus the movement of each node is confined in a local area. The locations of anchor points and the length of cables are known beforehand. Take node i for example, let L i denotes the length of its cable and A i denotes the location of its anchor point. In practical scenarios, the cable length may vary with surveillance requirements (e.g., tens of meters in nearshore areas [33] and hundreds of meters in offshore areas [34,35]). At the deployment phase, to prevent the cables of different nodes from twisting together, the distance between the anchor points of nodes i and j should be longer than the sum of the length of their cables: To ensure the nodes float in the water all the time, the length of the cables should be less than the sea depth H. Due to the impact of tide rise and fall, the sea depth should satisfy: where H min denotes the sea depth of the highest tide and H max denotes the sea depth of the lowest tide. Therefore, the length of the cables satisfies: At the same time, due to the tension of the cable, the depth of each node satisfies: Generally, the movement of the nodes is controlled by joint forces from ocean current, water buoyancy and the cables. The buoyancy of each node is related to its volume, the water density and the acceleration of gravity. The water density is further influenced by ocean temperature and salinity. Hence the buoyancy of each node is a constant value in a certain spatial and temporal extent due to slow change of ocean temperature and salinity. The force of ocean current is mainly influenced by the current speed.
At a specific depth, the three forces reach a balance state. The node can drift on the plane of this depth and move along a circle centered at its anchor point. According to Pythagorean theorem, we have the following equation for node i: where r i denotes the radius of its movement circle. Ideally, if we assume ocean current is infinitesimal, the forces from water buoyancy and the cables reach balance in the vertical direction, then we have h i = L i and r i = 0; on the contrary, if we assume ocean current is infinite, we obtain h i = 0 and r i = L i . Hence, according to different current speed, the movement radius r is 0 < r i < L i . In practice, the depth h i can be obtained by equipping with a cheap pressure sensor. According to Equation (2), the radius r i can be calculated as r i = L 2 i − h 2 i . Therefore, the location of node i is constrained on a circle centered at the anchor point A i with the radius r i . This indicates that the surveillance coverage will increase with the cable length and the node depth. This priori localization information hidden in the network model, as we will see later, can simplify the search space of localization solutions and reduce the localization time greatly.
To exploit the spatial relationship between nodes for localization, a node communicates with its neighbor nodes and measures the distances to them by multiplying the propagation delay by the acoustic speed. Most researches adopt one-way TOA method for distance estimation [5]. However, this method requires time synchronization between nodes, which is non-trivial in the harsh underwater environments. Alternatively, we adopt two-way TOA method for two reasons. One reason is that two-way TOA method can eliminate the clock offset between nodes and thus time synchronization is not requisite. The other reason is that the acknowledgement mechanism is commonly used in UASN MAC layer due to the inherent unreliability of underwater acoustic channel. Even if we adopt one-way TOA method, each packet needs an acknowledgement to guarantee successful packet transmission, which is similar with two-way TOA method. There have been multiple MAC protocols [36,37] for arranging packet transmissions and solve packet collisions, which is out of the scope of this paper. Herein, we take two nodes A and B as an example to illustrate the packet exchanges of two-way TOA method. A sends a ranging packet at time instant t 1 . B receives the packet at time instant t 2 and responds with an acknowledgement at time instant t 3 . Then A receives the response at time instant t 4 , the propagation delay can be calculated as After that, the distance between A and B can be estimated as where c represents the speed of acoustic signals. In each packet exchange, a node sends a packet at the power level P tx and receives a packet at the power level P rx . Let L P and L A represent the size of ranging packet and acknowledgement packet. Hence, the energy consumption of the transmitting node is E tx = P tx × L P R + P rx × L A R where R denotes the data rate. The energy consumption of the receiving node is we can estimate the distances between a node and all of its neighbor nodes and calculate the overall energy consumption. Based on the priori localization information and spatial relationship between nodes, our purpose is to accurately estimate the locations of all the nodes with low computational and communication costs as fast as possible. Next we will present formal definition of the localization problem.

Problem Definition
Suppose there are N nodes in the whole network and each node needs to get its location periodically. We define T as the localization period in which each node needs to estimate its location. Note that, the localization period can be tuned according to practical requirements (e.g., in a UASN that observing ocean phenomena, it can be set to be equal to an hour [1]). For simplicity, the superscript for the n-th localization period is suppressed in what follows. The node i moves at the circle centered at the anchor point A i with the radius r i . Therefore, its two-dimensional location can be represented as where (x i , y i ) denotes the locations of node i in the X-and Y-axes directions, (x i A , y i A ) denotes the locations of anchor point A i in the X-and Y-axes directions, and θ denotes the azimuth angle between the X-axis and the line that connects the anchor point and the node. On this basis, we aim to find M nodes to form a node cluster S. The number M should be more than 3 (e.g., M = 4 in Figure 1) so that a localization polygon can be constructed. Moreover, these nodes should be mutually neighbor nodes. Hence, for any two nodes i and j in the cluster, their locations satisfy the equation the three-dimensional location of node i, and C i denotes the communication radius of node i. The distance estimation z i,j between the two nodes can be obtained using Equations (3) and (4). In the cluster, there are totally M(M − 1)/2 node pairs and each pair has its corresponding distance estimation. Hence the measurements of the cluster S can be represented as Z = {z i,j |∀i, j = 1, 2, ..., M, i < j}. Similarly, we can find all the other clusters in the network and obtain their corresponding measurements.
For each cluster, we now have represented the two-dimensional location of the nodes and obtained the distance estimation between any two nodes. Given these data, the localization problem is to fuse them using a proper model and figure out the locations of all the cluster nodes. Specifically, our purpose is to minimize the sum of the squares of the errors between estimated distances and real distances. The objective function can be written as arg min The locations of M nodes can be resolved using efficient optimization methods. The whole localization process lasts until all the clusters have been localized. Next, we will present the algorithm that can fast localize the nodes without ambiguity.

MAP-PSO Design
In this section, we present MAP-PSO, a novel localization scheme without the presence of beacon nodes for DR-UASNs. The whole localization process consists of MAP estimation and PSO localization. In the following, we describe the details of our MAP-PSO algorithm starting from the MAP estimation step and followed by the PSO localization step.

MAP Estimation
Recall the localization problem defined in Equation (6), we didn't take the noise into account, which may incur large errors of location estimations. Here, we consider two types of noise. One is that every node may not accurately move along its corresponding circle due to the error introduced in the practical deployments, such as the displacement of anchor points, the error of cable length, the volume of nodes, etc. The other is the distance measurements between nodes may deviate from real distances due to complex underwater environment factors, including non-straight propagation of acoustic signals, varying acoustic speed and tiny propagation time errors from clock skew.
To characterize the nodes' mobility patterns, we assume the location of each node is randomly distributed around its corresponding movement circle, which can be represented as where w i x and w i y denote the noises of the location of node i along X-and Y-axes, and follow a Gaussian distribution with zero mean and precision Λ, that is, w i x ∼ N (0, Λ) and w i y ∼ N (0, Λ). This implies that the noises of different nodes are assumed to be identically distributed. Then, we transform Equation (7) to its vector form and obtain the following formula For simplicity, we assume w i x and w i y are uncorrelated with each other. Then the noise w i is a Gaussian variable with zero mean and the precision matrix ΛI, where I is the identity matrix. Hence, the location of node i follows a joint Gaussian distribution with meanx i and precision ΛI: Here, the depth h i is not considered because it can be measured beforehand by a pressure sensor. The uncertainty of the location x i and radius r i due to inaccuracy of depth measurements can be accommodated by the Gaussian distribution in Equation (9). It is important to note that this probability distribution is extracted from DR-UASN architecture, which can be treated as the prior knowledge of MAP estimation.
We now discuss how to model the noises in distance measurements. In [10], it has been found that the TOA error increases with real distance due to non-straight propagation. Hence, it is reasonable to assume that the ranging error caused by noise increases linearly with the real distance. Here, we use both additive and multiplicative noises [38] to model the distance measurements: where d i,j = ||X i − X j || denotes the real distance between node i and j, α i,j is the multiplicative noise that follows a Gaussian distribution with mean µ α and precision λ α , that is, α i,j ∼ N (µ α , λ α ), and β i,j is the additive noise that follows a Gaussian distribution with zero mean and precision λ β , namely, . For simplicity, we assume that these two types of noises are uncorrelated with each other. The total noise can be denoted by i,j = α i,j d i,j + β i,j , which is also a Gaussian variable with mean Then, the conditional probability distribution of z i,j over x i and x j can be written as For all the distance measurements Z in the cluster S, the likelihood function of the locations can be written as Based on Equation (9), the priori probability distribution of the locations X is given by Using the Bayesian theorem, the posterior probability distribution of X given the measurements Z can be derived as Then the locations X can be determined by maximizing the posterior distribution p(X|Z). Taking the logarithm of p(X|Z), we have Substituting Equations (9) and (11) into Equation (15), the maximum of the posterior probability is given by the minimum of where the irrelevant terms with the unknown locations X terms are omitted. Note that, considering λ i,j depends on the real distance d i,j that are determined by the unknown variable X, we have replaced λ i,j withλ i,j = (λ −1 α z 2 i,j + λ −1 β ) −1 under the assumption of the small deviations between z i,j and d i,j . Now let us analyze the ratioλ i,j toλ k,l (z i,j , z k,l ∈ Z): Multiplying both numerator and denominator with λ −1 β , we get In the simulations, we have assigned approximate values to λ α and λ β , that is, λ −1 α λ β ≈ 1. Taking the assumption that z i,j 1, which is reasonable for DR-UASNs, the above equation can be reduced aŝ Then we can replaceλ i,j with z −2 i,j in Equation (16) and execute equal operations to the second sum term. The objective function can be rewritten as: where δ = λ −1 α Λ. This function has two implications. On one hand, for the first sum term, each square error term has its own weight that is inversely proportional to the square of the distance measurement. Thus the location variables X tend to determine their values that fit the square terms with high weights better. On the other hand, the parameter δ can be regarded as a penalty factor between the priori knowledge and the likelihood information. Assigning a large value to δ propels the location of each node to be at its movement circle accurately; on the contrary, if δ is assigned a small value, each node is allowed to deviate its movement circle to certain extent and its location is more determined by the likelihood information.

PSO Localization
The minimization problem of the objective function in Equation (17) has no analytic solutions due to it is nonlinear function of the location variable X. Traditional optimization methods such as gradient descent easily fall into local optimum and have low convergence speed. In this paper, we resort to PSO method to solve this minimization problem. It uses a population of particles to represent candidate solutions in the search space, moves these particles to local and global best solutions iteratively, and then finds the particle that fit the objective function best. The PSO method can efficiently escape from local optimum by considering local and global views simultaneously. Moreover, we propose the bound constraint mechanism to improve the convergence speed greatly. Next, we describe the PSO procedure in detail.
In Equation (17), besides the location variable X, the optimization variables also include µ α . Hence there are totally 2M + 1 variables, which can be denoted as We assume that there are N P particles initialized, that is, {P k } N P k=1 . Each of the particles represents an instance of the variable set. To reduce the search space, we initialize the position of the particle as follows: where µ L α and µ U α represent the lower and upper bound of µ α respectively, and rand is a random number in the range of [0, 1]. Note that, µ L α and µ U α can be determined based on the knowledge of the surveillance area or estimated by running multiple tests between two nodes with known locations.
Once the particles are initialized, they move to new positions with a certain speed in the search space. By calculating the value of the objective function, they can find the local best position pBest. Then the particles communicate with each other to know the global best position gBest. After that, the velocity and the position of each particle is updated as follows where is inertial weight, c 1 is cognitive acceleration factor, c 2 is social acceleration factor, rand is a random number in the range of [0, 1], pBest t k denotes the best solution found by particle k at iteration t, gBest t denotes the best solution found in the particle swarm at iteration t, v t k and P t k denote the velocity and position of particle k at iteration t, respectively. The parameter is critical to keep balance between local and global search. At the later phase of optimization, to avoid the oscillation phenomenon and improve the local search capability, the linear decreasing inertia weight [39] is commonly adopted to slow the particles over time. The inertial weight is updated as follows where max and min are the maximum and minimum weights respectively, and t max is the maximum iteration number. The optimization repeats the operations in Equations (19)-(21) until the termination condition is satisfied. There are two termination conditions in our method. One is the relative change of the best objective function value over t l iterations is less than a predefined threshold ρ; the other is the current iteration has reach the maximum iteration number, that is, t = t max .
In the above optimization process, there exist two problems that limit the localization accuracy and the convergence speed. First, a cluster with a small M is prone to localization ambiguity. As shown in Figure 2, three black solid circles are the real locations of nodes 1, 2 and 3, whereas the optimization gives the estimated locations as three red solid circles, resulting in low localization accuracy. This is mainly because that the distance measurements generated by few nodes have little constraint on the nodes' locations. Second, although we have bounded the position of each particle in the initialization phase, the optimizations of many clusters still have low convergence speed, especially in a high-dimensional space (a large M). To solve the first problem, we propose a novel reference selection mechanism to eliminate the ambiguity in localization. In practice, different clusters may overlap, that is, for two clusters S 1 and S 2 , part of their nodes are the same, S 1 ∩ S 2 = ∅. If S 1 is first optimized, the common nodes that are localized with high accuracy can be regarded as reference nodes to eliminate the localization ambiguity in the optimization process of S 2 . Traditional localization schemes mainly use the confidence value to indicate the localization accuracy, which can be calculated as where (u, v, w) is the estimated location of the unknown node, (u i , v i , w i ) is the location of reference node i and l i is the distance measurement between the unknown node and reference node i. However, this confidence mechanism does not hold true in our method. Take the nodes in Figure 2 for example, even though the estimated locations marked red has large deviations from the real locations marked black, the nodes 1, 2 and 3 have high confidence values because the distances based on the estimated locations fit the distance measurements well. Alternatively, we propose to select the reference nodes according to localization stability. This approach is simple, yet effective. Specifically, we define the sliding window with length set to T w that is an integer multiple of T, i.e., T w = B × T. A node i can act as a reference node when the following two conditions are satisfied: (1) the node should be localized in every localization period of a sliding window; (2) the change of the estimated locations of the node in any two consecutive localization periods should be below the maximum movement distance, ||X n i − X n+1 i || < V max × T, where X n i and X n+1 i denote the estimated location of the node at two consecutive localization period, V max denotes the maximum velocity of nodes.
Aiming at the second problem, we propose to further confine the particles' positions on the basis of their values initialized in Equation (18). As we have discussed above, a reference node has strong localization stability because its estimated locations have little changes in a sliding window.
Then we can use this characteristic to confine the search space of the reference nodes. Let X m j and θ m j denote the location and azimuth angle of the reference node j at the localization period m, respectively. Our approach is to set the tight bound of the location of the reference node at the localization period m + 1 and thus speed up the convergence of the optimization. We assume the cable linked to the reference node is always tense. The path that the reference node moves along is actually an arc, and its length should be less than the maximum movement distance V max × T. Accordingly, the maximum movement angle is calculated as for the lower and upper bound of the azimuth angle. Hence, for the reference node j, we can set the lower bound of its X-and Y-axes location as min(x j A + r j cos θ LB j , x j A + r j cos θ UB j ) and min(y j A + r j sin θ LB j , y j A + r j sin θ UB j ), and set the upper bound of its X-and Y-axes location as max(x j A + r j cos θ LB j , x j A + r j cos θ UB j ) and max(y j A + r j sin θ LB j , y j A + r j sin θ UB j ). This tight bound not only improves the convergence speed, but also propels the estimated locations of other nodes to their real locations.

Performance Evaluation
In this section, we evaluate the performance of the MAP-PSO algorithm using simulations.

Simulation Settings
In our simulations, 100 unknown nodes are deployed in a cubic region with the range 1000 m × 1000 m × 20 m. MAP-PSO does not need beacon nodes. Each node is linked to a fixed anchor point through a cable with the length 20 m. The anchor points of any two neighbor nodes should satisfy the Equation (1). The node depth is randomly distributed in the range [4,16], which ensures that every node floats underwater and has a proper monitoring coverage. Each node moves at the maximum velocity 10 m/s clockwise or anti-clockwise. The precision matrix of the noise of each node's location is given by Λ = 50I 2 .
As for the distance measurements, a node uses two-way packets to communicate with its neighbor nodes and estimates the distance based on Equation (3) and (4). For energy consumption, we adopt the parameters given in [40]. The packet size is set to be L P = 100 bytes and the acknowledgement size is set to be L A = 20 bytes. To model LinkQuest UWM4000 underwater modem, the data rate, transmission and reception power are set as R = 8.5 kbps, P tx = 7 W and P rx = 0.8 W, respectively. The communication range of all the nodes is set to be 150 m. The mean and precision of the multiplicative noise are set to be µ α = 0.02 and λ α = 60, respectively, and the precision of the additive noise is set to be λ β = 100. Once the distance measurements for all the node pairs in a cluster are collected, the PSO method is used to resolve the nodes' locations. The maximum iteration number is set to be 600. In each iteration, we set the number of the particles as N P = 200. Every particle updates itself according to Equations (19) and (20). The inertial weight is updated according to Equation (21), where the maximum and minimum weights are set to be max = 0.9 and min = 0.4, respectively. The cognitive and social acceleration factor are set to be c 1 = 0.5 and c 2 = 1.25, respectively. The optimization stops when the relative improvement of the best objective function value is less than ρ = 10 −3 over t l = 50 iterations.
Every simulation lasts for 100 s. We set the localization period as T = 1 s and use a sliding window with B = 5 localization period, i.e., T w = 5 s. Every simulation is run 50 times to eliminate the impact of randomness. In the simulations, we consider three performance metrics, which are localization accuracy, localization coverage and localization time. Localization accuracy is defined as the average error between estimated locations and real locations of all the localized nodes, and the standard deviation of the localization error is calculated as where e i denotes the localization error of the i-th localized node and e denotes the average error of all the localized nodes. Localization coverage is defined as the proportion of the localized nodes to all nodes. Localization time is defined as the period that starts when all the distance measurements for a cluster are collected and ends when the locations of all the cluster nodes are obtained. Based on the above settings, MAP-PSO and AFAL are implemented using the MATLAB 2014a platform, on a computer with an Intel Core i3-6100 CPU 3.7 GHz and 8.0 GB RAM.

Localization Performance under Different Parameters
The performance of the MAP-PSO algorithm depends on many important parameters, including the penalty factor, the maximum iteration number, the particle number and the minimum cluster node number. We aim to determine the optimal values of these parameters by simulations.

Impacts of the Penalty Factor
The penalty factor has an important impact on the localization accuracy. As we discussed above, assigning a proper value to the penalty factor will make a balance between the priori knowledge and the likelihood information. Therefore, it is necessary to determine the value of the penalty factor by simulations. Figure 3 shows the relationship between the localization error and the penalty factor. We can observe that there exists some critical value on the curve, where the algorithm has the minimum localization error and standard deviation. This implies that the algorithm has a strong robustness at this value. When the penalty factor is below this value, the algorithm overfits the noisy distance measurements and underfits the priori mobility pattern. On the contrary, if the penalty factor is above this value, the algorithm underfits the noisy distance measurements and overfits the priori mobility pattern. In both cases, the algorithm has larger localization error and standard deviation.

Impacts of The Maximum Iteration Number
The maximum iteration number is another important factor that impacts the localization performance. On one hand, if the maximum iteration number is set to be too small, the optimization may stop too early to converge to the optimal solution, resulting in low localization accuracy; on the other hand, if setting the maximum iteration number to be large helps to improve the localization accuracy, the optimization needs more computational resource, which is infeasible for resource-constrained UASNs. By choosing the penalty factor as 0.56 according to Figure 3 and changing the maximum iteration number from 50 to 600, the localization error and time under different maximum iteration number are shown in Figure 4. We can see that with the increase of the maximum iteration number, the localization error decrease rapidly and the localization time increase rapidly in the first. When the maximum iteration number increases to some point (e.g., 400 in Figure 4), both the localization error and the localization time stabilize gradually. This is because the optimizations of most nodes reach the convergence in less than 400 iterations.

Impacts of the Particle Number
The number of particles is a critical parameter to determine the search ability of PSO localization. In theory, the search ability can be improved by simply increasing the particle number. However, a large number of particles have to be updated according to Equations (19) and (20), which leads to high computational cost. Hence, it is necessary to find a critical point, where a balance between the localization error and the localization time can be reached. By choosing the penalty factor and the maximum iteration number as 0.56 and 400 respectively, the simulation results using 50 to 400 particles are shown in Figure 5. From the figure, we have two observations: on one hand, the localization time increases linearly with the particle number; on the other hand, the localization error decreases rapidly with the increase of the particle number at the beginning. But with the further increase of the particle number (e.g., greater than 200 in Figure 5), the localization accuracy does not have clear improvement any longer. Therefore, it is reasonable to choose the particle number as 200, which makes a tradeoff between the localization error and the computational cost.

Impacts of the Minimum Cluster Node Number
In the above simulations, we ignore the localization coverage because it is rarely affected by the penalty factor, the iteration number and the particle number. We now evaluate the performance under the minimum cluster node number. This parameter means that a cluster can't be localized if the number of its nodes is less than the minimum cluster node number. Figure 6 illustrates the results when the value of this parameter changes from 3 to 7. It is clear that when the minimum cluster node number is set to be small, the algorithm has low localization accuracy and high localization coverage. This is because most clusters can be localized when the number of their nodes is more than the minimum cluster node number. However, as we stated before, there exists the localization ambiguity due to that the polygon constructed by a small number of cluster nodes has little constraint on the nodes' locations. As the minimum cluster node number grows, both the localization error and the localization coverage decreases rapidly. This is mainly because with the increase of the minimum cluster node number, the localization ambiguity can be eliminated gradually and few clusters satisfy the localization condition. Further, we can observe that there exists a turning point at the minimum cluster node number of 4. Below this value, the localization coverage does not decrease much and the localization accuracy is greatly improved. But above this value, the localization coverage decrease sharply and the localization accuracy has little improvement. In addition, the minimum cluster node number is closely related to the network density. As the network density grows, its value can be set to relatively large. In this way, the algorithm can achieve high localization accuracy and coverage simultaneously.

Localization Results
By choosing the optimal values of the penalty factor, the maximum iteration number, the particle number and the minimum cluster node number, we set the node density as 8 by adjusting the communication range of the nodes as 160 m and evaluate the localization result of each node. Figure 7 shows the localization error of all the unknown nodes. The average localization error of all the unknown nodes is 2.33. The error of 59% unknown nodes is less than the average error and the error of 93% unknown nodes is less than 3.5 m, which means that most unknown nodes have high localization accuracy compared with the communication range. Furthermore, we note that the localization error of some unknown nodes has large values (such as nodes 25, 52, 88 and 78), which means the localization accuracy of these nodes is not very high. This is mainly because these nodes are localized when the number of nodes in their clusters is small, resulting in that the localization ambiguity is not eliminated completely. On the whole, the localization result indicates that the localization accuracy is satisfiable and the localization algorithm is robust to noisy underwater environments.

Performance Comparison with AFLA
In this section, we compare the localization accuracy and time of MAP-PSO with that of AFLA under different parameters, including the measurement noise level and the node density. The localization coverage is not evaluated because both algorithms have the same localization coverage under the two parameters. According to the above simulations, we choose the penalty factor, the maximum iteration number, the particle number and the minimum cluster node number as 0.56, 400, 200 and 4, respectively. The unique parameters of AFAL are set according to [21].

Impacts of the Measurement Noise Level
We first compare the performance of both algorithms under different measurement noise levels. As we stated before, the measurement noise is composed of the additive and multiplicative noises. Due to the additive noise is assumed to follow a Gaussian distribution with zero mean, it is reasonable to use the mean of the multiplicative noise to represent the measurement noise level. We change the mean of the multiplicative noise from 0.01 to 0.06. The results for localization accuracy and localization coverage are illustrated in Figure 8. From Figure 8a, we can see that the localization errors of MAP-PSO and AFAL both increase with the measurement noise level. In comparison, MAP-PSO has higher localization accuracy and lower standard deviation. Meanwhile, as the measurement noise level grows, the standard deviation of AFAL increases faster than that of MAP-PSO, which implies that MAP-PSO is more robust to complex underwater noises. This is mainly because MAP-PSO fits the noisy measurements and the priori mobility pattern in a weighted way, while AFAL treats the two types of information equally. Especially, when the measurement noise is of high level, it is difficult for AFAL to find an exact solution that fit the two types of information well. Figure 8b shows us the relationship between the localization time and the measurement noise level. It is obvious that MAP-PSO can complete the localization process in a shorter time and have lower standard deviation compared with AFAL. Furthermore, the localization time of AFAL increases rapidly with the measurement noise while that of MAP-PSO has no obvious change. This is because AFAL have to directly search the whole solution space when the measurement noise is of high level.

Impacts of the Node Density
We next compare the performance of both algorithms under different node densities. Node density is defined as the expected number of nodes in a node's neighborhood. We change the node density from 4 to 12 by adjusting the communication range of the nodes. The results for localization accuracy and localization coverage are illustrated in Figure 9.
As shown in Figure 9a, MAP-PSO achieves higher localization accuracy and lower standard deviation compared with AFAL. As the node density grows, the localization error of MAP-PSO decreases slowly, but that of AFAL has no obvious improvements. This is mainly because that the number of nodes in a cluster increases with the node density and thus more distance measurements can be generated. These measurements have strong constraints on the nodes' locations, which can significantly relieve the localization ambiguity problem. Figure 9b shows the relationship between the localization time and the node density. We can see that MAP-PSO takes less time for localization compared with AFAL. Besides, the localization time of MAP-PSO has the lower standard deviation. This indicates that each node has similar computational cost in our algorithm, which can efficiently prolong the network life. In addition, the localization time of MAP-PSO increases monotonically with the increase of the node density. This is because with the increase of the node density, the number of cluster nodes increases and the location variable is high-dimensional. By using a limited number of particles, searching the best solution in a high-dimensional space may need more iteration times.
Besides the localization accuracy and time, we evaluate the energy consumption under different node densities. For simplicity, we follow LDSN [22] to set the acknowledgement reception consume one unit of energy. According to the values of the parameters L P , L A , P tx and P rx , we set the the ranging packet reception consume 5 units of energy, the acknowledgement transmission consume 9 units of energy and the ranging packet transimmsion consume 45 units of energy, respectively. As illustrated in Figure 9c, the energy consumption of the two algorithms increases with the node density. When the node density is relatively small, MAP-PSO and AFLA have similar energy consumption. This is because most clusters in MAP-PSO consist of three or four nodes in this case. As the node density grows, AFLA has more energy consumption than MAP-PSO. The reason may be that AFLA forms more clusters due to it adopts the three-node cluster localization.

Conclusions
In this paper, we considered the localization problem in UASNs where nodes are permanently moving with restrictions and measurement noises vary with the distances. We introduced a localization algorithm that uses the priori knowledge provided by nodes' mobility patterns and the likelihood information offered by distance measurements. Under the Bayesian framework, the algorithm fuses the two types of information in a weighted way. In the localization phase, the algorithm fits the components in the localization objective function according to their weights. To improve localization accuracy and convergence speed, we further propose novel reference selection and bound constraint mechanisms. We evaluate the localization performance of our algorithm under different unique parameters. The simulation results give the suggestions of selecting proper values for these parameters. We also compare the localization performance with the benchmark AFAL algorithm. The simulation results show that our algorithm can use less localization time and energy consumption to achieve higher localization accuracy.
In the future, our work focuses on two aspects: on one hand, considering the depth measurements may be obtained with low accuracy from a cheap pressure sensor due to the variation of atmosphere and tides, we will study the accurate localization algorithm with coarse depth measurements; on the other hand, we will extend the proposed method to improve the localization performance by using temporal dependency between a node's locations of consecutive time instants.

Conflicts of Interest:
The authors declare no conflict of interest.