Weighted Multilateration Algorithm with a Correcting Factor for Mobile Wireless Sensor Networks

Localization is one of the major problems in mobile wireless sensor networks, since it provides the location of an event occurrence. This paper evaluates the performance of range-based localization algorithms: the multilateration algorithm, the weighted multilateration algorithm, the maximum likelihood algorithm and the multilateration algorithm with a correcting factor. We also propose the weighted multilateration algorithm with a correcting factor through which the localization error is decreased through the addition of a factor that corrects the distance between the node of interest and the reference nodes. Our proposal includes the analysis of noise in the environment due to the time of arrival and the analysis of node of interest’s mobility in the calculation of the correlation matrix of the weighted multilateration algorithm and the calculation of the correcting factor. The localization algorithms analyzed in this study are evaluated in a single-hop scenario and a multi-hop scenario considering a well-defined distribution of the reference nodes and a random distribution of these in both scenarios. The results we obtained varying the number of reference nodes and noise proportion prove that the algorithm we propose yields a better performance than the other analyzed algorithms do, according to the normalized root mean squared error.


I. INTRODUCTION
Mobile Wireless Sensor Networks (MWSNs) are currently playing a very important role in communication networks [1], since they are utilized in a large number of applications such as tracking [2,3], the Internet of Things (IoT) [4], real-time location [5,6], natural resources research [7], power consumption systems [8], monitoring of physical environments [6,9,10,11,12], traffic monitoring [13], industry and agriculture [7], healthcare [6], prevention of natural disasters [12], etc. A MWSN consists of a node network spatially distributed over a monitoring area, where the nodes can be integrated into vehicles or robots with motion in a given environment [14]. Nodes are small lowcost devices with low processing capacity and low power consumption. Some of their tasks include the collection, processing and transmission of information; they also carry out cooperation with other nodes [1,5].
Localization is one of the main problems in Wireless Sensor Networks (WSNs), since it provides useful information about the location of an event. The localization of information is useful for a large number of applications such as routing [3,6,15], health surveillance [1,6], battlefield surveillance [6,9,10,11], underwater environments [16], target tracking [1,3], logistics, power consumption [8], spatial querying [3], load balancing [17], rescue operations [6,18,19], etc. In reconfigurable networks, the information collected by a node is transmitted through multiple nodes (through the use of multiple hops) until it reaches the access points [20,21]. In ad-hoc networks the nodes between the Node of Interest (NOI) and the Reference Nodes (RNs) help set the communication between the NOI and its respective RNs to estimate the NOI's location [20,21]. The RNs are nodes whose position is known; this is accomplished by either equipping them with a Global Positioning System (GPS), or distributing them in strategic places with a known location. GPS is a technology that can achieve the estimation of a node, but due to the high cost, indoor inefficiency and high power consumption of the system, it is not the best fit [22]. Besides the GPS issue, cell phone and WiFi systems do not perform well in certain scenarios such as highlands, underground and disaster zones where satellite signals or signals from the mobile infrastructure cannot be received [23].
At present, there is a great variety of localization algorithms that do not consider environments with mobile nodes. In localization with static nodes, the NOI is located only once. In contrast, in a MWSN the NOI is continuously localized due to its own mobility [24]. The node's mobility in a MWSN implies greater energy consumption, a shorter lifetime of the node and an increased communication cost [24]. Some advantages of MWSNs over a WSN with static nodes are greater coverage in the network, a greater number of nodes neighboring the NOI, better network security and increased network connectivity [24].
Most of the localization algorithms in the literature use techniques based on Received Signal Strength (RSS) to estimate the distance between two nodes, because the implementation or deployment of hardware is relatively straightforward. Also, the use of RSS represents low computational complexity. However, the use of RSS in localization exhibits low accuracy in the location of the NOI due mainly to signal propagation issues. There are applications that demand greater localization accuracy such as vehicular networks, [25], underwater environments, [16], 3D WSN, [26], among many others. Thus, the contribution of this work focuses on increasing the location accuracy through distance estimation techniques using Time of Arrival (ToA), and on integrating a correcting factor in order to decrease the error of the estimated distance used to determine the location of the NOI.
In MWSNs, there are three mobility scenarios [24,27]: (1) static RNs and moving sensor nodes, (2) static sensor nodes and moving RNs and (3) moving RNs and moving sensor nodes. This study uses the first mobility scenario, where we assume that the RNs are static and their positions are known. Additionally, it is assumed that the localization of the sensor nodes will be done only once. The performance of the range-based algorithms is evaluated under this scenario, using techniques such as the Multilateration Algorithm (MA), Weighted Multilateration Algorithm (WMA), Maximum Likelihood Algorithm (MLA) and the MA with a Correcting Factor (CF), i.e., (MA CF). The proposed WMA CF algorithm is also presented; it consists of the WMA algorithm and the calculation of the correcting factor of the distance separating the NOI from its respective RNs. The correcting factor improves the accuracy of the NOI's localization, which is why our proposed WMA CF algorithm yields a better performance than the other algorithms analyzed in different proposed evaluation scenarios. We use ToA to determine the distance separating the NOI from the RNs. Furthermore, we consider that the estimated distance separating the NOI from the RNs is affected by a random variable with beta distribution due to the NOI's mobility, which is obtained through several simulations of the NOI motion varying its speed and direction at different points of time. The localization algorithms analyzed in this study are evaluated in a single-hop and multi-hop scenario through different RN distributions, in other words, a fixed distribution where the RNs are distributed by means of a solid geometry and a random RN distribution. The algorithms analyzed in this study are evaluated under the normalized Root Mean Squared Error (RMSE) performance metric. The proposed algorithm, like the rest of the localization algorithms analyzed in this work, presents low performance in terms of normalized RMSE in scenarios where there is a low density of nodes in the network, low network coverage, a small number of reference nodes (less than 3), and an irregular geometrical distribution of the reference nodes. All the algorithms analyzed have been evaluated under the same conditions where 100% connectivity of the nodes is guaranteed, with at least 3 RNs.
The contributions of this paper are: 1) Performance assessment of the localization algorithms analyzed based on ToA in terms of normalized RMSE in single-hop and multihop scenarios. 2) Evaluation of the location algorithms analyzed on a network with mobile nodes considering that the RNs are static and the NOI is in motion. 3) Estimation of the probability density function (pdf) of the estimated distance between the mobile NOI and the respective RNs. 4) The proposed range-based localization algorithm using ToA together with correcting factor to decrease the error of the estimated distance between the NOI and the respective RNs.
The rest of the article is organized as follows: Section II presents the work related to the mobility and classification of the localization algorithms in MWSNs; Section III describes the localization problem in a network with mobile nodes; Section IV presents the analysis of the localization algorithms MA, WMA and MLA analyzed in this study; subsequently, Section V presents the correcting factor analysis of the distance between two nodes in single-hop and multi-hop scenarios; Section VI presents the analysis of the results of the analyzed localization algorithms, and finally we present the conclusions drawn from this study.

