Skip to main content


Indoor Positioning Using Nonparametric Belief Propagation Based on Spanning Trees


Nonparametric belief propagation (NBP) is one of the best-known methods for cooperative localization in sensor networks. It is capable of providing information about location estimation with appropriate uncertainty and to accommodate non-Gaussian distance measurement errors. However, the accuracy of NBP is questionable in loopy networks. Therefore, in this paper, we propose a novel approach, NBP based on spanning trees (NBP-ST) created by breadth first search (BFS) method. In addition, we propose a reliable indoor model based on obtained measurements in our lab. According to our simulation results, NBP-ST performs better than NBP in terms of accuracy and communication cost in the networks with high connectivity (i.e., highly loopy networks). Furthermore, the computational and communication costs are nearly constant with respect to the transmission radius. However, the drawbacks of proposed method are a little bit higher computational cost and poor performance in low-connected networks.

1. Introduction

The belief propagation (BP) algorithm, proposed by Pearl [1], is a way of organizing the global computation of marginal beliefs in terms of smaller local computations within the graph. It is one of the best-known graphical model for distributed inference in statistical physics, artificial intelligence, computer vision, error-correcting codes, positioning, and so forth. The whole computation takes a time proportional to the number of links in the graph, which is significantly less than the exponentially large time that would be required to compute marginal probabilities naively.

Due to the presence of nonlinear relationships and highly non-Gaussian uncertainties, the standard BP is undesirable. In addition, in order to obtain acceptable spatial resolution for the sensors, the discrete space (grid) in the deployment area must be made too large for BP to be computationally feasible. However, particle-based approximation via nonparametric belief propagation (NBP), proposed by Ihler et al. [24], makes BP acceptable for inference in sensor networks. The main features of this approach are easy implementation in a distributed fashion and sufficiency of a small number of iterations to converge. Furthermore, NBP is capable of providing information about location uncertainties and to accommodate non-Gaussian measurement errors. This is the main advantage of NBP comparing with well-known deterministic methods [58]. In our application (indoor positioning), the distance error model is not even close to Gaussian model, thus this is our motivation for choosing NBP.

However, BP convergence; is not guaranteed in a network with loops [1, 9] or even with convergence; it could provide us less accurate estimates. Regarding localization using NBP, the convergence is usually sufficient, but the accuracy is questionable. In the current state of the art, there are few solutions for networks with loops, but mostly they have not been used for the localization. Well-known solutions based on generalized belief propagation (GBP) [912], which are based on clusters or cliques, are still very complex for the large-scale ad hoc/sensor networks. Another option, tree-based reparameterization (TRP) [13, 14], is the method based on the message-free version of BP which requires formation of two-node trees and then merging them via an update rule. The problem with this method is the lack of the nonparametric representation. Nevertheless, the idea for our method comes from the TRP, but the core of our method is standard NBP method (i.e., message-passing version) based on optimal spanning tree formation.

In this paper, we propose NBP based on spanning trees (NBP-ST) created by breadth first search (BFS) method [15, 16] which is optimal for the unweighted graphs. NBP-ST algorithm represents two (or more) independent runnings of the NBP algorithm based on formed spanning trees. In order to obtain realistic distance measurements for indoor scenario, we performed experiments in our lab using IRIS wireless sensor nodes equipped with AT86RF230 transceiver [17, 18]. This setup is specially designed for the low-cost applications based on ZigBee/IEEE802.15.4 [19]. Using obtained data, we create a reliable indoor model and import all data into Matlab. According to our simulation results, NBP-ST performs better than NBP in terms of accuracy and communication cost in the networks with high connectivity (i.e., highly loopy networks). Furthermore, the computational and communication costs are nearly constant with respect to the transmission radius. However, the drawbacks of the proposed method are a little bit higher (10%–30%) computational cost and poor performance in low connected network. Anyway, this is not a problem since for the low-connected networks we can keep using NBP.

The remainder of this paper is organized as follows. In Section 2, we provide a background and related work on the cooperative localization in WSN, localization using NBP, and its correctness in loopy networks. In Section 3, we propose NBP method based on spanning trees. Experimental results for indoor scenario are presented in Section 4. Finally, Section 5 provides some conclusions and future work perspective.

2. Background and Related Work

We start with description of the main classes of cooperative localization techniques [20, 21]. Then, we describe the statistical framework for cooperative localization using NBP proposed by Ihler et al. [24]. Finally, we explain the correctness of BP methods in loopy networks using results from [1, 22]. The readers familiar with this subject can skip this section.

2.1. Cooperative Localization Techniques for Wireless Sensor Networks

2.1.1. Range-Based versus Range-Free Methods

Range-free or connectivity-based localization methods [5, 6] rely on connectivity between the nodes. The principle of this algorithm is to determine whether or not a sensor is in the transmission range of another sensor. The most attractive feature of the range-free algorithms is their simplicity. However, they can only provide a coarse-grained estimate of each node's location, which means that they are only suitable for applications requiring an approximate location estimate. Range-based or distance-based localization algorithms [5, 7, 8] use the intersensor distance measurements in a sensor network to locate the entire network. This type of algorithms is usually more accurate, but sensitive to measurement errors.

