Skip to main content
. 2017 May 20;17(5):1168. doi: 10.3390/s17051168
Algorithm 3 Equal Price-Basedd Search Method With Coordination SNs Monitor Patrolling Algorithm
  • 1:

    Input: New ID set IiQ, (i=1, 2, ⋯, m) and sequence it in an increasing way.

  • 2:

    Initialization, set the min ID Ii in the waiting expand node list Dk, set the have expanded node list Hk=0.

  • 3:

    Take Ii from Dk and expand Ii to IiIi+1, IiIi+2, ⋯, IiIm, meanwhile record the corresponding distance di,i+1, di,i+2, ⋯, di,m. At last, put IiIi+1di,i+1, IiIi+2di,i+2, ⋯, IiImdi,m into Dk and Ii into Hk, respectively.

  • 4:

    Take minDk continue to expand, i.e., IiIi+2di,i+2 is the minimum node, expand it to IiIi+2di,i+2, ji,ji+2, then update Dk and Hk.

  • 5:

    Continue Step 4 until a new expanded lattice with all of the ID sequence IiIi+1Ii+2Im appeared.

  • 6:

    Set t=0, Ii=0. According to the new ID sequence, assign each ANs to monitor one lattice.

  • 7:

    If there is no ANs monitoring at ID Ii, Set Ii=Ii+1; otherwise Ii=0

  • 8:

    Call algorithm 2.

  • 9:

    t=t+1, If an AN detects an intruder at time slot t1, then it claims itself not busy. Count the total number of not busy ANs n¯, if n¯>0, continue.

  • 10:

    The n¯ ANs are newly selected to monitor lattices with ID Ii=Ii+1.

  • 11:

    Continue Step 6 until all ANs run out of energy.