II. RELATED WORK
Nowadays MWSNs are considered in large-scale applications, which consist of a great number of sensor nodes and sinks wirelessly connected through an arbitrary topology [1]. Therefore, mobility plays an important role in MWSNs and it can be applied in all the MWSN sensors depending on the application [1,3]. Mobility in a MWSN is divided into three categories: random mobility, predictable mobility and controlled mobility [3]. In random mobility, mobile devices move freely and randomly over an interest area with no constraint. In the second category, the trajectory of the mobile device is known and cannot be altered. In the third category, related to controlled mobility, the mobile device moves to a known destination following a mobility pattern for a common aim, usually exploration and localization. Nowadays there are many proposals that consider mobility models that predict the motion of a sensor node [3]. In MWSNs, mobility models predict the trajectory of a moving sensor node [1,28]. Mobility models describe the speed changes, acceleration and position of a sensor node with respect to time; and they are often used to investigate new proposals of communication and navigation techniques.
Mobility patterns are classified as trace models and syntactic models [1,29]. Trace models are deterministic mobility patterns that can be observed in real life. In WSNs, trace models cannot be modeled if the traces have not been formed. Therefore, in MWSNs it is necessary to use syntactic models to describe the sensor node's mobility pattern. Syntactic models describe the sensor node's realistic movement without considering traces. Syntactic models are classified as entity models and group mobility models [1,29]. According to the specific features of the syntactic models, these can be classified as random models, time-dependent models, space-dependent models and models with geographic constraints. Some mobility patterns based on entity mobility are random way point, random walk, random Gauss-Markov, city section, random direction, boundless simulation area and the probabilistic version of random walk [1,30]. The mobility patterns based on group mobility are exponential correlated random, column mobility model, nomadic community, pursue mobility model, Reference Point Group Mobility (RPGM), drift group and group force [1,30].
In MWSNs, localization algorithms are classified into two broad groups: range-free and range-based [31,32]. The range-based algorithms estimate the separation distance between the RNs and the NOI by means of a distanceestimation technique, such as ToA, RSS, Time Difference of Arrival (TDoA) or Angle of Arrival (AoA) [21]. The range-free algorithms use the connectivity information between the nodes to estimate the separation distance between two nodes [21,33]. The range-based algorithms achieve a higher accuracy in the localization of the NOI than the range-free algorithms, but the range-free algorithms require extra hardware in the NOI or the RNs for the estimation [21,33]. In many studies RSS is used to estimate the distance between the RNs and the NOI, because RSS can easily be implemented in hardware, but the cost is a lower accuracy than that obtained when ToA, TDoA and AoA techniques are used [21,34]. ToA requires perfect synchronization, TDoA has a limited coverage and AoA involves computationally expensive hardware and it also requires an antenna array [21].
Some range-free localization algorithms are the centroid, and weighted centroid, [21]; Distance Vector-Hop (DV-Hop), Improved DV-Hop (IDV-Hop), and Weighted DV-Hop (WDV-Hop), [33]; Approximate Point in Triangle (APIT) [35,36]; circular intersection, rectangular and hexagonal, [37], among others. In MWSNs, most of the range-free localization algorithms use the Sequential Monte Carlo (SMC) method to estimate the NOI's position [24,38]. The Monte Carlo method uses the probability density function (pdf) to estimate the NOI's position. This method estimates the NOI in three stages: initialization, prediction and filtering [38]. In [12,39], the authors propose the Weighted Monte Carlo Localization algorithm (WMCL), which is based on the SMC method [38]. This proposal improves the accuracy of the NOI localization compared to that of the DV-Hop [33] and SMC [38] methods. In [40] the improved Probabilistic Multilateration Algorithm (PMA) achieves better normalized RMSE than the localization algorithms analyzed when the number of the RNs and the proportion of noise vary for different configuration topologies of the RNs in a single-hop and multi-hop network scenario. The improved PMA [40] has better normalized RMSE performance, since it computes the NOI's localization based on a correlation matrix that considers the noisy environment. Besides, this method considers a constant parameter called the damping factor, which improves the convergence in the estimation of the NOI's position, providing the solution that minimizes the localization error. The WMCL method reduces the sampling area where the NOI is found by using the bounded box method [38] and it improves the localization efficiency of the SMC method by using the position information of the RNs' neighboring nodes. The hop distance method uses the average distance per hop between two RNs to estimate the position of the NOI [38]. Three stages are carried out in this method to estimate the NOI's position: broadcast, calculation of the distance matrix, and localization estimation [38]. The disadvantage of the hop distance method is that the RNs must be evenly distributed throughout the whole network to reach high accuracy in the estimation of the NOI's position. In [38] the fingerprint technique is used to estimate the NOI's position; the fingerprint technique performs the NOI localization in two stages: an offline stage and an online stage.
Within the literature related to range-based algorithms we can mention DV-Distance [41], multilateration [42], Multidimensional-Scaling (MDS) [43], the hyperbolic positioning algorithm [21], the weighted hyperbolic positioning algorithm [21,33], the circular and weighted circular positioning algorithm [21], Weighted Least-Squares (WLS) multilateration [21], Least-Squares DV-Hop (LSDV-Hop) [44], vertex projection [20], vertex projection with correcting factor and maximum likelihood [20]. In MWSNs Bergamo and Mazzini [45] propose a range-based algorithm that uses the information of the positions of the RNs placed on two corners of the same side of a rectangular space. The mobile NOI measures the RSS of the RNs and estimates their position through triangulation. The localization accuracy of this algorithm is affected by the fading away of the signals and mobility of the NOI. Due to the RNs remaining static, the localization of the mobile NOI is limited, given that the RSS decreases as the NOI distances itself from its respective RNs. Therefore, the results of the estimated distance between the mobile NOI and its respective RNs are vague [45]. In [24], the authors propose the dead reckoning algorithm, which estimates the NOI's position in discrete time intervals called checkpoints. The dead reckoning carries out the estimation of the NOI localization in two stages: initialization and sequent. In the initialization phase, the NOI is localized by means of trilateration. In the next phase, only two RNs are used to localize the NOI. In this phase, two possible NOI localizations are obtained through Bézout's theorem [46].
One of the problems with the DV-Hop algorithm is the increase in cumulative error of the average distance per hop when the number of hops in the network increases. In contrast, the APIT method involves a high computational cost on the network [33], and the MDS algorithm also has a high computational cost, because it is a centralized algorithm. The classic multilateration algorithm and the hyperbolic algorithm solve the localization problem by a Least Squares (LS) estimator, but do not involve the noise factor in estimating the position of the NOI. As a consequence, these algorithms can present significant errors in the estimated position of the NOI in two situations: the first for scenarios where the noise level is high, and the second for scenarios with a small number of RNs that are also distributed with an irregular geometry. Additionally, in situations where the distances between the NOI and RNs are not available, the multilateration algorithm suffers from problems such as uncertainty, inconsistency, and ambiguity [47]. WLS multilateration solves the localization problem with a WLS estimator but involves a higher computational cost than the classic multilateration algorithm and weighted hyperbolic positioning algorithm, the latter being an iterative algorithm that calculates the position of the NOI with the minimum localization error [21]. The Monte Carlo method requires many iterations and an excessive computational time during the sample generation stage [24].
In [24], the authors propose two classes of localization algorithms for MWSNs: adaptive and predictive. The adaptive localization algorithms carry out the localization of the NOI at constant time intervals based on the NOI's movement, where the estimation of the NOI's current position is obtained from previous estimations. This method allows the NOI to increase its localization frequency when it moves rapidly or to reduce its localization frequency when its movement is sluggish. The predictive algorithms estimate the NOI's movement pattern and predict its future movement. The main aim of this method is to consider the frequency of the NOI's localization instead of the localization algorithm.
The authors in [48] propose the localization scheme called Vehicles joint UAVs Topology Discovery (VUTD) for IoT applications. This scheme finds the physical topology of a network with low cost and high accuracy. Experimental results show that the VUTD performs better than the VTD algorithm in terms of the average localization error and localization ratio. Compared to the UTD algorithm, the VUTD localization scheme reduces the cost of localization discovery by 77.7%. In [49], a classification of range-free and range-based location techniques in underwater environments (UWSN) is presented together with the main weaknesses and strengths of the location algorithms analyzed. In contrast, the authors in [50] propose the DEIDV-Hop algorithm, which decreases the error of the average distance per network hop. Experimental results show that this algorithm has lower average localization error with more stability and convergence speed than the DV-Hop, PSO, and GSODV-Hop algorithms for different network topologies. In [51] a particle filteringbased localization algorithm is proposed that achieves high target tracking accuracy and a favorable balance with respect to network accuracy and consumption compared to other algorithms analyzed in the study. [52] proposes an improvement of the DV-Hop algorithm based on an online sequential position computation and the optimized calculation of the average distance per hop. Their results show that the online sequential DV-Hop method performs better in terms of localization error than DV-Hop, CC-DV-Hop, and the Parallel Efficient Projection Algorithm (PEPA) for various random WSN topologies. [53] introduces the proposed weighting DV-Hop localization algorithm using modified artificial bee colony optimization, which has less node localization error than the DV-Hop AW, HW, and EW algorithms. Previous proposals [48,50,52,53] use RSS and node connectivity information to estimate the distance between the NOI and RNs.
The localization algorithms evaluated in this article use ToA, resulting in greater NOI localization accuracy in terms of normalized RMSE than that of other localization proposals based on network connectivity information and RSS. However, estimating the ToA requires greater hardware complexity.

