Skip to main content
. 2020 Feb 14;20(4):1025. doi: 10.3390/s20041025
Algorithm 1 Candidate Set Selection
Input: the packet p broadcasted by ni
Output: CS(ni) //the candidate set of ni for packet forwarding
  • 1:

    CS(ni)=

  • 2:

    for each neighbor node of ni denoted by nj do

  • 3:

    if it has forwarded the packet p then

  • 4:

      drop p

  • 5:

    else

  • 6:

      extract the depth di and ni.void-flag from p

  • 7:

      obtain its own depth dj

  • 8:

      compute Δd=didj

  • 9:

      if (!ni.void-flag and Δd > 0) or (ni.void-flag) then

  • 10:

       CS(ni) = CS(ni) {nj}

  • 11:

       end if

  • 12:

    end if

  • 13:

    end for