Skip to main content
. 2020 Jul 13;20(14):3887. doi: 10.3390/s20143887
Algorithm 2. Forwarder_Node_Selection (S = Source, D = Destination)
//when any node S wants to send a packet toward D and it has already constructed a forwarder list, it will follow this algorithm.
Notations
FL(S): Forwarder List of source node S
Ri: ith node in the forwarder list
PRR: Packet Reception Ratio)
RE: Residual Energy
D: Distance
P: Probability
ArrProb[Ri]: Array to store probability of a given node
Pmax: Maximum probability
D: Destination/Target
Input
  R: R is set of nodes in the forwarder list (FL) i.e., R = {R1, R2, …, Rn}
Process
  START
  1. Let R1, R2, …, Rn are the nodes in the FL of source node S. Each node Ri∈ FL(S) where i = 1, 2, …, n

  2. Declare three float variables X1, X2, and X3 to represent the properties of Ri, i.e., PRR (Packet Reception Ratio), RE (Residual Energy), and D (distance), respectively.

  3. For each node Ri∈ FL(S) repeat

    Compute P(Ri|S)//Probability of selection of Ri given S, i.e.,

    Pk = P(Ri|S) for i = 1, 2 …, n and Assign k←i

  4. Compute the probability of P(Ri|S) by computing the probability of each parameter separately, given S.
    Pk=P(Ri|S)=P(RiX1|S)P(RiX2|S)P(RiX3|S)
    where,
    P(RiX1|S)=P(S|RiX1)P(RiX1)P(S)
    P(RiX2|S)=P(S|RiX2)P(RiX2)P(S)
    P(RiX3|S)=P(S|RiX3)P(RiX3)P(S)
  5. Make an unsorted array of probability values of n nodes, i.e., R1, R2, …, Rn from step 6.

    For i = 1 to n and k = i, ArrProb[Ri]←Pk//To find the node with maximum probability.

  6. Select the first node of the array ArrProb[0] as the node with maximum value Pmax i.e., Pmax←ArrProb[0]

  7. Go through the rest of the elements of the array, i.e., from the 2nd element to the last (n − 1)

    element, for i = 1 to n − 1.

  8. For i = 1 to n − 1, if any value in the array ArrProb[i] is found to be greater than the current value Pmax. i.e.,

    if ArrProb[i] > Pmax then, Pmax← ArrProb[i]

  9. When the end of the array is reached, then the current value of the Pmax is the greatest value in the array, Pmax←ArrProb[i].

  10. The node Ri with Pmax value is selected as a relay node from the forwarder list, as

    the node with the highest probability. The node with the next highest probability acts as a relay node in case the first selected relay node fails to broadcast.

  11. Broadcast transmission of the data packet as {Ri, coordinates, data}

  12. Destination node D is reached, if Yes, go to step 15. Else, apply Algorithm 1 on Ri

    S←Ri and go to step 2.

  13. END

Output: A potential forwarder node is selected from the list of forwarder nodes.