## 3 LoRa and Localization Algorithms
### Localization Algorithm
#### (a) Range-free localization algorithms  
These algorithms determine the location of an unknown deployed sensor node [9]. Range-free methods utilize radio connectivity to communicate between nodes to identify their location. In range-free schemes, the angle of arrival (AOA), specific hardware, and distance measurement is not considered [31]. Range-free schemes comprise the centroid system, distance vector (DV) hop, approximate point in triangulation (APIT), and hop terrain, described as follows:  
Figure 2: Classification of localization schemes for sensor networks. DV--hop localization:
* In DV hop, the distance between the nodes is estimated using hop count, and the hop count of at least three anchor nodes is distributed across the network [32]. The hop count of a node is incremented by one when the neighbor node transmits the information to another neighbor node. The hop distance is evaluated as the distance between two nodes/number of hops. * Centroid localization: This is the most basic scheme that uses anchor beacons, containing location information (\(X_{i}\), \(Y_{i}\)) [31], where n is the number of the anchor nodes Ai. \[(X,Y)=\left(\frac{\sum_{i=1}^{n}x_{i}}{n},\frac{\sum_{i=1}^{n}Y_{i}}{\text{n}}\right)\] (5)
* APIT: In APIT, the location information is obtained by anchor nodes through a global positioning system (GPS) and the unlocalized node receives the location information via overlapped triangles [33]. * Gradient: In the gradient algorithm, the unlocalized node utilizes the multilateration method to estimate the position of nodes. Moreover, it utilizes hop counting and the hop increment while being distributed to neighboring nodes. * _Range-based localization algorithms_ Range-based localization is based on angle estimation and distance estimation. The main techniques in this form of localization are time of arrival (ToA), angle of arrival (AoA), time difference of arrival (TDoA), and received signal strength indication (RSSI):
* ToA localization: This localization algorithm refers to the time of arrival, i.e., ToA, which refers to the time taken for the signal to travel from the sending node to the receiving node [34]. The distance is measured using roundtrip-time of flight (RTOF) to determine the distance between two nodes and is represented in Equation (6) as: \[d=\frac{\left[(T3-T0)+(T2-T1)\right]\times\ V}{2}\] (6) Sensor coordinates (\(x_{1}\),\(y_{1}\)), (\(x_{2}\),\(y_{2}\)), (\(x_{3}\),\(y_{3}\)), and (\(x_{4}\),\(y_{4}\)) determined using the response information and the TOA-based distance measurement method can be used to obtain the distances between them and the moving node S as \(d_{1}\),\(d_{2}\),\(d_{3}\), and \(d_{4}\), respectively. Given the coordinates of the moving node S, (\(x,y\)), the following equation can be used to calculate the location coordinates of the moving node: \[d_{i}=\sqrt{\left(x-x_{i}\right)^{2}+\left(y-y_{i}\right)^{2}}\] (7) where \(i=1\), \(2\), \(3\), \(4\). * AODV localization: AODV is the routing protocol based on the distance-vector algorithm, which integrates the target serial number of DSDV and the on-demand routing discovery in DSR [35]. This protocol mainly includes routing discovery and routing maintenance, where the former is only requested to save the overdue routing. * AOA: The location of an unlocalized node is estimated through the angles at the points at which the anchor signals are obtained [36; 37]. Here the unlocalized nodes implement a triangulation procedure for estimating the location. * RSSI: In this method, the estimation of the distance between receiver and transmitter is obtained by evaluating the signal strength at the receiver [38; 39]. The power of the signal decreases when the distance between receiver and transmitter decreases.