Research Article

Hybrid Recovery Strategy Based on Random Terrain in Wireless Sensor Networks

Algorithm 5

Distributed HRSRT.
Input: A set of disjoint segments, .
Output: A data collection circuit .
for each   do
  randomly choose a sensor as the representative
  sends a mobile agent to locate s, where
  calculate the coordinate of the of  
end for
repeat
   place a toward the and let this as a new to represent
  if there are   s that meet each other, then
   they merge as one and choose the closest to other as the representative
  end if
  Update the list of disjoint segments
until (All RNs assigned to each are populated.)
for each pair of remaining disjoint segments and   do
  calculate and store it in the database in increasing order
end for
while   is not a circuit do
  Get the first element in .
  if   does not form a cycle, unless it completes the circuit    then
   add to
  end if
end while
 Return .