A method for comparing data sequences includes accepting first and second
data sequences of data elements. A distance matrix is computed. The
matrix includes rows and columns of matrix elements, describing distances
between the data elements of the first sequence and the data elements of
the second data sequence. The distance matrix is reshaped by applying
successive, incremental shifts to the rows or columns so as to produce a
reshaped matrix. A best-score path through the reshaped matrix is
calculated using vector operations, so as to quantify a similarity
between the first and second data sequences.