2.1.2. Centralized versus Distributed Methods

Based on the approach of processing the individual inter-sensor data, localization algorithms can be also considered in two main classes: centralized and distributed algorithms. Centralized algorithms [6, 7] utilize a single central processor (i.e., fusion center) to collect all the individual inter-sensor data and produce a map of the entire sensor network, while distributed algorithms [5, 7, 8] rely on self-localization of each node in the sensor network using the local information it collects from its neighbors. From the perspective of location estimation accuracy, centralized algorithms are likely to provide more accurate location estimates than distributed algorithms. However, centralized algorithms suffer from the scalability problem and generally are not feasible to be implemented for large scale sensor networks.

2.1.3. Anchor-Based versus Anchor-Free Methods

Anchor-based [5, 7] methods assume that a certain minimum number of the nodes know their position, for example, by manual placement or using some other location mechanism such as GPS. This localization method has the limitation that it needs another method to bootstrap the anchor node positions, and cannot be easily applied to any context in which another location system is unavailable. In contrast, anchor-free [6, 8] algorithms use local distance information to attempt to determine node coordinates when no nodes have predefined positions. Of course, any such coordinate system will not be unique and can be embedded into another global coordinate space in infinitely many ways, depending on global translation, rotation, and flipping. Therefore, the main problem with anchor-free methods is an additional algorithm for transformation from the relative to the absolute coordinates.

2.1.4. Probabilistic versus Deterministic Methods

Deterministic algorithms [58] use the measurements to estimate directly the positions by applying classical least square, multidimensional scaling, multilateration, or other methods. In favor of computational simplicity, they often lack a statistical interpretation, and as one consequence rarely provide an estimate of the remaining uncertainty in each sensor location. However, iterative least-squares methods, like N-hop multilateration [7], do have a straightforward statistical interpretation, but assume a Gaussian model for all uncertainties, which may be questionable in practice. Non-Gaussian uncertainty is a common occurrence in real-world sensor localization problems, where there is usually some fraction of highly erroneous (outlier) measurements. On the other hand, probabilistic methods [24, 23, 24] take into account uncertainty of the measurements, so given the probability density function (pdf) of, for example, measured distance and prior pdf of positions of all unknown nodes, they estimate posterior pdf of positions of all unknown nodes. However, the main drawback of the probabilistic methods is high computational and communication cost which, in some applications, makes these methods unacceptable in low-power sensor networks. Nevertheless, the particle-based approximation via nonparametric representation makes probabilistic methods acceptable for the inference in sensor networks. In addition, nonparametric representation enables us to estimate any pdf that does not exist in analytical (parametric) form (see, e.g., Figure 9(b)).

We decided to implement NBP (which is naturally probabilistic and distributed method) as anchor-based and range-based method, but straightforward modifications can make NBP to perform as anchor-free and/or range-free method.

2.2. Localization Using Nonparametric Belief Propagation

2.2.1. Measurements

We consider the case in which some small number of anchor nodes, obtain their coordinates via GPS or by installing them at points with known coordinates, and the rest, unknown nodes, must determine their own coordinates. We suppose that all sensors with unknown positions obtain noisy distance measurements of nearby subset of the other sensors in the network. This measurements can be obtained using a broadcast transmission from each sensor as all other sensors listen. Typical measurements techniques [20, 2527] are time of arrival (TOA), time difference of arrival (TDOA), receive signal strength (RSS) and angle of arrival (AOA). In this paper, we use RSS measurements.

Let us denote this received power by . It is empirically accepted to model as a random and log-normally [28] distributed random variable with a distance dependent mean value


where is known reference power value in dB milliwatts at a reference distance from the transmitter, is the path loss exponent that measures the rate at which the RSS decreases with distance, typically between two and four depending on the environment, is a zero-mean Gaussian distributed random variable with standard deviation which accounts for the random effects of shadowing. It is trivial to conclude from (1) that, given , the estimated distance between a transmitter and receiver is


As we can see, the distance error is multiplicative (i.e., log-normally distributed) which means that RSS-based distance estimates have variance proportional to their true distance. Therefore, RSS is most valuable in high-density sensor networks which we target in this paper.

2.2.2. Statistical Framework

Having defined measured distance, we can now define the framework for localization. Let us assume that we have sensors ( anchors and unknowns) scattered randomly in a planar region and denote the two-dimensional (2D) location of sensor t by . The unknown node u obtains a noisy measurement of its distance from node t with some probability


where, for the noise , we can use the log-normal (for RSS) or Gaussian (for TOA) distribution . However, it is advisable to use real measurements done in appropriate deployment area. In that case, it is not necessary to use any parametric form of the error distribution.

The binary variable will indicate whether this observation is available () or not (). Finally, each sensor t has some prior distribution denoted . This prior could be an uninformative one for the unknowns and the Dirac impulse for the anchors. Thus, the joint distribution is given by


For large-scale sensor networks, it is reasonable to assume that only a subset of pairwise distances will be available, especially between sensors which are located within some radius R. In this case, probability of detection is given by


Another option is exponential model [3] which represents a good approximation of the real-world systems. However, it is advisable to estimate using training data from appropriate deployment area.

