# Cooperative Localization Using Distance Measurements for Mobile Nodes
## 2 Multidimensional Scaling Algorithm  
In this section, we briefly introduce the MDS algorithm and the ambiguity problem in an ideal scenario. As stated previously, the goal of MDS is to find a representation of the data that provides a low dimensional map (usually two or three dimensions) of the relative positions of the nodes based on their pairwise distances. If we consider the two-dimensional case where there are \(n\) nodes with their true coordinates denoted by \(\mathbf{\mathcal{S}}_{i}=[x_{i},y_{i}]^{T}\) where \(i=1,\ldots,n\) and \(n\geq 3\). Afterwards, in the noise-free case the distance between nodes \(i\) and \(j\), where \(i,j=1,\ldots,n\) and \(i\
eq j\) is given by \(d_{ij}\). If we assume in the ideal scenario that the nodes are able to measure the true distances between each other so that the pairwise distance between two nodes with coordinates \(\mathbf{\mathcal{S}}_{i}\) and \(\mathbf{\mathcal{S}}_{j}\) is given by  
\[d_{i,j}=\|\mathbf{\mathcal{S}}_{i}-\mathbf{\mathcal{S}}_{j}\|=\sqrt{(\mathbf{\mathcal{S} }_{i}-\mathbf{\mathcal{S}}_{j})^{T}(\mathbf{\mathcal{S}}_{i}-\mathbf{\mathcal{S}}_{j})},\]  
and, furthermore, the squared distance \(d_{ij}^{2}\) can be written as  
\[d_{i,j}^{2}=\mathbf{\mathcal{S}}_{i}^{T}\mathbf{\mathcal{S}}_{i}-2\mathbf{\mathcal{S}}_{i }^{T}\mathbf{\mathcal{S}}_{j}+\mathbf{\mathcal{S}}_{j}^{T}\mathbf{\mathcal{S}}_{j},\]  
then we have the following symmetric Euclidean distance matrix:\[\mathbf{D}=\begin{bmatrix}0&d_{1,2}^{2}&d_{1,3}^{2}&\cdots&d_{2,n}^{2}\\ d_{2,1}^{2}&0&d_{2,3}^{2}&\cdots&d_{2,n}^{2}\\ d_{3,1}^{2}&d_{3,2}^{2}&0&\cdots&d_{3,n}^{2}\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ d_{n,1}^{2}&d_{n,2}^{2}&d_{n,3}^{2}&\cdots&0\end{bmatrix}. \tag{1}\]  
If \(\mathbf{\mathcal{S}}=[\mathbf{\mathcal{S}}_{1},\cdots,\mathbf{\mathcal{S}}_{n}]\) is the collection of all of the node coordinates and \(\psi\) is the diagonal elements of \(\mathbf{\mathcal{S}}^{T}\mathbf{\mathcal{S}}\), i.e.,  
\[\psi=\mathrm{diag}(\mathbf{\mathcal{S}}^{T}\mathbf{\mathcal{S}})=\begin{bmatrix}\mathbf{ \mathsf{s}}_{1}^{T}\mathbf{\mathsf{s}}_{1},\ldots,\mathbf{\mathsf{s}}_{n}^{T}\mathbf{ \mathsf{s}}_{n}\end{bmatrix}^{T},\]  
then we can rewrite \(\mathbf{D}\) as  
\[\mathbf{D}=\psi\mathbf{\mathsf{e}}^{T}-2\mathbf{\mathcal{S}}^{T}\mathbf{\mathcal{S}}+\mathbf{ \mathrm{e}}\psi^{T}, \tag{2}\]  
where \(\mathbf{\mathsf{e}}=[1,\ldots,1]^{T}\) is the vector of ones of length \(n\). Using the centering operation \(\mathbf{H}=\mathbf{I}-\mathbf{\mathsf{e}}\mathbf{\mathsf{e}}^{T}/n\), then we have  
\[-\frac{1}{2}\mathbf{H}\mathbf{D}\mathbf{H}=\mathbf{U}\mathbf{\Lambda}\mathbf{U}^{ T}.\]  
where \(\mathbf{U}\mathbf{\Lambda}\mathbf{U}^{T}\) is the eigendecomposition of the symmetric matrix \(-\frac{1}{2}\mathbf{H}\mathbf{D}\mathbf{H}\). Then we can recover \(\mathbf{\mathcal{S}}\) (up to a translation and orthogonal transformation) via the following formula  
\[\mathbf{\mathcal{S}}^{*}=\mathbf{\Lambda}^{\frac{1}{2}}\mathbf{U}^{T}, \tag{3}\]  
MDS is an efficient algorithm for resolving the relative positions of the nodes [32]. However, as is apparent from the above analysis, in the absence of anchor nodes, MDS can only give relative positions of the nodes, which can include rotation and flip ambiguity. In other words, the result of MDS maintains the relative inter-node distances; however, these calculated locations of the nodes may be flipped and/or rotated versions of the true positions of the nodes. Obviously, when considering navigation of mobile nodes or formation control of the sensor network, incorrect positions of the nodes can lead to problems.