• 沒有找到結果。

Different from the coarse-grain localization, a fine-grain localization determines the position of each sensors. This position may be related to the earth or a virtual coordinate system on the given network. In a localization algorithm, a sensor can acquire its position by two methods: (i) using GPS and (ii) by calculation (for example, using trilateration).

We now give the details of trilateration. In this localization algorithm, a sensor (say, v) computes the number of anchors in N (v). If this number is ≥ 3, then v uses three of the anchors (say, a1, a2, a3) to compute its own position. First use the distances a1v and a2v to construct two possible positions for v. Then use the distance a3v to determine which of the two possible positions of v is correct. Notice that trilateration will fail if the three anchors a1, a2, a3 are collinear. Thus to use trilateration, the given graph has to be a generic graph.

As mentioned in the previous section, in [8], Huang et al. considered the minimum cost localization problem. They proposed an algorithm called sweep. This algorithm first applies trilateration; when no nodes can be further localized, it switches to consider pairs

of sensors u, v such that u, v are neighbors and they can cooperate to obtain their positions.

After no such u, v pairs can be found, the algorithm switches back to trilateration again, and so on. More precisely, when u, v satisfy the following three conditions, they can cooperate to fulfill localization: (i) u and v are neighbors (hence the distance between them is known), (ii) N (u) contains two anchors (say, a1 and a2) and N (v) also contains two anchors (say, a3 and a4), and (iii) |{a1, a2} ∩ {a3, a4}| ≤ 1 (meaning that the anchors used by u cannot be identical to those used by v). It is not difficult to see that if u, v satisfy (ii), then both u and v have two possible positions. If u, v do not satisfy (iii), then there are at least two possible pairs of positions and hence cannot be uniquely localized.

If u, v satisfy (iii), then it is possible that only one pair of positions match the distance between u and v, which can be obtained if u, v satisfy (i).

Some of the algorithms for the localization problem are centralized, while the others are distributed. In centralized algorithms, some nodes have a more powerful computa-tion ability; hence these nodes can gather more informacomputa-tion of the given graph such as the maximum and the average degree of nodes. While in distributed algorithms, all sen-sors have a limited power and computation ability; hence sensen-sors can only gather the information within the vicinity.

In [11], Langendoen and Reijers compared three distributed algorithms that handle the localization problem when there are noises. One of the algorithms uses the bounding box approach to approximate the position of sensors. Another one uses the average distance approach to compute the distance between pairs of sensors, and then use this distance information to compute the position of sensors. The remaining one calculates the distance between anchors and sensors and uses the standard least square method to compute approximate positions; due to the the existence of noise, solutions may not exist.

We briefly describe the difference between algorithms that assume noise-free and al-gorithms that allow the existence of noise. The first difference is that: for the latter

algorithms, the estimated distances may not be accurate due to the existence of noise.

These algorithms have to use the distance information (which may not be accurate) to obtain positions which are closest to the actual positions. The second difference is that:

for the former algorithms, the positions of anchors are only shared with one-hop neigh-bors, but for the latter algorithms, the positions of anchors are shared within two-hop or three-hops or n-hop neighbors for some n. In [13], an n-hop multilateration algorithm al-lowing the existence of noise was proposed and the positions of anchors are shared within n-hop neighbors. Note that there are various methods for estimating the distance between sensors and anchors within n-hop neighbors.

There are three representative algorithms that can localize a graph when there exist noises; see [14, 15, 12]. In [11], Langendoen and Reijers provided a comparison between these three algorithms. As was mentioned before, there are various methods for estimating the distance between sensors and anchors within n-hop neighbors. Each of the algorithms in [14, 15, 12] provides an interesting method to estimate the distance between sensors and anchors within n-hop neighbors. Before ending this subsection, we briefly describe the methods used in [14, 15, 12].

In [14], Savarese et al. proposed a method called DV-hop. In DV-hop, a sensor (say, v) computes the number k of hops between an anchor (say, a) and itself. Then, the distance between v and a is estimated by the average distance for one hop times k.

In [15], Savvides et al. proposed a method and it was called Sum-Dist in [11]. In Sum-Dist, anchors initiate a flood. More precisely, Sum-dist starts its process from the anchors, which send messages including the anchor id, anchor position, and a path length 0. Each sensor that receives the message adds its measured range to the path length. To avoid the flooding of messages, Savvides et al. limited the flooding range. At the end of the above process, most sensors will get several anchors’ positions and several estimated distances.