Moreover, it is necessary to exchange information between the nodes which are not directly connected (n-step neighbors; ) because they contain some information (also known as negative information [24]) about the distance between them. Therefore, if two nodes do not observe the distance between them, they should be far away from each other. It is sufficient to include all 1-step and 2-step neighbors. Others could be neglected without losing accuracy of the results.

The relationship between the graph and joint distribution may be represented in terms of potential functions which are defined over graph's cliques. A clique () is a subset of nodes such that for every two nodes in , there exists an link connecting the two. So the joint distribution is given by


We can now define potential functions which can express this joint posterior distribution. This only requires potential functions defined over variables associated with single nodes and pairs of nodes. Single-node potential (prior information about position) at each node t, and the pairwise potential (probabilistic information about distance) between nodes t and u, are respectively given by


Finally, the joint posterior distribution is given by:


Of course, the proposed framework is not unique, so we also refer the reader to an alternative version based on factor graphs [23].

2.2.3. Belief Propagation

Having defined a statistical framework for sensor positioning, we can now estimate the sensor positions by applying the BP algorithm. We apply BP to estimate each sensor's posterior marginal and use the minimum mean square error estimate (MMSE) (i.e., mean value) of this marginal and its associated uncertainty to characterize the sensor positions.

Each node t computes its belief , the posterior marginal distribution of 2D position at iteration i, by taking a product of its local potential with the messages from its set of neighbors


The messages , from node u to node t, are computed by


In the first iteration of this algorithm it is necessary to initialize and for all u, t, and then repeat computation using (9) and (10) until sufficiently converge. For tree-like graphs, the number of iterations should be at most the length of the longest path in the graph. However, it is usually sufficient to run until all unknown nodes obtain information from minimum 3 noncolinear anchor nodes.

2.2.4. Nonparametric Belief Propagation

Due to the reasons explained in Section 1, we use the NBP method. Thus, the belief and message update equations, (9) and (10), are performed using particle-based approximations, in two phases: first, drawing weighted particles () from the belief , then using these particles to approximate each outgoing message .

Given N weighted particles from the belief obtained at iteration i, we can compute an estimate of the outgoing BP message . The distance measurement provides information about how far sensor u is from sensor t, but no information about its relative direction. To draw a particle of the message (), given the particle which represents the position of sensor t, we select a direction randomly in the interval . We then shift in the direction of by an amount which represents the estimated distance between nodes u and t ()


Using kernel density estimate (KDE) (Approximation of distribution . The most common kernel function () is spherically symmetric Gaussian kernel: , where bandwidth h controls the variance [29].) of potential function, and assuming that there is detection between sensor nodes t and u, the particles are weighted by the reminder of(10)


The optimal value for bandwidth could be obtained in a number of techniques. The simplest way is to apply the "rule of thumb" estimate [29]


It is also necessary to define messages coming from anchor nodes, using (10) and the belief of the anchor node (, where asterisk denotes anchor)


Messages along unobserved edges (2-step, ) must be represented as analytic functions since their potentials have the form which is usually not normalizable. Using the probability of detection and particles from the belief , an estimate of outgoing message to node u is given by


Finally, the messages along unobserved edges coming from anchor nodes () are given by


To estimate the belief using (9), we draw particles from the product of Gaussian mixture and analytic messages. However, it is very difficult to draw particles from this product, so we use a proposal distribution, the sum of the Gaussian mixtures, and then reweight all samples. This procedure is well-known as mixture importance sampling [2].

Denote the set of neighbors of u, having observed edges to u and not including anchors, by and the set of of all neighbors by . In order to draw N particles, we create a collection of weighted samples (where is a parameter of the sampling algorithm) by drawing samples from each message with and assigning each sample a weight equal to the ratio


Some of these weights are much larger then the rest, especially after more iterations. This means that any particle-based estimate will be dominated by the influence of a few of the particles, and the estimate could be erroneous. To avoid this, we then draw N values independently from the collection with probability proportional to their weight, using resampling with replacement [30, 31]. This means that we create N equal-weight particles drawn from the product of all incoming messages.

A node is located when a convergence criteria is met. We can use the Kullback-Leibler (KL) divergence, a common measure of difference between two distributions. For the particle-based beliefs in our algorithm, KL divergence between beliefs in two consecutive iterations is given by


The detailed description of the algorithm can be found in [3]. In addition, using the results from [7, 32], we constrain the area from which the particles are drawn by building a box that covers the region where anchors' ranges overlap (Figure 1) and, in each iteration, we filter out all particles which get out of the appropriate box. This modification increases the accuracy even after very small number of iterations.

Figure 1

Drawing samples within the box that covers the region where anchors' ranges overlap.

2.3. Correctness of Belief Propagation

The BP algorithm, defined in Section 2.2, does not make a reference to the topology of the graph that it is running on. However, if we ignore the existence of loops, messages may circulate indefinitely around these loops, and the process may not converge to a stable equilibrium [1]. One can find examples of loopy graphs, where, for certain parameter values, the BP algorithm fails to converge or predicts beliefs that are inaccurate. On the other hand, the BP algorithm could be successful in graphs with loops, for example, error-correcting codes defined on Tanner graphs that have loops [33]. Therefore, this problem is application dependent. In this section, we intuitively explain this problem. However, for extensive analysis of this problem, we refer the reader to [9, 22, 34, 35].

