# Efficient Distributed Method for NLOS Cooperative Localization in WSNs
## 3 Distributed Framework
\begin{split}\min&\left[\sum_{j=1}^{\tilde{\mathbf{ \lambda}}_{i}}\frac{1}{2}\text{dist}^{2}((\mathbf{z}_{i})_{1}-(\mathbf{z}_{i})_{j},C_{i,j})+\frac{1}{2}c\gamma_{i}\right]\\ \text{s.t.}&\|\mathbf{z}_{i}-\mathbf{A}_{i}\mathbf{x}^{t}+\tilde {\mathbf{\lambda}}_{i}^{t}\|^{2}\leq\gamma_{i}\\ &\gamma_{i}\geq 0\\ &\mathbf{z}_{i}\in\mathcal{R}_{\mathbf{z}_{i}}\end{split}  \tag{23}\]  
where \(\gamma_{i}\) are the slack variables working as the quadratic penalty in the local cost function. Obviously, Problem (23) is untypically convex. The gradient of \(F_{i}(\mathbf{z}_{i})\) is discontinuous. Hence, classical methods such as the interior point method and the Newton method are not appropriate to solve these problems. In Section 4, we further derive an iterative algorithm to approach the solution of Problem (23). This iterative algorithm has the same convergence rate with the interior point method. (3) Broadcast local variables \(\mathbf{z}_{i}^{t+1}\) to all nodes of neighbor sets. (4) Each node computes variables \(\tilde{\mathbf{x}}_{i}^{t+1}\) according to  
\[\mathbf{x}^{t+1}\in\underset{\mathbf{x}}{\text{argmin}}\left(\sum_{i}\frac{1}{2}c\|\bm {z}_{i}^{t+1}-\mathbf{A}_{i}\mathbf{x}+\tilde{\mathbf{\lambda}}_{i}^{t}\|^{2}\right) \tag{24}\]  
Problem (24) is actually easy to solve by averaging all components of \(\tilde{\mathbf{z}}_{i}^{k+1}\) of which the local indices correspond to global index \(l\). The \(\mathbf{x}\)-update step has a simpler solution:  
\[\mathbf{x}_{l}^{t+1}=\frac{1}{k_{l}}\bigg{(}(\mathbf{z}_{i})_{1}^{t+1}+\sum_{(i,j)\in \mathcal{Z}_{\mathbf{z}_{l}}}(\mathbf{z}_{i})_{j}^{t+1}\bigg{)} \tag{25}\]  
where \(k_{l}\) is the number of local variable components corresponding to global components \(\mathbf{z}_{l}\) and \(\mathcal{Z}_{\mathbf{x}_{l}}=\{(i,j)|\mathbf{N}_{i}(j-1)=l\}\). (5) Each node updates dual variables \(\tilde{\mathbf{\lambda}}_{i}^{t+1}\) according to  
\[\tilde{\mathbf{\lambda}}_{i}^{t+1}\in\tilde{\mathbf{\lambda}}_{i}^{t}+c(\mathbf{z}_{i}^{t+ 1}-\mathbf{A}_{i}\mathbf{x}^{t+1}) \tag{26}\]A summary of the proposed parallel algorithm is illustrated as Algorithm 1 and Figure 2:  
```
Input: number of anchors \(M\), location of anchors \(\mathbf{x}_{k}\in\mathbb{R}^{2},k\in\mathcal{A}\), number of source sensors \(N\), range measurements \(\{r_{i,j},(i,j)\in\mathcal{Z}_{\text{NLOS}}\cup\mathcal{Z}_{\text{LOS}}\}\) ; Output:\((\mathbf{z}_{i})_{1},i\in\mathcal{S}\)  1.Initialization: \(t=0\);  (1)Initialize local location of sensors \(\mathbf{x}^{0}\) and set dual variables \(\mathbf{\lambda}^{0}_{i}\) to zero;  (2) According to \(\mathbf{x}^{0}_{i}\) and \(\mathbf{\lambda}^{0}_{i}\), compute the initial values: \[\mathbf{z}^{0}_{i}=\mathbf{A}_{i}\mathbf{x}^{0}\]
2. Updating iteration: \(t++\)  (1) Update local location variables \(\mathbf{z}^{t}_{i}\) at each node: \(\forall i\in\mathcal{A}\cup\mathcal{S}\)  \[\mathbf{z}^{t+1}_{i}\in\underset{\mathbf{z}_{i}}{\operatorname{argmin}}\left[F_{i}( \mathbf{z}_{i})+G_{z_{i}}(\mathbf{z}_{i})+\frac{1}{2}c\|\mathbf{z}_{i}-\mathbf{A}_{i}\mathbf{x}^{t }+\bar{\mathbf{\lambda}}^{t}_{i}\|^{2}\right]\]  (2) Broadcast local variable \(\mathbf{z}^{t+1}_{i}\) to its neighbors \(\mathcal{N}_{i}\);  (3) Update variable \(\mathbf{x}\) according to Problem (25);  (4) Update the local dual variable \(\bar{\mathbf{\lambda}}^{t+1}_{i}\) according to Problem (26). ```  
**Algorithm 1** ADMM_Projection (ADMM_P) algorithm for Problem (18).