A Distributed Linear Least Squares Method For Precise Localization With Low Complexity in Wireless Sensor Networks
A Distributed Linear Least Squares Method For Precise Localization With Low Complexity in Wireless Sensor Networks
1 Introduction
The increasing miniaturization in the semiconductor field is leading to the evo-
lution of very small and low-cost sensors [1]. Due to their small size they are
strongly limited with respect to processor capacity, memory size and energy re-
sources. Several thousands of such sensor nodes get into wireless contact with
each other and form large ad hoc sensor networks. A wireless sensor network
(WSN) will be placed around a field of interest or within an object. The sensor
nodes are able to monitor different environmental parameters and to transmit
them to a beacon or an infrastructure node. WSN enable new applications such
as timely detection of wood fire or monitoring of artificial dikes.
The resulting data are only meaningful when combined with the geographi-
cal position of the sensor. Possible positioning technologies are the Global Posi-
tioning System (GPS) or the Global System for Mobile Communication (GSM)
[2],[3]. These systems are however, due to the size of the equipment, the high
prices and the high energy requirements, unsuitable for miniaturized sensor
nodes and could only be used for a small number of nodes [4].
2 Related Work
For the above-mentioned reasons, existing positioning techniques (e.g. GPS) can-
not be integrated on all sensor nodes. The number of nodes with known position
has to be limited. These nodes are referred to here as beacons, with the remain-
ing nodes classed as sensor nodes. For the positioning of the sensor nodes we
distinguish between approximate and exact methods.
Fig. 1. Sensor network with one unknown point and beacons as reference points. Here
beacon one was chosen as linearization tool.
We demand exact localization methods that work on tiny sensor nodes with
high limited energy resources. To achieve that, we transfer the complex calcula-
tions such as matrix multiplication, matrix inversion, and eigenvalue determina-
tion to the base station that can be e.g. a powerful desktop computer or a more
efficient node in the network. Consequently, only simple calculations have to be
executed on the sensor nodes. Additionally, we reduce the communication and
memory requirements by optimizations of the proposed algorithm.
2 2
(x − xi ) + (y − yi ) = ri2 (i = 1, 2, . . . , m). (1)
This system of equations must be linearized with either Taylor series [15] or
a linearization tool [16]. Although the linearization tool is not as exact as the
Taylor series, it requires no mathematical differentiation and it is suitable for a
distributed implementation (discussed later in Section 5). Thus, we use the j’th
equation of (1) as the linearization tool. By adding and subtracting xj and yj
to all other equations this leads to:
2 2
(x − xj + xj − xi ) + (y − yj + yj − yi ) = ri2 (i = 1, 2, . . . , j − 1, j + 1, . . . , m).
(2)
With the distance rj (ri ) that is the distance between the unknown point and
the j’th (i’th) beacon and the distance dij that is the distance between beacon
Bi and Bj this leads, after resolving and simplifying, to:
1 2
r − ri2 + d2ij = bij .
(x − xj )(xi − xj ) + (y − yj )(yi − yj ) = (3)
2 j
Because it is not important which equation we use as a linearization tool,
j = 1 is sufficient. This is equal to choosing the first beacon and if i = 2, 3, . . . , m
this leads to a linear system of equations with m − 1 equations and n = 2
unknowns.
1
2 2 2
(x − x1 )(x2 − x1 ) + (y − y1 )(y2 − y1 ) = 2 r12 − r22 + d21 = b21
1
(x − x1 )(x3 − x1 ) + (y − y1 )(y3 − y1 ) = 2 r1 − r3 + d231 = b31
.. (4)
.
(x − x1 )(xm − x1 ) + (y − y1 )(ym − y1 ) = 21 r12 − rm
2
+ d2m1 = bm1
Ax = b (5)
with:
x2 − x1 y2 − y1 b21
x3 − x1 y3 − y1 b31
x − x1
A= ,x = ,b = . . (6)
.. ..
. . y − y1 ..
xm − x1 ym − y1 bm1
This is the basic form that now has to be solved using the linear least squares
method.
M inimize
||Ax − b||2 . (7)
x ∈ <n
To summarize (see Figure 2), linear systems of equations can be solved it-
eratively using Splitting techniques or directly with the normal equations or
orthogonal factorization. Existing techniques are numerous but often the dif-
ferences between them are small. For this reason, we focus our studies on three
popular methods - normal equations, qr-factorization, and singular-value decom-
position. For all others we recommend [18].
Iterative
direct
(Splitting)
Singular-Value-
Gauss-Seidel Richardson Jacobi Normal Equations QR-Factorization
Decomposition
S1 S1 S1
||Ax−b||2 → ||U V T x−b||2 = || V T x−U T b||2 = || y−U T b||2 ,
0 0 0
(10)
where U is an orthogonal [m × m]-matrix, V is an orthogonal [n × n]-matrix
and S is a diagonal matrix. The original algorithm has been implemented by
Golub and Reinsch in [19]. This algorithm is also robust and stable to compute,
but requires high computation effort due to root and eigenvalue operations.
Now, after discussing the standard methods, we will explain the new approach
for distributing them in wireless sensor networks.
In the next section, we will adapt the algorithm to all three solution methods
and analyze the results in detail.
5.1 Reduced Complexity
In Section 4.1 we already analyzed the complexity of all three solution methods.
At this point it is important to know what we can save on the sensor nodes
without complex precalculations regarding only the remaining subcalculation.
x=(ATA)-1AT0.5(r12-r2+dp)
sensor node
beacon
base station
SV-Decomposition As the third method, the sensor nodes receive from the
base station the matrices U, S, V and dp and have to compute:
6
10 160
5 140
10
120
Communication Effort
4
10
100
Complexity
3
10 80
2 60
10
Complete Normal Equations
Reduced Normal Equations 40
1
Complete QR-Factorization Reduced Normal Equations
10 Reduced QR-Factorization Reduced QR-Factorization
Complete SV-Decomposition 20 Complete Computation
Reduced SV-Decomposition
Reduced SV-Decomposition
0
10 0
5 10 15 20 25 30 35 40 45 50 5 10 15 20 25 30 35 40 45 50
Number of Beacons Number of Beacons
Normal Case The reduced calculations must be feasible on sensor nodes with
a very small memory, mostly not more than a few kilobyte RAM. In our case,
the memory consuming operation is always the multiplication of b with the
precalculated data. Without optimizations this would be for the three methods:
1. Ap · 12 · (r12 − r2 + dp )
2. QT1 · 12 · (r12 − r2 + dp )
3. U1T · 12 · (r12 − r2 + dp )
In the worst case Ap , QT1 , U1T , and r plus dp must be stored temporarily
in memory before the execution on the sensor node can start. In more detail,
[2 · (m − 1)] + (m − 1) + (m − 1) = (4m − 4) elements must be stored. On common
microcontrollers, that are presently integrated on sensor node platforms, every
element is stored in floating point representation as a 4 byte number. Accord-
ingly, with m = 100 beacons, already 0.796 kb must be allocated, for localization
6
”Complete Computation” stands for the classical method, where all beacons send
their positions directly to all sensor nodes. Thus, every sensor node must receive at
least two positions to determine its own position that results in 2m elements.
only. Normally, the localization task is part of the middleware that has to ex-
ecute many more tasks. Besides, temporary variables are needed that increases
the memory consumption. Given these facts, we studied the critical operations
in more detail and will describe optimizations in the next section.
Optimizations In reality, input data for sensor nodes arrive in packets and will
be disassembled into a serial data stream. Due to problems in the transmission
channel (e.g. different paths or transmission errors) a sorted order of the incom-
ing packets cannot be guaranteed. The data can arrive in an unsorted form and
the calculation begins after receiving all data.
However, the reduced calculation has a further useful quality. Individual cal-
culations of Ap ·b can be executed after the arrival of only some elements without
collecting all data. Only one accumulator for the position Pest (x) and one for
the position Pest (y) of the sensor node is needed. If we define W = Ap , QT1 , U1T
independently from the specific method, the following multiplication will always
result:
b1
w11 · · · w1(m−1) b2
w11 · b1 + . . . + w1(m−1) · b(m−1)
.. = .
w21 · · · w2(m−1) . w21 · b1 + . . . + w1(m−1) · b(m−1)
b(m−1)
With wij (i = 1..2, j = 1..m − 1) and bs (s = 1..m − 1) the following as-
sumptions can be made. If elements with j = s are available, an immediate
multiplication of wij · bs and a subsequent accumulation in Pest (x, y) is possible.
The index i distinguishes into which accumulator it must be written; Pest (x) at
i = 1 or Pest (y) at i = 2. Finally, the optimized reduced calculation requires a
worst-case calculation time of (m − 1)/2 if the elements arrive in reverse order.
To avoid the case of unsorted data it is also possible to send the elements
wij , ds in appropriate tuples, e.g. w11 , d1 ; w12 , d2 ; . . . ; wij , ds . In best case, space
in memory has then to be reserved for only a few temporary variables and two
accumulators which reduces memory consumption to a minimum.
5.4 Example
The algorithm is intended for implementation and execution on a sensor plat-
form. Due to this, we have represented the results in Table 1. We assume m = 100
beacons and n = 2 for the second dimension7 . Furthermore, we assume that a
floating point representation requires 4 byte of memory.
The direct calculation by normal equations requires minimal computation
whereas the calculation by the qr-factorization requires lowest data traffic. How-
ever, the normal equations are numerically instable and the sensitivity of the
7
It must be considered here to add x1 and y1 to the final coordinates due to the
linearization in (6).
linear equalization problem can deteriorate. Remarkable are the saving of the
calculation for the qr-factorization and the sv-decomposition, because the precal-
culation requires the largest expenditure. Summarized, this overall comparison
shows the potential advantages of the new distributed approach.
Estimating the position basically requires beacon positions and distances. Due
to various error influences, e.g. imprecise measuring of the signal of flight or de-
fective GPS-coordinates, the applied algorithm must be robust to input errors.
For this reason, we studied the behavior of the described methods in different
simulations concerning noisy distances r and noisy beacon positions B(x, y). To
realize this simulation, we substituted the exact value by a chosen random value
out of a Gaussian distribution rappr , Bappr ∼ N (µexact , σ 2 ). The exact value was
the arithmetic mean and the variance σ 2 was a parameter. We always simulated
with 500 nodes, where 5% were beacons and the rest sensor nodes. We executed
numerous series and averaged the results to avoid a strong influence of outliers.
We created a test field with the size 100 × 100 where all nodes were placed by
a uniform distribution. We determined in all simulations the averaged relative
localization error.
Next, a simulation with noisy distances was executed (see Figure 7). An in-
creasing variance of the Gaussian distribution resulted in an increasing relative
localization error up to 6% at σ 2 = 100. The standard deviation is relatively
small.
Table 1. Performance comparison with floating point numbers and 100 beacons. The
communication effort and the memory capacity in the table refer to the reduced meth-
ods.
3 6
Relative Localization Error [%]
2 4
1.5 3
Fig. 6. Localization error with exact input. Fig. 7. Error with noisy distances.
14 15
12
Relative Localization Error [%]
5
4
0 0
1 10 20 30 40 50 60 70 80 90 100 1 10 20 30 40 50 60 70 80 90 100
Variance Variance
Fig. 8. Error with noisy beacon positions. Fig. 9. Error with complete noisy input.
In more simulation series we studied the error for noisy beacon positions.
This simulation describes the behavior of the algorithm in a slightly dynamic
network, where the beacon positions can change after the precalculations are
already executed and transmitted to the sensor nodes. The sensor nodes would
determine new distances to the beacons but combine them with wrong beacon
coordinates. Figure 8 shows the increasing error that rises over 8% at a variance
of 100. The standard deviation is also higher compared to the previous simu-
lation. Defective beacon positions influences the results strongly, but normally
they are not the main problem. This means that the algorithm is able to manage
slight changes in a dynamic network with an acceptable error.
In a last simulation we increased the variance for both, distances and beacon
positions. Figure 9 shows the result. Here, the highest error occurs, as it was
expected. However, these results show the robustness of the algorithm.
6 Conclusion
We have presented a new method for exact localization in resource-limited sen-
sor networks by distributing the least squares method. Usually the calculation
of this method is very complex with an increasing number of beacons. However,
the use of the linearization tool enables us to split the complex calculation into
a complex part, precalculated on the high-performance base station, and a very
simple subcalculation on every sensor node. With low communication traffic the
base station sends precalculated data to all sensor nodes. Sensor nodes must
only receive data and compute their own position autonomously.
Acknowledgment
This work was supported by the German Research Foundation under grant num-
ber TI254/15-1 and BI467/17-1 (keyword: Geosens). We appreciate comments
given by Edward Nash, which helped us to improve this paper.
References
1. Akyildiz, I.F., Su, W., Sankarasubramaniam, Y., Cayirci, E.: Wireless sensor net-
works: A survey. Computer Networks 38 (2002) 393–422
2. Bill, R., Cap, C., Kohfahl, M., Mund, T.: Indoor and outdoor positioning in mobile
environments a review and some investigations on wlan positioning. Geographic
Information Sciences 10 (2004) 91–98
3. Gibson, J.: The mobile communications handbook. CRC Press (1996)
4. Min, R., Bhardwaj, M., Cho, S., Sinha, A., Shih, E., Wang, A., Chandrakasan, A.:
Low-power wireless sensor networks. In: International Conference on VLSI Design.
(2001) 205–210
5. Savarese, C., Rabaey, J., Langendoen, K.: Robust positioning algorithms for dis-
tributed ad-hoc wireless sensor networks. In: USENIX Technical Annual Confer-
ence. (2002) 317–327
6. Bulusu, N.: Gps-less low cost outdoor localization for very small devices. IEEE
Personal Communications Magazine 7 (2000) 28–34
7. Capkun, S., Hamdi, M., Hubaux, J.P.: Gps-free positioning in mobile ad hoc
networks. Cluster Computing 5 (2002) 157–167
8. Tian, H., Chengdu, H., Brian, B.M., John, S.A., Tarek, A.: Range-free localization
schemes for large scale sensor networks. In: 9th annual international conference on
Mobile computing and networking. (2003) 81–95
9. Blumenthal, J., Reichenbach, F., Timmermann, D.: Precise positioning with a
low complexity algorithm in ad hoc wireless sensor networks. PIK - Praxis der
Informationsverarbeitung und Kommunikation 28 (2005) 80–85
10. Savvides, A., Han, C.C., Srivastava, M.B.: Dynamic fine grained localization in ad-
hoc networks of sensors. In: Seventh Annual ACM/IEEE International Conference
on Mobile Computing and Networking. (2001) 166–179
11. Kwon, Y., Mechitov, K., Sundresh, S., Kim, W., Agha, G.: Resilient localization for
sensor networks in outdoor environments. In: 25th IEEE International Conference
on Distributed Computing Systems. (2005) 643–652
12. Ahmed, A.A., Shi, H., Shang, Y.: Sharp: A new approach to relative localization
in wireless sensor networks. In: Second International Workshop on Wireless Ad
Hoc Networking. (2005) 892–898
13. Karalar, T.C., Yamashita, S., Sheets, M., Rabaey, J.: An integrated, low power
localization system for sensor networks. In: First Annual International Conference
on Mobile and Ubiquitous Systems: Networking and Services. (2004) 24–30
14. Langendoen, K., Reijers, N.: Distributed localization in wireless sensor networks: A
quantitative comparison. Computer Networks (Elsevier), special issue on Wireless
Sensor Networks 43 (2003) 499–518
15. Niemeier, W.: Ausgleichsrechnung. de Gruyter (2002)
16. Murphy, W.S., Hereman, W.: Determination of a position in three dimensions
using trilateration and approximate distances. (1999)
17. Gramlich, G.: Numerische Mathematik mit Matlab - Eine Einführung für Natur-
wissenschaftler und Ingenieure. dpunkt.verlag (2000)
18. Lawson, C.L., Hanson, R.: Solving Least Squares Problems. Englewood Cliffs, NJ:
Prentice-Hall (1974)
19. Golub, G.H., Reinsch, C.: Singular Value Decomposition and Least Square So-
lutions, Linear Algebra, Volume II of Handbook for Automatic Computations.
Springer Verlag (1971)
20. Golub, G.H., Loan, C.F.V.: Matrix Computations. The Johns Hopkins University
Press (1996)
21. Niculescu, D., Nath, B.: Ad hoc positioning system (aps) using aoa. In: Proceedings
of the IEEE Annu. Joint Conf. IEEE Computer and Communications Societies.
(2003) 1734–1743