Let us consider the example of network in Figure 2. In this network, there are 3 unknown nodes (A, B and C) and 3 anchor nodes (, , and ) which represent the local evidence. The BP algorithm can be considered of as a way of communicating local evidences between nodes such that all nodes compute their beliefs given all the evidence.

Figure 2

(a) A simple loopy network, (b) Corresponding unwrapped network for the first 3 iterations.

In order for BP to be successful, it needs to avoid double counting [1, 22], a situation in which the same evidence is passed around the network multiple times and mistaken for new evidence. Of course, this is not possible in tree-like network because when the node receives some evidence, it will never receive that evidence again. In a loopy network, double counting could not be avoided. For example, in Figure 2(a), node will send A's evidence to , but in the next iteration, will send that same information back to . Thus, it seems that BP in loopy network will always give the wrong estimate.

However, BP could still lead to correct inference if all evidence is "double counted" in equal amounts. This could be formalized by unwrapped network corresponding to as loopy network. The unwrapped network is a tree-like network constructed such that performing BP in the unwrapped network is equivalent to performing BP in the loopy network. The basic idea is to replicate the nodes as shown in Figure 2(b). For example, the message received by node after 3 iterations of BP in the loopy network are identical to the final messages received by node " in the unwrapped network. In this way, we can create infinite network. The importance of the unwrapped network is that since it is tree-like, BP on it is guaranteed to give the correct beliefs. However, usefulness of this beliefs depends on the similarity between the probability distribution induced by the unwrapped network and the original loopy network. If the distributions are not similar, then the unwrapped network is not useful and the results will be erroneous in original loopy network.

Obviously, we can conclude the same for the NBP method. Regarding localization using NBP, there is no convergence problem, but the accuracy is questionable [11]. In order to overperform the NBP method in loopy networks, we will break the loops using spanning trees.

3. NBP Based on Spanning Trees

3.1. Spanning Tree Formation

We start by describing the basics of graphical models. An undirected graph consists of a set of nodes that are joined by a set of edges . A loop is a sequence of distinct edges forming a path from a node back to itself. A tree is a connected graph without any loops. A spanning tree is an acyclic subgraph that connects all the nodes of the original graph. A root node is a node without parent and leaf node is a node without children. In order to define a graphical model, we place at each node a random variable taking values in some space. In case of localization, this random variable represents the 2D or 3D position and each edge indicate that measurement is available. If we exclude anchors, the graph is undirected, but only for the first phase (spanning tree formation) we assume that it is directed (starting from chosen root node).

The optimal method for spanning tree formation for unweighted graphs is breadth first search (BFS) method [15, 16, 36]. It begins at the root node and explores all the neighboring nodes. Then, each of those neighbors explores their unexplored neighbor nodes, and so on, until all nodes are explored. In this way, there will not be a loop in the graph because all nodes will be explored just once. The detailed pseudocode is shown in Algorithm 1. The worst case complexity is , where is the number of nodes and is the number of edges in the graph, since every node and every edge will be explored in the worst case. Note that there are also other methods for breaking the loops, for example, trellis-based iterative method [37].

Algorithm 1: Breadth First Search (BFS).

1: Input: list of nodes and root node root

2: Set current root:

3: While is not empty do

4:  for all nodes


6:    Remove from

7:    Insert in

8:    Insert in

9:   end if

10:  end for

11:  Set current root: first unused node from

12: end while

13: Output: spanning tree

3.2. Description of the Algorithm

In case of NBP localization, we exclude all the anchors from the BFS algorithm since they do not form the loops in the graph (they just send, and never receive the messages). A graph generally has a large number of spanning trees, but since our graph is unweighted we choose few (minimum 2) of them in a partly random way. In order to choose spanning tree, it is sufficient to choose root nodes for all spanning trees, then the algorithm will automatically set the spanning tree (see Algorithm 1). Taking into account that we want to maximize the difference between two spanning trees, the root nodes can be chosen in two ways.

  1. (i)

    The first root node we choose randomly from the set of all unknown nodes. The second root node has to be as far as possible from the first root node. Thus, it should be one of the leaf nodes which is the maximum-hop away from the root. Of course, hops should be counted using original graph where the number of hops represents approximated distance. If we want to form more spanning trees, the analog procedure can be used.

  2. (ii)

    We choose two (or more) anchor nodes which are far away from each other. The closest unknown nodes to chosen anchor nodes will be chosen as roots.

Since we will apply this algorithm for the indoor scenario, where the anchor nodes are usually fixed, we will use the second option. An example of a loopy graph and two corresponding spanning trees, formed by BFS with mentioned constraints, is illustrated in Figure 3. Note that using BFS, it is not possible to form two spanning trees with completely different edges, and that usually some of the edges will be out of both spanning trees. Thus, if we want to ensure that all edges are used, we have to add more spanning trees, but it is usually not necessary since it would only provide us a redundant information. It is especially the case in highly connected networks which we target in this paper.

