Skip to main content
. 2019 Jan 17;19(2):376. doi: 10.3390/s19020376
Algorithm 1 Proposed Localization Algorithm
  • 1:

    procedure Anchor nodes aj and unknown nodes ui

  • 2:

        Initialize {A}={a1,a2,,am} and {U}={u1,u2,,un} and dominating set D=

  • 3:

        for Broadcast by anchor node aj do

  • 4:

            Send NDP:{A_addr,Leash_C=1,Seq,Accept_S=0}

  • 5:

        end for

  • 6:

        for On receiving, node ui computes do

  • 7:

            Leash_C = Leash_C - 1;

  • 8:

            Accept_S = 1;

  • 9:

            Send RPNS:{A_addr,Leash_C,Seq,Accept_S=1,U_addr}

  • 10:

        end for

  • 11:

        if Leash_C==0&&Accept_S==1 then

  • 12:

            Create NSL

  • 13:

            ajBS:NSL={A_addr|U_addr1,U_addr2,}

  • 14:

        else

  • 15:

            exit

  • 16:

        end if

  • 17:

        BS performs:

  • 18:

        while True do

  • 19:

            if ui(N(aj)&&|D|3) then

  • 20:

               Break while loop;

  • 21:

            else

  • 22:

               Calculate the maximum degree anchor nodes amax

  • 23:

               D=Damax

  • 24:

            end if

  • 25:

        end while

  • 26:

        m=|D|

  • 27:

        for k = 1 to m’ do

  • 28:

            BS creates binary vector j,j=1,2,,m

  • 29:

            Apply VBSO algorithm

  • 30:

            Apply Trilateration

  • 31:

        end for

  • 32:

    end procedure