One drawback of DV-hop is that it fails for highly irregular network topologies, where the variance in actual hop distances is very large. In [12], Niculescu and Nath have proposed another method, called Euclidean, which is based on the local geometry of the nodes around an anchor. Again, anchors initiate a flood, but forwarding the distance is more complicated than [14, 15]. In particular, when a node has received messages from two neighbors that know their distance to the anchor, and to each other, it can calculate the distance to the anchor. We use Figure 4 to describe the method Euclidean. This figure shows a node (i.e., Self) that has two neighbors n1 and n2 with distance estimates (a and b) to an anchor (i.e., Anchor). Note that Self is not a neighbor of Anchor and currently does not have a distance estimate to Anchor. Self and Self’ are actually the two possible positions for the same node. The nodes n1, n2, and Self (or n1, n2, and Self’) form a K3 and therefore the distances c, d, and e are known. In this figure, r1 and r2 denote the distance estimates of Self to Anchor and Self’ to Anchor, respectively. The method Euclidean uses neighbor vote or common neighbor to determine which of r1 and r2 is correct.

Figure 4: An illustration of the Euclidian method; this figure is from [11].

After each node obtains a distance estimate, an algorithm is needed to calculate the

position of each node. We now introduce two algorithms to calculate positions. The two algorithms are called Lateration and Min-max. In Lateration, each distance estimate contributes a constraint; using all the constraints, one can use the standard least square method to obtain an approximate position of a node.

In Min-max, a node (say, v) that needs to be localized will compute a region that it belongs to; this region is actually a rectangle and is called a bounding box. Figure 5 shows that v is localized by using (i) the positions of three anchors (called Anchor1, Anchor2, and Anchor3 in this figure) and (ii) the three estimated distances between Anchor1 and v, Anchor2 and v, and Anchor3 and v. For convenience, denote the three estimated distances as d1, d2, d3, respectively. Let the positions of Anchor1, Anchor2, and Anchor3 be (a1, b1), (a2, b2), and (a3, b3), respectively. Let (x, y) denote the position of v. Then x lies in the intersection of the following three intervals:

[a1 − d1, a1+ d1], [a2 − d2, a2+ d2], [a3− d3, a3+ d3].

The values

minx = max{a1− d1, a2− d2, a3 − d3} and maxx = min{a1+ d1, a2+ d2, a3+ d3} are calculated to bound the x-coordinate of v. Similarly, y lies in the intersection of the following three intervals:

[b1− d1, b1+ d1], [b2 − d2, b2+ d2], [b3− d3, b3 + d3].

The values

miny = max{b1− d1, b2− d2, b3 − d3} and maxy = min{b1+ d1, b2+ d2, b3+ d3} are calculated to bound the y-coordinate of v. The above process also explains why this algorithm called Min-max. After calculating minx, maxx, miny, and maxy, the algorithm chooses (minx+max2 x,miny+max2 y) as the estimated position of v; this is the node labeled “est.

pos.” in Figure 5.

Figure 5: A illustration of the Min-max method; this figure is from [11].

3 The main result

This section gives the main result of this thesis. In particular, an algorithm called Main is proposed; see below. Throughout this section, v.ann denotes the number of anchors in N (v).

Algorithm Main uses the Boolean variable v.localized to indicate whether a node v has been localized. Initially, all nodes v have v.localized = false. Once v is localized, v.localized is set to true. Algorithm Main uses the following theorem to choose its initial-anchor set S; see lines 5-10 in Main.

Theorem 3.1. Let G = (V, E) be a graph that models a given wireless sensor network and S be any feasible initial-anchor set of G. For all v ∈ V with degree deg(v) ≤ 2, we have v ∈ S. In other words, any feasible initial-anchor set must contain all nodes with degree ≤ 2.

Proof. Suppose to the contrary that S is a feasible initial-anchor set and there is a node v 6∈ S such that deg(v) ≤ 2. Since S is feasible, v must be localized. However, if deg(v) = 1, then v has an infinite number of possible positions, which is a contradiction;

Algorithm 1 Main

Require: A wireless sensor network G = (V, E).

Ensure: A localization for G and the initial-anchor set S that is used in the localization.

1: S = ∅;

12: while there exists any u such that (u.localized == false) do

13: v = the result of AnchorChoose-Phase;

14: S = S ∪ {v};

15: run Localization-Phase;

16: end while

if deg(v) = 2, then v has at least two possible positions, which is also a contradiction.

Then, Algorithm Main runs the Localization-Phase; see line 11 and Subsection 3.1.

After the Localization-Phase, if there exits any node which is not localized, then Algorithm Main runs AnchorChoose-Phase to choose a node v as a new initial-anchor and add v to the initial-anchor set S; see lines 13-14 in Main. After v is added to S, Algorithm Main runs Localization-Phase again. Notice that we have proposed an adaptive algorithm for AnchorChoose-Phase and we will give the details in Subsection 3.2. The while-loop in lines 12-16 repeats until all nodes have been localized. When Algorithm Main stops, the initial-anchor set S is feasible.

