Skip to content

Needleman-Wunsch

全局序列比对的经典算法,使用动态规划对两条完整序列进行端到端比对。 该算法找出最优的全局对齐方案,适用于比较相似长度的同源序列。

PropertyValue
Purpose全局序列比对
Time ComplexityO(mn)
Space ComplexityO(mn)
Year1970
CategorySequence Alignment

Complexity Analysis

  • Time Complexity: O(mn)
  • Space Complexity: O(mn)

Performance Insight: The time complexity of this algorithm is quadratic matrix (O(mn)), SIMD acceleration or approximate methods are advised when m, n exceed 10⁴. High space complexity; consider Hirschberg-style space-optimized variants for very long sequences.

Note: Complexity analysis is based on theoretical models. Actual runtime is affected by input scale, hardware, and implementation optimizations. Benchmark for your specific workload.

Literature & Implementation

EMBOSS needle · Clustal

Tags

dynamic-programming global-alignment classic

Released under the MIT License.