The Distance Matrix visualizes the calculation of the score of an optimal pairwise alignment (i.e. the edit distance). Matrix field (i,j) contains the score of an optimal alignment of two prefixes up to i resp. j characters of the input sequences. Each entry is calculated from the top-left neighboring entries by way of a (recursive) equation.
Dynamic Programming Matrix