## 4 Distributed Multi-Hop Localization Based on Regularized Extreme Learning
### The Proposed Model  
According to [9], it is clear that in an ideal case \(d\propto\mathbf{w}^{\mathrm{T}}\mathbf{h}\), when each \(S_{i}\in\mathbf{B}\) collects the \(m\) pair of data pairs \(\{\mathbf{h}_{k},d_{i,k}\}_{k=1}^{m}\). Therefore, we assume that the input dimension of ELM is \(m\), and the optimal relationship between the physical distance and the optimal relationship between the physical distance and the hop count can be obtained by minimizing the mean square error, that is:  
\[\min_{\beta}\sum_{i=1}^{m}\left\|\mathbf{c}_{i}\right\|_{2}^{2}=\sum_{i=1}^{m} \left\|\mathbf{d}_{i}-\beta_{i}\mathbf{G}(\mathbf{h}_{i})\right\|_{2}^{2} \tag{7}\]  
where \(\mathbf{d}_{i}=[\mathbf{d}_{i1},\mathbf{d}_{i2},\ldots\,\mathbf{d}_{im}]^{\mathrm{T}}\) is a vector which presents the physical distance between the \(i\)-th anchor node and the remaining \(m-1\) anchor nodes.  
Based on the rule of minimum norm solution (ensure both \(\left\|\mathbf{d}_{i}-\beta_{i}\mathbf{G}(\mathbf{h}_{i})\right\|_{2}^{2}\) and \(\left\|\mathbf{\beta}_{i}\right\|_{2}^{2}\) minimum at the same time), Equation (7) exists a minimal norm least squares solution as follows:  
\[\beta=\mathbf{G}^{\mathrm{T}}\mathbf{D}, \tag{8}\]  
where \(\mathbf{G}^{\mathrm{T}}\) is the augmented inverse of the Moore-Penrose of the hidden layer response matrix and the \(i\)-th column of \(\mathbf{G}\) is the output of the \(i\)-th hidden node with respect to the input hop vector \(\mathbf{h}_{i}\). \(\mathbf{G}^{\mathrm{T}}\) has a variety of calculation methods. In the extreme learning machine, the orthogonal method is often used for the calculation of \(\mathbf{G}^{\mathrm{T}}\): when \(\mathbf{G}^{\mathrm{T}}\mathbf{G}\) is not singular, \(\mathbf{G}^{\mathrm{T}}=(\mathbf{G}^{\mathrm{T}}\mathbf{G})^{-1}\mathbf{G}^{\mathrm{T}}\); when \(\mathbf{G}\mathbf{G}^{\mathrm{T}}\) is not singular, \(\mathbf{G}^{\mathrm{the hops-distance optimal relation model \(\hat{\mathbf{\beta}}\) is obtained, e.g., the feedback of single hidden layer is completed. Finally, the program broadcasts the mapping model to each node in the network through distance vector protocol.  
The model obtained by RELM actually stores the distance feature of all anchor nodes in all directions, so the model can accurately describe the anisotropic relationship between the hop-count and the physical distance of the nodes. Algorithm 1 summarizes the steps of the model building by RELM algorithm.  
```
1. Input: the shortest hop-counts matrix \(\mathbf{H}=[h_{1},\ldots,h_{m}]\); the physical distance matrix \(\mathbf{D}=[\mathbf{d}_{1},\ldots,\mathbf{d}_{m}]\), the count of hidden nodes \(r\).
2. For\(i\) from \(1\) to \(r\)
3. assign input weights \(\mathbf{\omega}_{i}\) randomly;
4. assign hidden layer bias \(b_{i}\) randomly;
5. End
6. For\(i\) from \(1\) to \(m\)
7. calculate the output of hidden layer \(\mathbf{G}(h_{i})\);
8. End
9. Calculate the inverse matrix \(\mathbf{G}^{\intercal}=\left(\mathbf{G}^{\intercal}\mathbf{G}+k\mathbf{I}\right)^{-1}\mathbf{G}^ {\intercal}\).
10. Calculate \(\hat{\mathbf{\beta}}=\mathbf{G}^{\intercal}\mathbf{D}\).
11. Output: the hidden layer weights \(\hat{\mathbf{\beta}}\).
```  
**Algorithm 1**Localization Model Building by RELM.