III. MODEL DESCRIPTION
This section describes the localization scenario in MWSNs, where it is assumed that the RNs are static with known positions and the NOI is moving. In this scenario, localization is described based on a reference coordinate system defined by the RNs, and sensors whose positions are unknown and will be determined by applying a localization algorithm. The algorithms analyzed in this work are rangebased and use the ToA to increase localization accuracy. However, in mobile scenarios, it is very important to estimate the distance between the NOI and RNs, because from that estimation, the localization algorithms are executed. Thus, the more error there is in estimating the distance between the NOI and the RNs, the greater the error of the NOI localization. Thus, different new ideas need to produce a localization algorithm to help in the reduction of the error of the estimated distance. This work presents an algorithm that calculates a correcting factor in estimating the distance between the NOI and RNs. Figure 1(a) shows the mobility scenario in a WSN of the NOI identified as node with coordinates ( , ) in a discrete instant of time = 0, 1, 2, . . . , with respect to an RN 0 with a known position ( , ). In this scenario, the movement of NOI is based on the random way point mobility pattern. In Figure 1(b) we can observe the transition of NOI in an instant of time -1 to time where we can obtain the mathematical model of the separation distance between RN 0 and mobile node in an instant of time . The elapsed distance −1 by NOI is obtained through the relation ) and ∆ −1 is the elapsed time from instant -1 to instant . The separation distance in the instant between the RN 0 and mobile node is given by (1) Replacing the movement equations = −1 + −1 cos( −1 ) and = −1 + −1 sin( −1 ) of mobile node , where −1~U (0, 2 ), the distance is given by Note that depends on two random variables, velocity −1~U (0, ) and direction −1~U (0, 2 ), that are assumed to be independent. Since it is not possible to obtain exactly the statistics of parameter , we carried out some simulations of the movement of NOI with respect to RN 0 for different speeds of NOI . The results obtained in Figures 2 and 3 show an approximation of the pdf of the separation distance . Figure 2(a) shows the obtained pdf of the parameter normalized with respect to the maximum possible distance between two nodes over an area of 100 m x 100 m, which is 141.42 m, and the pdf of a beta distribution by means of a red curve, where it can be concluded that both pdfs are very similar. In other tests where the parameter is not normalized, we obtain a pdf of this parameter that is very similar to the beta pdf. Figure 2(b) displays a Q-Q (quantile-quantile) plot with the beta distribution, where the obtained pdf closely resembles the beta distribution. Figure  3 displays a similar behavior for maximum speeds of mobile node of 5 m/s and 10 m/s. Therefore, we conclude that the magnitude of the speed of mobile node does not change the type of the pdf of the separation distance since the results obtained show that the obtained pdf is of the beta type.  Hence, in a mobility environment we assume that the individual distance between NOI and each one of the RNs, which are necessary to estimate the position of NOI , presents a beta distribution with parameters and , i.e., ~( , ). Distance is normalized with respect to the maximum possible separation distance between NOI and RN 0 , which is 141.42 m considering an area of 100 m x 100 m. Parameters and define the shape of the pdf with beta distribution. In the simulations performed, in order to obtain the pdf with beta distribution as the speed of the NOI is varied, one can observe that the pdf with beta distribution is similar in all the scenarios, i.e., for maximum speeds of mobile node of 3 m/s, 5 m/s and 10 m/s. Using parameters and , we can estimate the distance between the NOI and the RNs, which depends on the speed and the direction of the NOI. By definition the pdf of a beta distribution function is given by . By getting the parameters and , we can determine the mean and variance of a random variable through the following equations Var[ ] = ( + ) 2 ( + + 1) .
Assuming the random variable with beta distribution is defined over a range 0 < < , then its pdf is defined by the equation Therefore, the statistics of the random variable with beta distribution are calculated through Var[ ] = ( + ) 2 ( + + 1) .
By means of equations (7)-(8) the statistical parameters of the random variable with beta distribution are weighted by the scaling factor . We can observe that in the instant of time = , the pdf of the separation distance between RN 0 and NOI presents a beta type of distribution with constant parameters and . Therefore, it is not necessary to know the velocity parameters −1 , direction −1 and elapsed time −1 ∆ −1 of NOI to estimate the separation distance between RN 0 and NOI , as observed in equation (2), since these parameters were used to estimate the beta-type pdf with constant parameters and . Therefore, the localization of NOI at the instant of time = is independent of other instants of time, that is, = 0, 1, 2, . . . , -1. Without loss of generality, the position of NOI at every instant of time is given by the coordinates ( , ). We consider a network with RNs 0 , 0 and 0 with known coordinates ( , ), ( , ) and ( , ) and NOI with coordinates ( , ) as shown in Figure 4. Assuming that the Euclidean distances ( 0 , ), ( 0 , ) and ( 0 , ) between NOI and the respective RNs are known, we can estimate the position of NOI through trilateration. However, due to the limitations of the network coverage, one node does not provide enough power to achieve a direct link to all the nodes in the network; that is to say, the connection between the RNs and NOI is through an array of hops in the network. For example, the connection of RN 0 to NOI is through hops with (1 + ) nodes, where the route is formed by a node array R AZ = { 0 , 1 , 2 , ..., −1 , }, and 1 , 2 , ..., −1 are the intermediate nodes of the route traced from RN 0 to NOI . The distance ( 0 , ) is formed by the concatenation of multiple long hops ( −1 , ), where for = 2, 3, … , − 1 is the intermediate node of the route formed from RN 0 to NOI . In a real scenario, the distance ( −1 , ) for every can be estimated using ToA [17]. In this scenario, it is assumed that the estimated distance ( −1 , ) for every has a measurement error. The measurement error of each one of the hops in the network is considered an exponential random variable with parameter for every . Because every random variable for every is independent and identically distributed, it is assumed that = for every . Taking as reference RN 0 , the length of a hop with a measurement error is calculated through ( −1 , ) = ( −1 , ) + , for = 1,2,3, … , − 1. Therefore, the estimated distance from RN 0 to NOI is given by where ( −1 , ) = ( −1 , ) + ; the term given by ~( ) is the random variable with exponential pdf that simulates the error in the estimation of the distance, and the estimated distance ( −1 , ) is obtained as a measurement of the real distance ( −1 , ) from node −1 to NOI . Therefore, the estimated distance from RN 0 to NOI is calculated through represents the accrued error of all the hops of the route from RN 0 to NOI because of the communication channel. The random variable presents an n-Erlang-type or gamma-type pdf. Considering that NOI is to be found in motion, then the distance from RN 0 to NOI is affected by a beta-type random variable due to the movement of NOI . Hence, the distance from RN 0 to NOI can be estimated using The beta random variable is weighted by a factor proportional to the real separation distance between NOI and RN 0 , that is, 0 < < 1⁄ . In equation (11) it is assumed that the random variables and are independent. We can observe in equation (11) that the parameter represents the estimated distance between RN 0 and NOI obtained at the instant of time = . Since the localization of NOI is independent at different points in time = 1,2,3, … , , then equation (11) can be used to estimate the position of NOI for all time instants.

