The algorithm looks for the longest similar regions by maximizing the number of matches and minimizing the number of insertion/deletion/substitution operations necessary to align the two sequences.
it finds the longest common sequence while tolerating a small number of differences.