Euclidean distance matrix


In mathematics, a Euclidean distance matrix is an matrix representing the spacing of a set of points in Euclidean space.
For points in -dimensional space, the elements of their Euclidean distance matrix are given by squares of distances between them.
That is
where denotes the Euclidean norm on.
In the context of distance matrices, the entries are usually defined directly as distances, not their squares.
However, in the Euclidean case, squares of distances are used to avoid computing square roots and to simplify relevant theorems and algorithms.
Euclidean distance matrices are closely related to Gram matrices.
The latter are easily analyzed using methods of linear algebra.
This allows to characterize Euclidean distance matrices and recover the points that realize it.
A realization, if it exists, is unique up to rigid transformations, i.e. distance-preserving transformations of Euclidean space.
In practical applications, distances are noisy measurements or come from arbitrary dissimilarity estimates.
The goal may be to visualize such data by points in Euclidean space whose distance matrix approximates a given dissimilarity matrix as well as possible — this is known as multidimensional scaling.
Alternatively, given two sets of data already represented by points in Euclidean space, one may ask how similar they are in shape, that is, how closely can they be related by a distance-preserving transformation — this is Procrustes analysis.
Some of the distances may also be missing or come unlabelled, leading to more complex algorithmic tasks, such as the graph realization problem or the turnpike problem.

Properties

By the fact that Euclidean distance is a metric, the matrix has the following properties.
In dimension, a Euclidean distance matrix has rank less than or equal to. If the points are in general position, the rank is exactly
Distances can be shrunk by any power to obtain another Euclidean distance matrix. That is, if is an Euclidean distance matrix, then is an Euclidean distance matrix for every.

Relation to Gram matrix

The Gram matrix of a sequence of points in -dimensional space
is the matrix of their dot products :
In particular
Thus the Gram matrix describes norms and angles of vectors .
Let be the matrix containing as columns.
Then
Matrices that can be decomposed as, that is, Gram matrices of some sequence of vectors, are well understood — these are precisely positive semidefinite matrices.
To relate the Euclidean distance matrix to the Gram matrix, observe that
That is, the norms and angles determine the distances.
Note that the Gram matrix contains additional information: distances from 0.
Conversely, distances between pairs of points determine dot products between vectors :
.

Characterizations

For a matrix, a sequence of points in -dimensional Euclidean space
is called a realization of in if is their Euclidean distance matrix.
One can assume without loss of generality that .
This follows from the previous discussion because is positive semidefinite of rank at most if and only if it can be decomposed as where is an matrix.
Moreover, the columns of give a realization in.
Therefore, any method to decompose allows to find a realization.
The two main approaches are variants of Cholesky decomposition or using spectral decompositions to find the principal square root of, see Definite matrix#Decomposition.
The statement of theorem distinguishes the first point. A more symmetric variant of the same theorem is the following:
Other characterizations involve Cayley–Menger determinants.
In particular, these allow to show that a symmetric hollow matrix is realizable in if and only if every principal submatrix is.
In other words, a semimetric on finitely many points is embedabble isometrically in if and only if every points are.
In practice, the definiteness or rank conditions may fail due to numerical errors, noise in measurements, or due to the data not coming from actual Euclidean distances.
Points that realize optimally similar distances can then be found by semidefinite approximation using linear algebraic tools such as singular value decomposition or semidefinite programming.
This is known as multidimensional scaling.
Variants of these methods can also deal with incomplete distance data.
Unlabeled data, that is, a set or multiset of distances not assigned to particular pairs, is much more difficult to deal with.
Such data arises, for example, in DNA sequencing or phase retrieval.
Two sets of points are called homometric if they have the same multiset of distances.
Deciding whether a given multiset of distances can be realized in a given dimension is strongly NP-hard.
In one dimension this is known as the turnpike problem; it is an open question whether it can be solved in polynomial time.
When the multiset of distances is given with error bars, even the one dimensional case is NP-hard.
Nevertheless, practical algorithms exist for many cases, e.g. random points.

Uniqueness of representations

Given a Euclidean distance matrix, the sequence of points that realize it is unique up to rigid transformations – these are isometries of Euclidean space: rotations, reflections, translations, and their compositions.
Rigid transformations preserve distances so one direction is clear.
Suppose the distances and are equal.
Without loss of generality we can assume by translating the points by and, respectively.
Then the Gram matrix of remaining vectors is identical to the Gram matrix of vectors .
That is,, where and are the matrices containing the respective vectors as columns.
This implies there exists an orthogonal matrix such that, see Definite symmetric matrix#Uniqueness up to unitary transformations.
describes an orthogonal transformation of which maps to .
The final rigid transformation is described by.
In applications, when distances don't match exactly, Procrustes analysis aims to relate two point sets as close as possible via rigid transformations, usually using singular value decomposition.
The ordinary Euclidean case is known as the orthogonal Procrustes problem or Wahba's problem.
Examples of applications include determining orientations of satellites, comparing molecule structure, protein structure, or bone structure.