## 2 Algorithm
### Localization Using Spring-Relaxation Technique  
To explain the concept of spring-relaxation technique for the localization, we consider a simple example that consists of five beacons and a sensor whose location is to be determined. In the concept of spring-relaxation technique, the considered example is equivalent to having a moving particle (_i.e._, sensor) attaching with five springs. For each spring, while its one end attaches to the particle, its another end is nailed by a pin (_i.e._, beacon) at a fixed location. Figure 1 depicts the described example. In the illustration, the black rings are the beacons or the pins in fixed locations, and white ring is the sensor or the particle in its initial guessed location. The natural length of a spring is the length where the spring is in the rest state. When the length of a spring becomes shorter (resp. longer) than its natural length, the spring is compressed (resp. stretched) and forces are produced at each end of the spring. The particle attached to a set of springs receives forces from them when they are compressed or stretched. The net force applies on the particle is the vector sum of all received forces. When the particle begins at a particular location with nonzero net force, the net force moves the particle to a new location and the net force changes accordingly. The particle continues to move until the net force becomes zero, and the particle comes to rest. This resting location, indicated by the grey ring in Figure 1, is also the final stopping location of the particle. Localization using spring-relaxation technique does not have real springs connecting the particles and pins. It uses the concept to simulate the movements of the particle under the spring forces computed, and find the final stopping location, which is the estimated location of the particle. From [PERSON]'s law, the magnitude of the force \(F\) from each spring is  
\[F=k(L_{0}-L) \tag{1}\]  
where \(L_{0}\) is the natural length of the spring, \(L\) is the current length of the spring, and \(k\) is the spring constant. The difference which \(L_{0}-L\) describes is the stretch or compression of the spring. Let \(\overrightarrow{F}\) be the force vector applied on a particle by a spring, and \(\overrightarrow{F_{net}}=\sum\overrightarrow{F}\) be the net force applying on the particle by all the attached springs. By [PERSON]'s first and second law, we have the relationship  
\[\overrightarrow{F_{net}}=\frac{d(m\overrightarrow{v})}{dt} \tag{2}\]  
Figure 1: The simple example of five beacons and a sensor. where \(m\) is the mass of the particle and \(\overrightarrow{v}\) is the instantaneous velocity of the particle due to the net force. The instantaneous displacement of the particle can be determined by  
\[\overrightarrow{D}=\int\overrightarrow{v}dt=\int\int\frac{\overrightarrow{F_{ net}}}{m}dt^{2}. \tag{3}\]  
The instantaneous displacement will cause a change in force applied by each spring on the particle. This change in force leads to a new net force on the particle which then changes the instantaneous displacement of the particle again. As this process continues, the particle moves and will eventually rest at an equilibrium location where the net force is zero. Localization using spring-relaxation technique mimics the behavior of the spring network for the computation of the estimated location. Equations (1)-(2) can be realized similarly in localization. Equation (3) describes that the net force determines the displacement. To ease the computation in (3), the relationship between a force and a displacement can be simplified. AFL uses a simple linear relationship to compute the displacement from a force [15], where in its algorithm, the net force determines the displacement directly. We follow this design principle for our solution. We will now describe the realization of (1)-(3) in our solution more precisely.