Skip to main content
. 2021 Jun 17;21(12):4152. doi: 10.3390/s21124152
Algorithm 1 Improved recursive DV-Hop algorithm.

Input: WSN; Anchor nodes with their positions (xi, yi) where i=1n, n is the total number of anchors;

Output: Estimated position X of unknown node

1: Begin

2: X0=0; /* initialization

3: P0=α*I; /* initialize the covariance matrix P

4: S= set of reachable anchor nodes, where unknown node can communicate with them

5: For (k=0 to Nbiter) Do

      5.1: Selection of randomly three different anchors from S

      5.2: Computation of RSSI values between unknown node and its neighbors

      5.3: Estimation of distance between anchors and unknown node using

      the polynomial approximation and the RSSI technique Equation (8)

      5.4: Computation of Ak and Bk based on estimated distance using Trilateration, and the covariance matrix Pk Equation (11)

      5.5: Estimation of unknown node position Xk using Recursive Least Square method Equation (12)

6: end For;

7: X=XNbiter /* Final estimated position of unknown node

8: end;