IV. LOCALIZATION ALGORITHMS ANALYZED
This section presents the analysis of the localization algorithms MA, MLA and WMA, considering the NOI's mobility in the one-hop and multi-hop scenarios.

A. MULTILATERATION ALGORITHM (MA)
Taking Figure 4 as our reference, we can estimate the position of NOI by means of the trilateration of RNs 0 , 0 and 0 . However, when there are four or more RNs, the multilateration technique is used to estimate the position ( , ) of NOI [42]. In a network with RNs, the estimated distance between mobile node and RN is calculated using the Pythagorean theorem, as follows where ( , ) are the coordinates of RN and (̃,̃) is the estimated position of NOI . Equation (12) represents a nonlinear problem. By performing the subtraction 2 − 1 2 for ≠ 1 , (12) becomes a linear problem, which can be solved with a LS estimator to get By obtaining all the equations in (13) for = 2,3, … , , and expressing them in matrix form [42], we obtain Then, the linear problem can be formulated by and is a random vector given by Finally, the position ̃ of NOI is calculated through the following expression ̃= ( ) −1 .
Equation (17) shows that the position ̃ of NOI is obtained through the LS estimator.
The pdf of the estimated distance is given by In equation (19) we can observe that the pdf of the estimated distance is the pdf of the sum of the random variables and ; in other words, the pdf of is the resulting convolution of the pdfs of the random variables and , n-Erlang type and beta type, respectively. The resulting pdf of the convolution of the pdfs of the random variables and is given by  (20) is the pdf of the estimated distance , as the convolution of the beta and n-Erlang-type pdfs. It is assumed that the random variables and are independent and therefore using (21) and (22), we get the pdf of the estimated distance , obtained through the likelihood function given by . (24) By applying the log-likelihood in equation (24), we obtain From equation (27) we obtain a second-order equation, whose solution is given by where = + + − 3 + ⁄ is a constant factor. In equation (28) we obtain two solutions of the estimated distance , where the minor solution is taken since it provides the maximum value of the likelihood function ( ). Expressing the distance ( 0 , ) in terms of number of hops, the distance is expressed by By solving the term ( −1 , ) in equation (29), we obtain Taking Figure 4 as our reference, we can estimate the position of NOI through the trilateration of nodes −1 , −1 and −1 closer to NOI , i.e., the nodes neighboring NOI . The Euclidean distance between mobile node and its respective neighboring nodes is calculated through the Pythagoras theorem, as follows Equations (31) Then the linear problem can be formulated by where