Figure 3

(a) Example of loopy graph, (b), (c) Spanning trees created by BFS method.

The NBP method is naturally distributed through the network which means that there is no central processor which will handle all computations. Therefore, the proposed BFS method has to be done in a distributed fashion. This can be simply done if each unknown node initially broadcast its ID to all neighbors, which will continue to broadcast to others, and so on, until each unknown node has a list of all unknown nodes in the graph. One anchor node (for example, with lowest ID) has to be assigned to choose the root node from that list and give him the permission to start BFS algorithm. Then, the chosen root node has all initial data to start the BFS algorithm, and, when it is necessary, has only to broadcast all data (i.e., variables from Algorithm 1) to all its neighbors. In the end, the last visited node has the output result (spanning tree ) and it just has to start multihop broadcast until each unknown node receives this result. Then, the second anchor node will start the analog procedure. Note that since after this phase NBP method starts, the connectivity should be fixed.

Finally, NBP-ST algorithm represents two (or more) independent runnings of the NBP algorithm based on formed spanning trees. Each running will provide us weighted particles of the node beliefs computed by (9). The simplest way to fuse these beliefs is to resample with replacement (see Section 2.2) from weighted particles from all spanning trees, which produces the particles with same weights. The collection of particles from all spanning trees represents our final output, from which we can easily extract any parameter that we need (e.g, mean value for location estimate). The pseudocode in Algorithm 2 illustrates the NBP-ST method.

Algorithm 2: NBP-ST method for localization.

1: for all nodes do

2:  Take sensing actions

3:  Set all parameters to the initial values

4:  Broadcast own and all received IDs

  and listen for other sensor broadcasts

  (until receive all IDs)

5: end for

6: Set a list of nodes for BFS (excluding anchors):

7: Choose root node: root

8: for alldo

9:   Run BFS ( Algorithm 1)

10:  Run NBP on defined spanning tree

11:  Choose root node as far as possible from

  the previous roots

12: end for

13: Fuse all beliefs into one and compute location estimates

4. Experimental Results

In this section, we start with the description of the setup used for the experiments performed in our lab. We then create reliable indoor model using obtained measurements and import all data into Matlab in order to check the performance of the proposed method in high-density sensor network. Furthermore, for the experimental results for various localization algorithms, which are not topic of this paper, we refer the reader to [38, 39].

4.1. Experimental Setup

For our experiments, we use Crossbow's IRIS wireless sensor nodes (Figure 4(a)) equipped with AT86RF230 transceiver. The AT86RF230 is high performance RF-CMOS 2.4 GHz radio transceiver specially targeted for low cost ZigBee/IEEE802.15.4 applications. The transmitter provides programmable output power: up to 3 dBm. The receiver, with sensitivity, generates digital signal with granularity. The data is stored in a 128-byte dual port SRAM, from which 8 bytes are reserved. More details in [17, 18].

Figure 4

(a) Crossbow's IRIS wireless sensor node, (b) Illustration of the experiment in our lab.

In order to estimate the distance between sensors, we placed two sensors, 2 m from the floor, in our lab (Figure 4(b)) and set the transmission power to 3 dBm. There are no obstacles between sensors, but the RSS will be affected due to the multipath components and other devices in vicinity (e.g, WiFi). We obtained RSS measurements at 8 equidistant inter-sensor distances ( m, ). For each of them, we obtained 1000 measurements. Because of the 3 dB granularity of RSS, we assume that the real power is a random variable uniformly distributed within the interval (RSS  dB, RSS  dB).

4.2. Indoor Modeling Using Distance Measurements

Using obtained RSS measurements, our goal is to obtain all necessary parameters for indoor model: path-loss exponent, reliable distance estimation, probability of detection, and potential functions.

4.2.1. Path-Loss Exponent

First, we define a reference point ( dBm). The path-loss exponent () could be easily obtained using another reference point, but this is not an optimal way. The better option is to, using all measured data, minimize the root mean square (RMS) error with respect to


where is the number of intersensor distances (in our case, ) and is given by


Note that (2) and (20) are equivalent since the measured power includes the noise which accounts for the random effects of shadowing. According to Figure 5 (dashed line), the optimal value of the path-loss exponent is .

Figure 5

Path-loss exponent estimation.

4.2.2. Reliable Distance Estimation

Using obtained measurements and estimated , we can estimate the distance. As we expected, our indoor model is not similar to the ideal one (Figure 6), so the distance cannot be always trustfully estimated using (20). For instance, the averaged received power of corresponds to three different distances (4.6 m, 7 m and 9.6 m), so the sensor has no other option, but to guess. This is because the power is not monotonically decreasing function of the distance. Therefore, we have to cut out the area below the threshold power () because this area corresponds to the nonmonotonic part of the function. Above the threshold, each received power corresponds to the unique distance, which makes this model reliable for our scenario. In addition, since we excluded data below the threshold, we must reestimate using only the remaining data. According to Figure 5, . We illustrated in Figure 7, the distance estimation which corresponds to the true value of 1.2 m. As we can see, the error distribution () is not similar to the log-normal distribution, so we will use nonparametric form of the error distribution. Moreover, we have three different sets of error samples (for 1.2 m, 2.4 m, and 3.6 m). Thus, in order to import these samples into Matlab, we will simply draw the sample from the nearest error distribution, and then add it to the true distance (i.e., this is nearest neighbor interpolation, so for the true value of, e.g, 2.9 m, we use the error sample for 2.4 m). Note that we cannot use mean value because we want to preserve the appropriate uncertainty.

