|This article needs additional citations for verification. (September 2013)|
In mathematics, computer science and graph theory, a distance matrix is a matrix (two-dimensional array) containing the distances, taken pairwise, of a set of points. This matrix will have a size of N×N where N is the number of points, nodes or vertices (often in a graph).
Comparison with Adjacency matrix
Distance matrices are related to adjacency matrices, with the differences that (a) the latter only provides the information which vertices are connected but does not tell about costs or distances between the vertices and (b) an entry of a distance matrix is smaller if two elements are closer, while "close" (connected) vertices yield larger entries in an adjacency matrix.
Comparison with Euclidean distance matrix
Unlike a Euclidean distance matrix, the matrix does not need to be symmetric—that is, the values xi,j do not necessarily equal xj,i. Similarly, the matrix values are not restricted to non-negative reals (as they would be in the Euclidean distance matrix) but rather can have negative values, zeros or imaginary numbers depending on the cost metric and specific use. Although it is often the case, distance matrices are not restricted to being hollow—that is, they can have non-zero entries on the main diagonal.
Examples and uses
The distance matrix would be:
These data can then be viewed in graphic form as a heat map. In this image, black denotes a distance of 0 and white is maximal distance.
In bioinformatics, distance matrices are used to represent protein structures in a coordinate-independent manner, as well as the pairwise distances between two sequences in sequence space. They are used in structural and sequential alignment, and for the determination of protein structures from NMR or X-ray crystallography.
Sometimes it is more convenient to express data as a similarity matrix.
|This applied mathematics-related article is a stub. You can help Wikipedia by expanding it.|