̃= [̃]
and ̃ is a random vector given by In a multi-hop scenario, the number of hops between NOI and the RNs is not necessarily the same, and the noise that affects the distance along each one of the routes between the NOI and the RNs is independent and not identically distributed because the exponential random variables present different parameters for each of the routes between the NOI and the RNs.

C. WEIGHTED MULTILATERATION ALGORITHM (WMA)
There are diverse range-based localization techniques to calculate the position of the NOI, for example, hyperbolic positioning algorithm (multilateration) [21], weighted hyperbolic (weighted multilateration) [21], circular [21], weighted circular [21], MDS [43], etc. The hyperbolic positioning algorithm and weighted hyperbolic positioning algorithm solve the localization problem through multilateration [21,42] obtaining a linear equation that can be easily solved by a LS estimator. The circular positioning algorithm and weighted circular algorithm calculate the NOI's position through the gradient descent method [54] iteratively until we find the position of the NOI that minimizes the MSE. The MDS algorithm calculates the NOI's position through the spectral decomposition of the matrix of distance between the RNs; however, this method implies a high computational cost, because it is a centralized algorithm, which is why a single node must perform the entire computing of the network [43]. Therefore, we select the weighted multilateration algorithm since this variant of the classic multilateration algorithm only adds a covariance matrix in the classic multilateration algorithm, which is why the complexity order of this algorithm is the same as in the classic multilateration algorithm. The covariance matrix contains the information about the estimated distance between the NOI and the RNs; therefore this matrix contains the weights of how accurate the estimated distances are between the NOI and the RNs of their real value, which implies a higher accuracy for the localization of the NOI.

