• No results found

Multiple Sources – Single Sink Problem

5.2 Counting-Paths

5.2.2 Multiple Sources – Single Sink Problem

Multi-hop WSNs are often characterised by many-to-one (convergecast) traffic pat- terns, where many sources report data to a sink or a base station. In this kind of topology, we need to find whether all sources have k disjoint paths to the sink, so we need to use Counting-Paths repeatedly. If the network has n sources, we need to execute Counting-Paths n times which increases the worst time complexity to O(|V ||E|k). However, if we do not need to know the complete routing paths during the deployment process, it is not necessary for us to discover the actual paths, but only the number of disjoint paths and the neighbours that have k disjoint paths. This local information is used by nodes to forward their data to the nearest neigh- bours and the neighbours will decide where to forward them further. This motivates the dynamic programming variant of Counting-Paths, where we start counting the paths from sensor nodes closer to the sink.

In finding k shortest disjoint paths for the multiple sources – single sink problem, given a graph G = (V, E), we check if a source s ∈ V has k disjoint paths to a destination t ∈ V , t 6= s, by finding the k shortest disjoint paths, if they exist, from s to t or v, where v ∈ V and v has k disjoint paths. Below, we prove the result that justifies our dynamic programming approach.

Lemma 5.1. Let v be a vertex which has vertex-disjoint paths to a subset W of k vertices none of which have a cutset of size < k. Then v has no cutset of size < k.

Proof. Suppose v does have a cutset, C, of size < k. A set of size < k can break at most k −1 of the paths from v to W . Let w ∈ W be any of the vertices whose

Algorithm 6: Counting-Paths-DP Input : G, S, t, k

Output: Pi,j, ∀i=1,. . ., |S|, ∀j =1,. . ., k 1: T ←{t}

2: for i←1 to |S| do 3: for j ←1 to k do 4: if j >1 then

5: Split vertices on the shortest paths except si∈ S and r ∈T 6: Modify the residual network Gres

7: Replace external edges connected to the vertices on the shortest paths except si∈ S and r ∈T

8: end if

9: if there exists a path Pi,j from si∈ S to r ∈T in Gres then 10: Push flow along Pi,j towards r

11: end if 12: if j >1 then

13: Remove overlapping edges 14: end if

15: end for

16: if si∈ S has k disjoint paths then 17: T ← T ∪{si}

18: end if 19: end for

20: return Pi,j, ∀i=1,. . ., |S|, ∀j =1,. . ., k

paths from v are not broken by C, and so v is still connected to w. But w must be connected to S, since w has no cutset of size < k. Therefore v is still connected to S. Therefore C is not a cutset for v. Contradiction.

As a corollary, if a vertex v has vertex-disjoint paths to k vertices, each of which has k vertex-disjoint paths to the sink, then v must also have k vertex-disjoint paths to

the sink.1

In the dynamic programming variant of Counting-Paths, we start finding the k disjoint paths from vertices closer to the sink. For each vertex, if we can find k vertices that have k disjoint paths, we do not need to find the k disjoint paths to the sink and we can proceed to the next one. The algorithm for the dynamic programming variant of Counting-Paths is given in Algorithm 6. It takes as input 1We have not proven that the dynamic programming variant of Counting-Paths guarantees the length-bound, but in all problems that we tested in simulation it does obey the length-bound.

a graph G, a set S of source vertices, a destination t, and the number of disjoint paths sought k. T represents a collection of destination vertices, which are the sink and the vertices which have k disjoint paths to the sink. Note that line 3 to 15 are similar to Algorithm 5, but the shortest path may terminate at any vertices in T . In the multiple sources – single sink problem, we vary the heuristic techniques to pick which vertex is examined first. Here are the heuristic techniques that we use:

1. Breadth first search with the smallest vertex’s ID to break ties. We find the k disjoint paths from vertices which are closer to the sink first, so an m-hop vertex can use the information from its neighbours which are (m−1)- hop away from the sink. There must be several vertices with the same hop distances to the sink. In this case, we pick the one with the smallest ID. 2. Breadth first search with the highest vertex’s degree to break ties.

The same as the previous technique, but we choose the one with the highest degree if there are ties. If there still exists more than one vertex, we pick the one with the smallest ID.

3. Breadth first search with the most processed neighbours to break ties. Similar to the previous two, however, we select the one which has the most neighbours that have already known that they have k disjoint paths. If there are still ties, we choose the one with the smallest ID.

4. Best first search with the most processed neighbours to break ties. In this technique, we select a vertex which has the most neighbours with k disjoint paths. If there are ties, we take the one closer to the sink, i.e. the vertex with shorter hop count to the sink. But if there still exist several vertices that satisfy these two conditions, we choose the one with the smallest ID.

We will evaluate the contributions of these four heuristic techniques to the perfor- mance of the dynamic programming variant of Counting-Paths later in Section 5.3.2.

5.2.3

Single Source – Multiple Sinks and Multiple Sources