After the multiple DTW paths are calculated, the optimal subpath on each is then detected in order to find the local alignments where the similarity is maximal, which is where we expect actual matched phrases to occur.
for a given path P = p 0 , p 2 , ..., p K , the optimal subpath is defined to be a continuous subpath, , 0 ≤ n ≤ m ≤ k, and m − n + 1 ≥ L. the subpath is at least as long as L and has the maximal average similarity.