|
Algorithm 3. Our proposed algorithm. |
|
Input:
|
|
Output:
,
|
| 1 randomly select sensor nodes in the network probability , generate
|
| 2 for
|
| 3 query candidate nodes () of projection nodes
|
| 4 initialization ,
|
| 5 while !empty(temp) do
|
| 6
|
| 7 if
is ’s candidate node |
| 8
|
| 9
|
| 10
|
| 11 end if
|
| 12 end while
|
| 13 while !empty() do
|
| 14 for all residual candidate nodes
|
| 15 find a shortest path to using the algorithm |
| 16 if
>
|
| 17
|
| 18 end if
|
| 19 end for
|
| 20
|
| 21
|
| 22
|
| 23 while !empty(temp) do
|
| 24 go back to steps 7–11 |
| 25 end while
|
| 26 end while
|
| 27 Optimal routing from to the sink node using Algorithm 2 |
| 28 return
|
| 29 end for
|