A distance matrix is a matrix containing the pairwise distances between the elements of a set. The distance may rely on the concept of metric.