## 3 Proposed Method
### Iterative Sensor Positioning Algorithm  
This paper proposes an iterative sensor positioning (ISP) algorithm to be used in cooperation with the mobile anchor. The ISP uses the positioned nodes as reference points to reduce the positioning load of the mobile anchor. Reference points for each unknown node can quickly be obtained from position-aware neighboring nodes, instead of needing to obtain every reference point from the mobile anchor. Algorithm 1 presents the pseudocode of the ISP algorithm. Every unknown node exchanges its position information with its neighbors within communication range. When an unknown node receives the beacon signal from the mobile anchor, it reports its neighbors' position information to the mobile anchor. The mobile anchor uses the trilateration method to compute the location of the unknown node. The corresponding pseudocode is in lines 23 to 33 in Algorithm 1. The mobile anchor also records the positions at which each unknown node receives the beacon signal from the mobile anchor for the first time and the last time. The corresponding pseudocode is in lines 35 to 40 in Algorithm 1. There are three possible cases in which the ISP algorithm is able to directly locate the unknown nodes. In the first case, the unknown node \(X\) already has three position-aware neighbors, \(A\), \(B\), and \(C\). In this case, the positions of these neighbor nodes are used to compute the location of the unknown node \(X\) via triangulation, as shown in Figure 2a. The mobile anchor is able to remove the node from the positioning list. The corresponding pseudocode is in lines 2 to 5 in Algorithm 1. In the second case, the unknown node \(X\) has two position-aware neighbor nodes, \(A\) and \(B\). The mobile anchor only has to record one non-collinear reference point \(p\) for \(X\) in this case. Then, the positions \(A\), \(B\), and \(p\) are used to compute the location of \(X\) via triangulation, as shown in Figure 2b. The corresponding pseudocode is in lines 6 to 9 in Algorithm 1. In the third case, the unknown node has just one position-aware neighbor, \(A\). Generally, the mobile anchor has to record two reference points, \(\{p,q\}\), before it applies triangulation to compute the location of \(X\). The corresponding pseudocode is in lines 11 to 14 in Algorithm 1. However, the ISP algorithm adds the following strategy in order to speed up the positioning task. When the mobile anchor moves along the path of the current trajectory, if it detects position-aware neighbor \(A\) before the unknown node \(X\), the mobile anchor is able to directly position the unknown node \(X\) without the use of the second reference point. The corresponding pseudocode is in lines 15 to 22 in Algorithm 1. For example, the mobile anchor \(M\) finds node \(A\) before node \(X\) while it moves right, as shown in Figure 2c. The first time the mobile anchor detects X at \(p\), the position of \(A\) and \(p\) can indicate two possible locations: \(t\), the actual location of \(X\), and a false one, \(f\). Here the mobile anchor can directly identify that t is the actual location, rather than \(f\), because M did not detect node \(X\) before it arrived at the location \(p\). However, if M does not detect the signal of neighbor \(A\) before that of the unknown node \(X\), M will still need to record two reference points. Figure 1: The mobile anchor records the reference points for the unknown node z. ```
**Algorithm 1** The ISP algorithm. ``` \(M\): Mobile anchor. \(R\): Communication range. \(U\): Set of unknown nodes. \(W\): Set of nodes that have been discovered but not positioned. \(D\): Set of positioned nodes. \((g,g^{\prime})\) = IntSecPoints(\(r1\), \(r2\)): Find intersection points \((g,g^{\prime})\) from reference points \(\{r1\), \(r2\)}. \(Lo(x)\) = Trilateration(\(r1\), \(r2\), \(r3\)): Trilateral positioning function uses the reference points \(\{r1\), \(r2\), \(r3\}\) to get the location of node \(x\). \(M_{\text{-pos}}\): The current location of the mobile anchor.