Skip to main content
. 2019 Sep 20;19(19):4072. doi: 10.3390/s19194072
Algorithm 1 Pseudocode for the bifurcation decision process at an intermediate node i
  • 1:

    Input: Preq ← required packet delivery ratio, ki ← the number of neighbors

  • 2:

    Output: n ← the number of paths(default = 1)

  • 3:

  • 4:

    P(ki,1)=1(1P1)(1P2)(1Pki)       ▹ link reliability by opportunistic routing

  • 5:

    Nhop = Dist(i,destination)r       ▹ expected hop-count from itself to the destination

  • 6:

    Pexp = (P(k,1))Nhop                   ▹ expected packet delivery ratio

  • 7:

  • 8:

    ifPexp>Preqthen               ▹ bifurcation do not require

  • 9:

        return n

  • 10:

    end if

  • 11:

  • 12:

    whilePexp<Preqdo               ▹ bifurcation required

  • 13:

        n = n+1

  • 14:

        Pexp = (P(ki,n))Nhop     ▹Pexp when n of ki nodes is selected by opportunistic routing

  • 15:

    end while

  • 16:

  • 17:

    return n