Needleman-Wunsch algorithm Created 2026-10-20 Updated 2026-11-05
The Needleman-Wunsch algorithm uses dynamic programming to find an optimal global sequence alignment. For a linear gap penalty , set , and
The final entry scores the best alignment of both complete sequences. The recurrence follows because its last step must align two symbols or a symbol and a gap. Unlike local alignment, there is no zero restart, so unmatched ends contribute to the score. [ref]
Saul B. Needleman 2026-11-05
Saul B. Needleman coauthored the 1970 matrix-based approach to comparing complete protein sequences, associated with the Needleman-Wunsch algorithm. The approach replaces an exhaustive comparison of all possible arrangements by a structured accumulation of similarity scores.[ref]
A modern global-alignment formulation optimizes scores over pairs of prefixes, considering a paired residue or a gap as the final column. The boundary conditions penalize unmatched prefixes, unlike local alignment's option to restart freely. This distinction makes the scientific question explicit: comparing entire sequences is different from searching for one shared internal region. The choice of substitution scores and gap costs remains part of the biological model.