,
Tetsuo Shibuya
Creative Commons Attribution 4.0 International license
Theoretically, the fastest algorithm by Crochemore et al. for computing the alignment of two given strings of size n over a constant alphabet takes O(n²/log n) time. The algorithm uses Lempel–Ziv parsing to divide the dynamic programming matrix into blocks and utilizes the repetitive structure. It is the only previously known subquadratic-time algorithm that can handle scoring matrices of arbitrary weights. However, this algorithm takes O(n²/log n) space, and reducing the space while preserving the time complexity has been an open problem for more than 20 years. We present a solution to this issue by achieving an O(n) space algorithm that maintains O(n²/log n) time. The classical refinement by Hirschberg reduces the space complexity of the textbook O(n²) algorithm to O(n) while preserving the quadratic time. However, applying this technique to the algorithm of Crochemore et al. has been considered challenging because their method requires O(n² / log n) space even when computing only the alignment score. Our modification enables the application of Hirschberg’s refinement, allowing traceback computation in O(n) space while preserving the O(n² / log n) overall time complexity. Our algorithm can be applied to both global and local string alignment problems.
@InProceedings{yamano_et_al:LIPIcs.WABI.2025.21,
author = {Yamano, Ryosuke and Shibuya, Tetsuo},
title = {{Linear-Space Subquadratic-Time String Alignment Algorithm for Arbitrary Scoring Matrices}},
booktitle = {25th International Conference on Algorithms for Bioinformatics (WABI 2025)},
pages = {21:1--21:14},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-386-7},
ISSN = {1868-8969},
year = {2025},
volume = {344},
editor = {Brejov\'{a}, Bro\v{n}a and Patro, Rob},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.WABI.2025.21},
URN = {urn:nbn:de:0030-drops-239479},
doi = {10.4230/LIPIcs.WABI.2025.21},
annote = {Keywords: String alignment, dynamic programming, linear space algorithms}
}