3.1 Localization-Phase

Notice that the Localization-Phase can be implemented in many ways. In this thesis, we give three localization algorithms (called Trilateration, Sweep2, and Rigid) and each of them can be used in the Localization-Phase.

3.1.1 Trilateration

The pseudocode of Trilateration is as follows.

Algorithm 2 Trilateration

Require: A wireless sensor network G = (V, E).

Ensure: G with those nodes of it that can be localized by trilateration.

1: for each v ∈ V such that (v.localized == false) do

2: compute v.ann;

3: end for

4: for each v ∈ V such that (v.localized == false) do

5: if v.ann ≥ 3 then

6: use three anchors in N (v) to determine the position of v;

7: v.localized = true;

8: run Trilateration;

9: end if

10: end for

3.1.2 Sweep2

We have mentioned the algorithm sweep that was proposed in [8] in Subsection2.3.

In [8], algorithm sweep is implemented by either Greedy-Sweep-1 or Greedy-Sweep-2; thus there are two cases. Notice that Greedy-Sweep-2 actually contains all the statements in Greedy-Sweep-1. We find that it is unnecessary to have both Greedy-Sweep-1 and Greedy-Sweep-2. Therefore, in this thesis, we modify algorithm sweep and propose a new algorithm called Sweep2. Our algorithm Sweep2 is more general and it does not need to distinguish between the two cases in sweep. Similar to Trilateration, algorithm Sweep2 will compute the number of anchors in a node’s neighborhood. If there are two neighboring nodes u, v such that both u.annandv.ann equal to 2, then it is possible to localize u, v at once. Let the two possible positions for u be u1, u2 and the two possible positions for v be v1, v2. Then algorithm Sweep2 can check if only one of the four distances u1v1, u1v2, u2v1, and u2v2 equals to the distance uv. If this is true, then u, v can be localized at once.

The pseudocode is now given below.

Algorithm 3 Sweep2

8: if (u.ann == 2) and (u.localized == false) then

9: compute the two possible positions for u and denote them as u1, u2;

10: compute the two possible positions for v and denote them as v1, v2;

11: compute the distances u1v1, u1v2, u2v1, u2v2, and uv;

12: if ∃! distance (say, uivj) in {u1v1, u1v2, u2v1, u2v2} equals to uv then

13: use the distances uivj and uv to determine the positions of u, v;

14: u.localized = v.localized = true;

In Sweep2, two nodes u, v each has only two anchors in their neighborhood but u, v try to cooperate to obtain their positions. The idea of Sweep2 can be generalized to obtain Sweep3, Sweep4, . . ., Sweepk. In general, Sweepk means k nodes try to cooperate to obtain their positions.

3.1.3 Rigidity

In this subsubsection, we propose a localization algorithm based on the rigidity theory;

call this algorithm Rigidity. When algorithm Main runs, all nodes with degree ≤ 2 will be added into the initial-anchor set. Suppose Main uses Rigidity in its Localization-Phase.

Then, each initial-anchor broadcasts a “Hello” message to all of its neighbors. Each node v (including the anchors) that receives a “Hello” message run the algorithm Trilateration at first and then uses C-Algorithm to find a rigid sub-graph H in N [v] if there exists a such graph. Algorithm Rigidity computes the position of a node by a method similar to

the one used in Sweepk. This solution will be unique since the subgraph H is globally rigid. The pseudocode of algorithm Rigidity is as follows.

Algorithm 4 Rigid

1: for each v ∈ V do

2: if v.localized == true then

3: v broadcasts a “Hello” message to all of its neighbors;

4: end if

5: end for

6: for each v ∈ V which receives the “Hello” message do

7: run Trilateration;

8: use C-Algorithm to find a globally rigid graph in N [v], containing at least non-anchor node, say this graph as H;

9: if there exists three anchors in H then

10: use the Sweepk to localize each u ∈ H;

11: for each u ∈ H and u.localized == false do

12: u.localized = true;

13: broadcast a “Hello” message to all of its neighbors;

14: end for

15: end if

16: end for

Figure 6 shows how Rigid algorithm works. First, u finds there are three anchors in N (u) and uses Trilateration to localize itself (see Figure 6(a) and (b)). Then, u will determine whether N [u] contains a globally rigid graph with at least one non-anchor node.

Rigid finds there exists a wheel graph which is globally rigid in N [v] and computes the position of each node. Finally, all nodes of the wheel graph are localized (see Figure 6(c)).

相關文件