V. SINGLE-HOP AND MULTI-HOP CORRECTING FACTOR
This section describes the proposed algorithm, the contribution of which is to increase the accuracy of the NOI localization using a correcting factor in the estimated distance between the NOI and the RNs. The correcting factor is a parameter that compensates for the exponential noise factor due to the ToA inaccuracies. The estimated distance between the NOI and the RNs represents an overestimation of the true distance between the NOI and the RNs, due to the exponentially distributed noise in the ToA estimation. Therefore, the correcting factor minimizes the MSE between the true NOI -RNs distance, and the estimated distance between them. Hence, by using the correcting factor in the localization algorithms, we minimize the estimated distance error between the NOI and RNs and obtain an estimated value that is closer to the true distance between the NOI and the respective RNs. The use of this correcting factor is the reason we have a smaller error in the algorithms MA CF and WMA CF compared to other algorithms when estimating the NOI's position.
By taking Figure 4 as a reference, the estimated distance between RN 0 and NOI is calculated through the expression = + + , where is a n-Erlang-type of random variable and is the beta-type random variable, which is weighted by a factor proportional to the Euclidean distance between NOI and RN 0 [20]. Figure  5 shows the diagram of the proposed WMA CF algorithm for the one-hop and multi-hop scenarios, taking RN 0 as a reference. In the first step, one gets the estimated distance between the NOI and the RNs, that is, . In the following step, the calculation of the correcting factor α is performed, which is obtained for the single-hop scenario through equation (48) and in the multi-hop scenario using equation (53). The third step calculates the separation distance between the NOI and the RNs with the correcting factor through equation (45). Subsequently, the WMA localization algorithm is applied to find the NOI's position.

A. SINGLE-HOP CORRECTING FACTOR
Considering that NOI and RN 0 are found to be one hop away ( = 1), one can see that the random variable presents an exponential-type distribution with parameter . The sum + can be modeled as a real distance factor , i.e., + = , where is an unknown random factor and E( + ) = E( ) with = E( ). The E( + ) value can be obtained through Since is an unknown factor, the real distance estimation can be calculated through where is the parameter that minimizes the MSE given by Minimizing the given MSE in equation (46) with respect to the parameter , we obtain From equation (47), we obtain the parameter given by In all scenarios, the random variables , and are exponentially distributed with , and parameters. Therefore, the parameter is proportional to the sum + with a parameter −1 . The factor E{(1 + ) −1 } is obtained through where + ( ) is the resulting pdf of the convolution of the pdfs of the random variables and for = 1, since it is assumed that RN 0 and NOI are found to be one hop away. The pdf + ( ) is given by 1⁄ 0

B. MULTI-HOP CORRECTING FACTOR
Assuming as the estimated distance between an RN and the NOI modeled through = + + , where is a n-Erlang type of random variable, the sum + is modeled as a factor of the real distance , that is, + = , where is an unknown random factor, E( + ) = E( ). Since is an unknown factor, then the real-time estimation can be calculated through = (1 + ) ⁄ , where is the parameter that minimizes the MSE = E{[ − ] 2 }. By minimizing the given MSE in the equation with respect to the parameter , we obtain this parameter as In all scenarios, the random variable presents an n-Erlang type of distribution with parameters and , where is either the number of random variables of the n-Erlang distribution or the number of hops between the RN and the NOI, as observed in equation (10). The factor E{(1 + ) −1 } can be obtained through where + ( ) is the resulting pdf of the convolution of the pdfs of the random variables and .
1⁄ 0 Equations (55)-(56) represent the pdfs of the random variables of the n-Erlang and beta types, respectively. Through equation (57), we obtain the resulting pdf of the pdfs' convolution of the n-Erlang and beta types of random variables.

VI. RESULTS
This section presents the performance results obtained with the MA, MA CF, WMA, WMA CF and MLA algorithms. The NOI's mobility parameters are ( , ) = (2.1, 3.2), which were obtained through the average of 100 simulations. The aforementioned localization techniques are evaluated in MATLAB in an area of 100m x 100m where the sensor nodes are randomly distributed, and the RNs are distributed forming a triangle with defined positions. The RNs are collinear to a radius circumference that defines the maximum separation distance between the RNs. The coverage radio 0 of the NOI in an ad-hoc network depends on the node transmitting power and the receiver sensitivity. We assume that a node cannot be connected to all the nodes in the network, i.e., there is no established link; therefore, the results are shown in terms of normalized coverage radio 0 / . The results obtained are shown in terms of the normalized RMSE, namely, (RMSE⁄ ). A total of = 10 4 executions were performed to estimate the position of the NOI in every simulation scenario. The RMSE of the NOI's true position (x, y) and its estimated position at the k-th iteration of the algorithm (̃,̃), for k = 1, 2, …, K, is defined by the following expression The localization algorithm's performance is obtained from two evaluation scenarios, a single-hop scenario and a multi-hop scenario, where we consider the number and distribution of the RNs. In every simulation scenario we consider a network where we vary the number of RNs from 3 to 7 nodes and the NOI is randomly chosen within the sensing area. Network coverage defined through the communications radius, 0 , is an essential parameter that ensures that all nodes in the network are connected through paths with multiple network hops. Coverage control ensures that RNs are always available in the sensing area to estimate the NOI's location. Figure 6 shows a node's percentage of connectivity when its communication radius 0 is varied. It can be observed that with a radius 0 of approximately 30 m, 100% network connectivity is achieved, considering a network density of 200 nodes. An 0 coverage radius is used for the performance assessment of localization algorithms in terms of normalized RMSE, which guarantees 100% network connectivity.  Figures 7, 8, and 9 show the horizontal axis of the plots as the numbered sequence of positions taken by the NOI in its trajectory. The vertical axis represents the normalized RMSE, which is obtained by the ratio (RMSE⁄ ), where the RMSE is given in meters and the maximum distance between two reference nodes is also given in meters. Therefore, the normalized RMSE is an adimensional factor. Table I shows the simulation parameters used throughout the numerical results experiments conducted for the localization algorithms when calculating the normalized RMSE presented in Figures 7, 8 and 9. In Figure 13, it can be observed that the performance of the algorithms is described in terms of the normalized RMSE, which is a numerical and adimensional value.  Figure 7 shows the normalized RMSE considering a network with 5 random RNs, where 3 RNs are distributed with a well-defined triangular geometry. The results obtained show that the algorithms MA and WMA using a correcting factor improve the normalized RMSE compared to those that do not use a correcting factor. Finally, we learn that the algorithm WMA CF shows the best performance with respect to the rest of the algorithms. One can see that the WMA CF algorithm presents a normalized RMSE of 0.08, while the WMA algorithm has a normalized RMSE value of 0.12, because the proposed algorithm WMA CF applies the correcting factor of the estimated distance between the NOI and the respective RNs, and thus it decreases error.  Figure 8 shows that for a network of 3 defined RNs with random positions that always remain fixed, we get a very vague localization of the NOI. However, by increasing the number of RNs, the normalized RMSE of the algorithm WMA CF decreases.  Figure 9 presents the normalized RMSE of the algorithm WMA CF for a network with 5 RNs. The results show that with a rectangular geometry (4 RNs distributed in a rectangle-like shape) we obtain a more accurate localization than with a triangular geometry (3 RNs distributed in a well-defined triangular shape). However, a network with 5 RNs arranged in random positions does not guarantee a good localization of the NOI, since there are situations where the 5 RNs are very close to each other, which in turn does not provide sufficient coverage of the NOI's area.   We consider a network where 3 RNs are arranged in a solid triangular geometry and more RNs are added with random positions until we get 7 RNs.

