When biologists compare two DNA or protein sequences, they rarely expect the entire sequences to match. What they are looking for is a region — perhaps a few dozen letters — that appears in both sequences with only minor differences. That needle-in-a-haystack search is called local alignment, and the algorithm that solves it optimally is Smith-Waterman (Temple Smith and Michael Waterman, 1981).
It is a close cousin of the earlier sequence alignment algorithm by Needleman and Wunsch (1970), which finds the best global alignment — the best way to match the whole of one sequence against the whole of another. Smith-Waterman makes one small but powerful change: it floors the scoring matrix at zero. Whenever the running score would go negative, it resets to zero instead of carrying a penalty forward. That single rule means the algorithm ignores poor-matching flanks and focuses on the best-matching core.
The result is a guaranteed-optimal local alignment found in polynomial time — an exact algorithm that no heuristic search can beat for correctness, though many faster approximations exist for large databases.
Comments
Loading comments...