Figure 6

Reliable model for distance estimation.

Figure 7

Histogram of distance estimation which corresponds to the true value of 1. 2 m.

4.2.3. Probability of Detection

For each inter-sensor distance, we found that RSS is above the power defined by sensitivity (Figure 8). This is expected because we set the transmission power to the maximum which could even provide us around 75 m radius, according to ZigBee standard. Anyway, we have to follow defined reliable model, so we assume that if the power is less than threshold (64 dBm), there is no communication between nodes. This could be easily forced by software. As we can see in Figure 6, the corresponding distance is 4 m, so this will be the maximum value of transmission radius. Note that in our case, we didn't detect communication failures (link quality indicator is always maximum), so we set in the transmission range. This is expected due to the very small distance between nodes.

Figure 8

Probability of detection.

Figure 9

Pairwise potential function ( : anchor, : unknown) using (a) log-normal model, (b) indoor model from our lab.

4.2.4. Potential Functions

We have to define single-node and pairwise potential function. Since we don't have any a priori information about positions of unknown nodes, single-node potential of unknown node is equal to 1 in the area defined by Figure 1. Regarding pairwise potential, according to Section 2.2, given anchor node (or particle of unknown node), the position of other node is shifted in the random direction by measured distance between nodes. We obtained density function using spherically symmetric Gaussian kernel [29]. We illustrate theoretical (log-normal) model in Figure 9(a), and our indoor model in Figure 9(b).

4.3. Simulations

We placed 50 unknowns and 10 anchors in area (Figure 10). Unknown nodes are deployed randomly within this area and anchor nodes are fixed (8 along the edges an 2 in center area). This constraint, realistic for indoor scenario, helps the unknown nodes near the edges which suffer from low connectivity. The number of iteration is set to . According to our analysis, this number is sufficient for good convergence. All simulations are done for particles with respect to the transmission radius ( m–4 m). Finally, each point in the simulations represents the average over 30 Monte Carlo trials.

Figure 10

(a) Original network, (b, c) two corresponding spanning trees. Connections between anchors (marked by red squares) and unknowns (marked by black circles) are not shown.

Using the defined scenario, we compared NBP and NBP-ST algorithms. For NBP-ST, we used 2 and 3 spanning trees. The error is defined as Euclidean distance between true and estimated location. As we can see in Figure 11, NBP-ST performs better than NBP starting from some value of , which controls the connectivity. We can conclude the same for the coverage (Figure 12), which represents the percentage of located nodes with error less than predefined tolerance. Obviously, for higher values of , there is a large number of loops in the network (hundreds, in our case) which decreases the performance of the NBP method. For lower values of , we could expect that NBP-ST performs with higher (or same) accuracy, but we cannot forget that, by using only 2 or 3 spanning trees, we did not include all information (i.e., removed edges) that we have. Thus, in this case the NBP overperforms NBP-ST (Figure 13). To measure the communication cost, we count elementary messages, where one elementary message is defined as simple scalar data. We assumed that this data is represented in single precision floating-point format that occupies 4 bytes in the memory. As we have already mentioned, 8 bytes are already reserved, so the size of elementary message is 12 bytes. According to Figure 14, NBP-ST performs better than NBP for 3.3m only if we use 2 spanning trees. In order to explain this we have to remember two main things we have taken into account: removing the edges in order to form the spanning trees and running NBP two times in these spanning trees. First operation decreases the communication, but the second one increases it. Therefore, in low-connected networks the second operation predominates, but in high connected networks the first one predominates. Regarding computational cost (Note that we show joint computational cost of both spanning tree formation and NBP method. The cost of spanning tree formation is very small, around 5% of total cost.), NBP overperforms NBP-ST, but the conclusion is nearly the same. If we keep increasing (4m), we can overperform NBP. Since RSS is not reliable in this area, it could be achieved using TOA measurements which usually performs better [20]. Furthermore, it is important that the computational and communication cost are nearly constant with respect to the transmission radius. This feature provides us more precise information about battery life. Finally, if we use 3 or more spanning trees, both computational and communication cost will be obviously significantly higher.

Figure 11

Comparison of accuracy.

Figure 12

Comparison of coverage.

Figure 13

Comparison of computational cost.

Figure 14

Comparison of communication cost.

The final conclusion is that NBP-ST (with 2 spanning trees) algorithm performs better than NBP in terms of accuracy and communication cost, for . In our case, m, but this parameter depends on the density in the network (i.e., average connectivity). On the other hand, if the unique goal is accuracy, user should increase the number of spanning trees.

5. Conclusions and Future Work