2
In this case, RNs remain fixed with geometries of regular polygons from the triangular type of geometry to the heptagonal type. 3 In this scenario, RNs are randomly distributed within the deployment area, making it difficult to get a solid distribution of the RNs.  Table II, respectively. The RNs are represented by red triangles, the green square represents the NOI and the red circles are the nodes in the network with an unknown position.
These test cases were designed to obtain different behaviors of the normalized RMSE for different geometric distributions of the RNs such as the triangular, the square and the heptagonal, while also augmenting the number of RNs in the network, starting from a triangular geometry, and finally varying the number of RNs with totally random geometric distributions. The advantage of performing the test cases is to determine the ideal geometry and the necessary number of RNs in the network to obtain the best normalized RMSE performance of the localization algorithms.    Figure 13 presents the normalized RMSE of the aforementioned localization algorithms with variations in the proportion of noise, which is a constant parameter in all the results obtained. The proportion of noise is a factor with which the parameters and of the random n-Erlang and beta-type variables are calculated respectively. The proportion of noise represents the percentage level of the noise that affects the true distance between the NOI and the RN. Thus, this is an adimensional parameter. Figure 13(a) shows that the WMA and WMA CF algorithms maintain the same performance as the MA and MA CF algorithms, respectively, considering 3 RNs, whilst the MLA algorithm displays a slightly lower normalized RMSE than the MA algorithm, because of the compensation factor calculated in equation (28). This similarity of the MA and WMA algorithms is because the 3 RNs are always distributed over a triangular area with a fixed position in order to obtain the NOI's position. By raising the number of RNs to 4 nodes, we decrease the normalized RMSE of the WMA and WMA algorithms as shown in Figure 13(b). Moreover, Figure 13(b) shows that WMA CF presents much less normalized RMSE than MA CF, while the normalized RMSE of MA CF is very similar to that of the WMA localization algorithm. A similar behavior is shown in Figure 14. On the other hand, MA and WMA localization algorithms with a correcting factor present a better normalized RMSE performance, since the correcting factor is a parameter that minimizes the MSE between the real and estimated distance separating the RNs and the NOI.    The results we obtained in Figure 15 show that the MA and MLA algorithms retain their normalized RMSE performance as the number of RNs rises from 3 to 7 RNs. Therefore, this result indicates that 3 RNs are enough to obtain an estimation of the NOI position when the MA or MLA localization algorithms are used. According to Figure   16, the WMA and WMA CF algorithms improve their normalized RMSE performance as the number of RNs rises. This normalized RMSE improvement is because by having a greater number of RNs, we decrease the localization error between the NOI and the RNs, which implies a reduction in the variance of the estimated distances between the NOI and the RNs.

2) CASE 2
This case considers (a) 3 RNs arranged in a well-defined triangular geometry and (b) 5 RNs distributed in a pentagonal geometry. According to the results shown in Figure 17(b), there is a slight reduction of the normalized RMSE of the localization techniques presented with respect to the results shown in Figure 14(a) where we consider 5 RNs, since we obtain a greater coverage area of the NOI with a solid pentagonal geometry than with a solid triangular geometry. Figure 18 shows that the normalized RMSE performance improves for the algorithms WMA and WMA CF as the number of RNs rises. This improvement is seen starting at 4 RNs. The WMA CF algorithm presents less normalized RMSE than the WMA algorithm due to the correcting factor, which decreases the separation distance error between the NOI and the RNs. Figure 19(a) reports the normalized RMSE of the localization techniques considering 5 randomly arranged RNs. A comparison of these results to the results shown in Figure 17(b) for 5 RNs arranged with a solid pentagonal geometry shows that more normalized RMSE is obtained with the RNs randomly arranged. The analyzed localization techniques present a decrease of the normalized RMSE as the number of RNs rises to 7 nodes according to Figure  19(b).  The normalized RMSE of the localization techniques presents very high error values for 4 RNs arranged randomly; thus, after 5 RNs we obtain a more robust normalized RMSE as shown in Figure 20. When considering a network with 3 randomly arranged RNs, there is no guarantee of a good NOI localization, because the area covered by 3 RNs in some cases may be very small, which can make the localization of the NOI extremely vague.

