Overview
Needleman-Wunsch scores matches, mismatches, and gaps to find the best end-to-end alignment between two sequences.
Globally aligns two sequences with dynamic programming.
Compact metadata for implementation and discovery.
Needleman-Wunsch scores matches, mismatches, and gaps to find the best end-to-end alignment between two sequences.
Quick facts
Runtime and memory behavior at a glance.
Best
O(nm)
Average
O(nm)
Worst
O(nm)
Space
O(nm)
score[i][j] = max(score[i-1][j-1] + match, score[i-1][j] + gap, score[i][j-1] + gap)Builds a global alignment score table from neighboring cells.
Show an alignment matrix and the backtracked best path.
Needleman-Wunsch aligns entire sequences, unlike local alignment methods.
What each reference supports for this entry.
Original global sequence-alignment paper supporting dynamic-programming recurrence and traceback.
Open sourceSequence-analysis reference covering Needleman-Wunsch dynamic-programming alignment recurrence, scoring model, and traceback behavior.
Good next jumps from the relationship graph, ranked for useful discovery.
Pattern Matching · Core
Dynamic Time Warping is an alternative to Needleman-Wunsch within the Sequence Alignment family.
Compare with thisPattern Matching · Core
Needleman-Wunsch performs global alignment, while Smith-Waterman performs local alignment.
Compare with thisBoth use dynamic programming over sequence pairs.
Needleman-Wunsch performs global alignment, while Smith-Waterman performs local alignment.