As presented in this paper, NBP localization algorithm has poor performance in highly loopy networks. Moreover, the connectivity in these networks is very high which makes communication burden for low-power applications. Therefore, we proposed NBP-ST method based on spanning trees created by the BFS method which is optimal for the unweighted graphs. The BFS method is done in a distributed way which makes the algorithm applicable in ad hoc sensor networks. We can conclude that NBP-ST method performs better than NBP in terms of accuracy, and communication cost in highly connected networks. However, the drawbacks of proposed method are a little bit higher computational cost and poor performance in low connected network. There remain few open directions for the future work. One possible future line is the implementation of localization algorithm based on nonparametric generalized belief propagation (NGBP). Some versions already exist [11], but they are still very complex for the large-scale networks. Furthermore, tree-reweighted BP [40] could be good alternative for this problem. Finally, real-time tracking using these methods could be an interesting direction. This will be a part of our future research.


  1. 1.

    Pearl J: Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann; 1988.

  2. 2.

    Ihler AT, Fisher JW III, Moses RL, Willsky AS: Nonparametric belief propagation for self-calibration in sensor networks. Proceedings of the 3rd International Symposium on Information Processing in Sensor Networks (IPSN '04), April 2004 225-233.

  3. 3.

    Ihler AT, Fisher JW III, Moses RL, Willsky AS: Nonparametric belief propagation for self-localization of sensor networks. IEEE Journal on Selected Areas in Communications 2005, 23(4):809-819.

  4. 4.

    Ihler AT: Inference in sensor networks: graphical models and particle methods, thesis. MIT, Department of Electrical Engineering and Computer Science; June 2005.

  5. 5.

    Niculescu D, Nath B: Ad hoc positioning system (APS). Proceedings of IEEE Global Telecommunicatins Conference (GLOBECOM '01), November 2001 5: 2926-2931.

  6. 6.

    Shang Y, Ruml W, Zhang Y, Fromherz M: Localization from connectivity in sensor networks. IEEE Transactions on Parallel and Distributed Systems 2004, 15(11):961-974. 10.1109/TPDS.2004.67

  7. 7.

    Savvides A, Park H, Srivastava MB: The bits and flops of the n-hop multilateration primitive for node localization problems. Proceedings of the ACM International Workshop on Wireless Sensor Networks and Applications, September 2002 112-121.

  8. 8.

    Priyantha NB, Balakrishnan H, Demaine E, Teller S: Anchor-free distributed localization in sensor networks. MIT Laboratory for Computer Science; 2003.

  9. 9.

    Yedidia JS, Freeman WT, Weiss Y: Understanding belief propagation and its generalizations. In Exploring Artificial Intelligence in the New Millennium. Volume 8. Morgan Kaufmann; 2003:239-269.

  10. 10.

    Jordan MI, Weiss Y: Graphical model: probabilistic inference. In The Handbook of Brain Theory and Neural Networks. 2nd edition. MIT Press, Cambridge, Mass, USA; 2002.

  11. 11.

    Savic V, Zazo S: Sensor localization using nonparametric generalized belief propagation in network with loops. Proceedings of the 12th International Conference on Information Fusion (FUSION '09), July 2009 1966-1973.

  12. 12.

    Savic V, Zazo S: Sensor localization using generalized belief propagation in network with loops. Proceedings of the 17th European Signal Processing Conference (EUSIPCO '09), August 2009 75-79.

  13. 13.

    Wainwright MJ, Jaakkola T, Willsky AS: Tree-based reparameterization for approximate inference on loopy graphs. Advances in Neural Information Processing Systems, 2001 1-8.

  14. 14.

    Wainwright MJ, Jaakkola TS, Willsky AS: Tree-based reparameterization framework for analysis of sum-product and related algorithms. IEEE Transactions on Information Theory 2003, 49(5):1120-1146. 10.1109/TIT.2003.810642

  15. 15.

    Yoo A, Chow E, Henderson K, McLendon W, Hendrickson B, Çatalyürek Ü: A scalable distributed parallel breadth-first search algorithm on BlueGene/L. Proceedings of the ACM/IEEE Supercomputing Conference (SC '05), November 2005

  16. 16.

    Bader DA, Madduri K: Designing multithreaded algorithms for Breadth-First Search and si-connectivity on the Cray MTA-2. Proceedings of the International Conference on Parallel Processing (ICPP '06), August 2006 523-530.

  17. 17.

  18. 18.

  19. 19.

    IEEE Std 802.15.4-2006(Revision of IEEE Std 802.15.4-2003) : IEEE Standard for Information Technology- Telecommunications and Information Exchange Between Systems- Local and Metropolitan Area Networks- Specific Requirements Part 15.4: Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications for Low-Rate Wireless Personal Area Networks (WPANs). 2006

  20. 20.

    Patwari N, Ash JN, Kyperountas S, Hero AO III, Moses RL, Correal NS: Locating the nodes: cooperative localization in wireless sensor networks. IEEE Signal Processing Magazine 2005, 22(4):54-69.

  21. 21.

    Mao G, Fidan B, Anderson BDO: Wireless sensor network localization techniques. Computer Networks 2007, 51(10):2529-2553. 10.1016/j.comnet.2006.11.018

  22. 22.

    Weiss Y: Correctness of local probability propagation in graphical models with loops. Neural Computation 2000, 12(1):1-41. 10.1162/089976600300015880

  23. 23.

    Wymeersch H, Lien J, Win MZ: Cooperative localization in wireless networks. Proceedings of the IEEE 2009, 97(2):427-450.

  24. 24.

    Rong P, Sichitiu ML: Robust, probabilistic, constraint-based localization for wireless sensor networks. Proceedings of the 2nd Annual IEEE Communications Society Conference on Sensor and AdHoc Communications and Networks (SECON '05), September 2005 541-550.

  25. 25.

    Sayed AH, Tarighat A, Khajehnouri N: Network-based wireless location: challenges faced in developing techniques for accurate wireless location information. IEEE Signal Processing Magazine 2005, 22(4):24-40.

  26. 26.

    Gustafsson F, Gunnarsson F: Mobile positioning using wireless networks: possibilities and fundamental limitations based on available wireless network measurements. IEEE Signal Processing Magazine 2005, 22(4):41-53.

  27. 27.

    Dardari D, Conti A, Ferner U, Giorgetti A, Win MZ: Ranging with ultrawide bandwidth signals in multipath environments. Proceedings of the IEEE 2009, 97(2):404-425.

  28. 28.

    Rappaport TS: Wireless Communications: Principles and Practice. 2nd edition. Prentice Hall, Upper Saddle River, NJ, USA; 2001.

  29. 29.

    Silverman BW: Density Estimation for Statistics and Data Analysis. Chapman & Hall, Boca Raton, Fla, USA; 1986.

  30. 30.

    Djurić PM, Kotecha JH, Zhang J, Huang Y, Ghirmai T, Bugallo MF, Míguez J: Particle filtering. IEEE Signal Processing Magazine 2003, 20(5):19-38. 10.1109/MSP.2003.1236770

  31. 31.

    Arulampalam MS, Maskell S, Gordon N, Clapp T: A tutorial on particle filters for online nonlinear/non-Gaussian Bayesian tracking. IEEE Transactions on Signal Processing 2002, 50(2):174-188. 10.1109/78.978374

  32. 32.

    Savic V, Zazo S: Nonparametric boxed belief propagation for localization in wireless sensor networks. Proceedings of the 3rd International Conference on Sensor Technologies and Applications (SENSORCOMM '09), June 2009 520-525.

  33. 33.

    Frey BJ: A revolution: belief propagation in graphs with cycles. Advances in Neural Information Processing Systems, 1997 10: 479-185.

  34. 34.

    Mooij JM, Kappen HJ: Sufficient conditions for convergence of the sum-product algorithm. IEEE Transactions on Information Theory 2007, 53(12):4422-4437.

  35. 35.

    Weiss Y, Freeman WT: Correctness of belief propagation in gaussian graphical models of arbitrary topology. Neural Computation 2001, 13(10):2173-2200. 10.1162/089976601750541769

  36. 36.

    Cormen TH, Leiserson CE, Rivest RL, Stein C: Introduction to Algorithms. 2nd edition. MIT Press and McGraw-Hill, New York, NY, USA; 2001.

  37. 37.

    Lan L, Tai YY, Chen L, Lin S, Abdel-Ghaffar K: A trellis-based method for removing cycles from bipartite graphs and construction of low density parity check codes. IEEE Communications Letters 2004, 8(7):443-445. 10.1109/LCOMM.2004.832776

  38. 38.

    Conti A, Dardari D, Lien J, Win MZ: The effect of cooperation on UWB-based positioning systems using experimental data. Eurasip Journal on Advances in Signal Processing 2008, 2008:-11.

  39. 39.

    Pavani T, Costa G, Mazzotti M, Conti A, Dardari D: Experimental results on indoor localization techniques through wireless sensors network. Proceedings of IEEE Vehicular Technology Conference (VTC '06), May 2006 2: 663-667.

  40. 40.

    Wainwright MJ, Jaakkola TS, Willsky AS: Tree-reweighted belief propagation algorithms and approximate ML estimation by pseudo-moment matching. Proceedings of the Workshop on Artificial Intelligence and Statistics, January 2003

Download references


This work is supported by the FPU fellowship from Spanish Ministry of Science and Innovation. Furthermore, we thank partial support by: ICT project FP7-ICT-217033 WHERE, the Spanish National Project by the Spanish Ministry of Science and Innovation under Grant TEC2009-14219-C03-01, program CONSOLIDER-INGENIO 2010 under grant CSD2008-00010 COMONSENS, ICT project FP7-ICT-223994 N4C, National Project M3HF under Grant TEC2007-67520-C02-01/02/TCM, and 4GBB project under grant TSI-020400-2009-20.

Author information

Correspondence to Vladimir Savic.

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 2.0 International License (, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Reprints and Permissions

About this article

Cite this article

Savic, V., Población, A., Zazo, S. et al. Indoor Positioning Using Nonparametric Belief Propagation Based on Spanning Trees. J Wireless Com Network 2010, 963576 (2010) doi:10.1155/2010/963576

Download citation


  • Sensor Network
  • Span Tree
  • Communication Cost
  • Receive Signal Strength
  • Anchor Node