1) CASE 1
The MLA algorithm presents a normalized RMSE performance with many variations considering 3 RNs, because this algorithm considers the 3 nodes that are closest to the NOI to be the routes that best approximate the real distance between the NOI and the RNs (Figure 21(a)); therefore, by selecting these nodes we obtain an irregular geometry to estimate the NOI's position. On the other hand, when there are 5 RNs, the algorithm presents a better normalized RMSE performance (Figure 21(b)).
The WMA CF algorithm improves its normalized RMSE performance as the number of RNs rises, as shown in Figure 22. Figure 22(b) shows a similar behavior for the MLA algorithm. The MLA algorithm shows an uneven increase of normalized RMSE as the proportion noise varies for 3 RNs, as shown in Figure 22(b).   2) CASE 2 Figure 23 shows the normalized RMSE of the aforementioned localization algorithms as the proportion noise varies, using 3 fixed RNs arranged in a well-defined triangular geometry and 5 fixed RNs arranged in a pentagonal geometry. By augmenting to 5 RNs with a welldefined pentagonal geometry, we can see an improvement in the normalized RMSE performance with respect to the ones shown in Figure 23(a).
The WMA CF algorithm presents an important normalized RMSE performance improvement as the number of RNs rises and with solid geometries of regular polygons (Figure 24(a)). The results shown in Figure 24(b) show that the MLA algorithm improves its normalized RMSE performance as the number of RNs rises, presenting a better performance starting at 4 RNs.  Figure 24 shows that the WMA CF algorithm ( Figure  24(a)) has a smaller normalized RMSE value than the MLA algorithm does (Figure 24(b)) when the proportion of noise and the number of RNs are varied. For example, for a network with 3 RNs, the WMA CF algorithm has a maximum normalized RMSE value of 0.6, while the MLA algorithm reaches normalized RMSE values above one. This is because the MLA algorithm does not consider a fixed distribution of RNs, but rather the nodes closest to the NOI to estimate its position, which implies that the coverage area of those nodes is very small and the normalized RMSE values obtained could be inconsistent.

3) CASE 3
Figure 25(a) shows the normalized RMSE of the localization techniques considering 5 randomly arranged RNs. A comparison of these results to those shown in Figure 23(b) for 5 RNs arranged with a solid pentagonal geometry shows that we obtain less normalized RMSE with the solid geometry than with the randomly arranged RNs. Figure 25(b), shows that there is a decrease of the normalized RMSE with the localization techniques presented as the number of RNs rises to 7 nodes. Figure 25 clearly shows that for a network with 5 RNs and another with 7 RNs, the WMA CF algorithm performs better in terms of normalized RMSE than the other algorithms analyzed, reaching maximum normalized RMSE values of approximately 0.5 for 5 RNs and 0.3 for 7 RNs. This is because the proposed WMA CF algorithm uses the correcting factor to calculate the separation distance between the NOI and the respective RNs, and it also uses the WMA algorithm, which has a lower normalized RMSE than the MA algorithm. Figure 26 shows that the normalized RMSE of the localization techniques presents error values that are very high for 3 randomly arranged RNs, which means that by starting at 4 RNs we obtain a normalized RMSE value that is more robust. With a network with 3 randomly arranged RNs, there is no guarantee of a good NOI localization, because the area covered by 3 RNs can be very small in some cases; therefore, there is much inaccuracy in the NOI localization. The MLA algorithm does not present a good normalized RMSE performance when RNs are distributed randomly. We can observe that the correcting factor decreases the localization error of the MA and WMA localization algorithms; in addition, Figure 26 shows that the normalized RMSE performance of the WMA CF algorithm presents more robustness when this parameter is added, which is observable starting at 4 RNs in the network (Figure 26(a)). In the three test cases previously described, the WMA CF algorithm presents a better normalized RMSE performance than the other analyzed algorithms. In case 2, where the RNs are distributed with well-defined geometries, the analyzed localization algorithms present less normalized RMSE than in cases 1 and 3. In case 3, where the RNs are randomly arranged in the sensing area, the localization algorithms present the worst normalized RMSE performance, since this case implies that the RNs are not necessarily distributed in such a manner that the NOI is within the coverage area formed by the geometry of the RNs. Case 1 shows that as the number of RNs rises, assuming a well-defined triangular geometry of the RN ensemble, the MA algorithm maintains the same normalized RMSE whilst the normalized RMSE of the WMA algorithm decreases as the number of RNs increases regardless of the geometry of the RNs; additionally, the correcting factor introduced in the MA and WMA algorithms decreases their normalized RMSE. Finally, for 5 or more RNs in the network, the WMA CF localization algorithm presents greater robustness than the other analyzed algorithms.

VII. CONCLUSION
This paper determines the normalized RMSE performance of range-based localization algorithms as the proportion of noise and the number of RNs vary. By analyzing the results obtained we learn that the MA and MLA algorithms in a single-hop scenario present a similar performance considering at least 3 RNs with a well-defined triangular geometry. However, in a multi-hop scenario, the MLA algorithm does not present a robust normalized RMSE performance because it considers the nodes closest to the NOI to obtain its position, and the geometry shaped by the nodes closest to the NOI is totally random, with very low coverage in the sensing area. This study shows that the algorithm we propose, WMA CF, yields a better performance than the other analyzed algorithms considering both a single-hop and a multi-hop scenario. The algorithm we propose considers the analysis of the environment of noise due to the ToA and the NOI´s mobility in the calculus of the WMA algorithm's correlation matrix and it also adds the correcting factor, which decreases NOI localization error. The correcting factor corrects the estimated distance between the NOI and the respective RNs, which improves the accuracy of the NOI localization. According to the results we obtained, our proposed WMA CF algorithm presents a greater robustness than the other analyzed algorithms considering at least 5 RNs, either with a random distribution or with a well-defined geometry.