---
tag: 668HBS6C06
kind: definition
name: Euclidean distance matrix
msc: [51K05, 15B48]
defines: 1BCJ7A73KS
uses: [0C95TG69SG]
sources:
  - url: https://en.wikipedia.org/wiki/Euclidean_distance_matrix
---

## Definition

Let $n \ge 1$.
Let $D = (d_{ij})$ be a real $n \times n$ matrix.
It is a *Euclidean distance matrix* if some integer $k \ge 1$ and points $x_1, \ldots, x_n \in \R^k$ satisfy
$$d_{ij} = \norm{x_i - x_j}^2 \quad \text{for all } i, j,$$
where $\norm{x_i - x_j}$ is the [[Euclidean distance|0C95TG69SG]] of $x_i$ and $x_j$.
The points $x_1, \ldots, x_n$ are then said to realize $D$.

## Remarks

Every Euclidean distance matrix is symmetric, has zero diagonal and has nonnegative entries.

Example: the points $0, 1, 3 \in \R$ give
$$D = \begin{pmatrix} 0 & 1 & 9 \\ 1 & 0 & 4 \\ 9 & 4 & 0 \end{pmatrix},$$
since $1^2 = 1$, $3^2 = 9$ and $2^2 = 4$.

Non-example: the matrix with rows $(0, 1, 9)$, $(1, 0, 1)$ and $(9, 1, 0)$ is symmetric with zero diagonal, but it is not a Euclidean distance matrix.
Points realizing it would have distances $1$, $1$ and $3$, and $3 > 1 + 1$ violates the triangle inequality.

Some authors use the distances themselves instead of their squares.
