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 , andThe 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]
A general method applicable to the search for similarities in the amino acid sequence of two proteins by Saul B. Needleman and Christian D. Wunsch. Needleman and Wunsch, 1970, global sequence comparison
Use global sequence alignment, for example the Needleman-Wunsch algorithm with an appropriate substitution matrix and gap penalty. The two full-length globin proteins are related by orthology and are from closely related species, so the expected correspondence extends across both complete sequences. Unmatched ends should normally contribute to the score rather than being discarded.
With a linear gap penalty of magnitude , the dynamic programming entry is the best score for the first and residues. It satisfieswith , , and traceback from . An affine gap penalty uses separate match and gap states.
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 general method applicable to the search for similarities in the amino acid sequence of two proteins by Saul B. Needleman and Christian D. Wunsch. 1970, pp. 443–453: iterative matrix approach to sequence similarity
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.