Research Article

Toward Performant and Energy-Efficient Network Queries: A Parallel and Stateless Approach

Algorithm 2

Topology construction for sensor nodes.
Input: The basic information of storage node and its children sensor nodes
1: Storage node’s range is partitioned into k sectors
2: Storage node sends initialization messages
3: Sensor nodes retrieve the message
4: Sensor nodes check
5: Sensor nodes calculate distances toward the storage node
6: Storage node’s range is layered by square grids
7: Sensor nodes in the same sector send hello messages
8: Sensor nodes in the same sector are identified w.r.t. distances
9: Calculate the overlap count of each grid
10: while True do
11:  for All sensor nodes do IN PARALLEL
12:   if All covered grids have overlap count > 1 then
13:    Sensor node hibernates
14:    Decrement overlap count
15:   else if Receive replacement request then
16:    if Overlap count = = 0 then
17:    Sensor node wakes up
18:    Increment overlap count
19:    end if
20:  end if
21:  end for
22: end while
Output: All sensor nodes are topologically complete and have unique three-dimensional coordinates.