Elastic-Degenerate String Matching with 1 Error or Mismatch
Open Access
- 16 September 2024
- journal article
- research article
- Published by Springer Nature in Theory of Computing Systems
- Vol. 68 (5) , 1442-1467
Abstract
An elastic-degenerate (ED) string is a sequence of n finite sets of strings of total length N, introduced to represent a set of related DNA sequences, also known as a pangenome. The ED string matching (EDSM) problem consists in reporting all occurrences of a pattern of length m in an ED text. The EDSM problem has recently received some attention by the combinatorial pattern matching community, culminating in an $$\mathcal {\tilde{O}}(nm^{\omega -1})+\mathcal {O}(N)$$ -time algorithm [Bernardini et al., SIAM J. Comput. 2022], where $$\omega $$ denotes the matrix multiplication exponent and the $$\mathcal {\tilde{O}}(\cdot )$$ notation suppresses polylog factors. In the k-EDSM problem, the approximate version of EDSM, we are asked to report all pattern occurrences with at most k errors. k-EDSM can be solved in $$\mathcal {O}(k^2mG+kN)$$ time, under edit distance, or $$\mathcal {O}(kmG+kN)$$ time, under Hamming distance, where G denotes the total number of strings in the ED text [Bernardini et al., Theor. Comput. Sci. 2020]. Unfortunately, G is only bounded by N, and so even for $$k=1$$ , the existing algorithms run in $$\varOmega (mN)$$ time in the worst case. In this paper we make progress in this direction. We show that 1-EDSM can be solved in $$\mathcal {O}((nm^2 + N)\log m)$$ or $$\mathcal {O}(nm^3 + N)$$ time under edit distance. For the decision version of the problem, we present a faster $$\mathcal {O}(nm^2\sqrt{\log m} + N\log \log m)$$ -time algorithm. We also show that 1-EDSM can be solved in $$\mathcal {O}(nm^2 + N\log m)$$ time under Hamming distance. Our algorithms for edit distance rely on non-trivial reductions from 1-EDSM to special instances of classic computational geometry problems (2d rectangle stabbing or 2d range emptiness), which we show how to solve efficiently. In order to obtain an even faster algorithm for Hamming distance, we rely on employing and adapting the k-errata trees for indexing with errors [Cole et al., STOC 2004]. This is an extended version of a paper presented at LATIN 2022.
Keywords
Funding Information
- Ministero dell'Università e della Ricerca (MUR - FSE REACT EU - PON R&I 2014-2020)
- European Commission (956229, 872539, 872539)
- Nederlandse Organisatie voor Toegepast Natuurwetenschappelijk Onderzoek (OCENW.GROOT.2019.015)
- Nederlandse Organisatie voor Wetenschappelijk Onderzoek (NETWORKS-024.002.003, NETWORKS-024.002.003, NETWORKS-024.002.003)
This publication has 36 references indexed in Scilit:
- Elastic-Degenerate String Matching with 1 Error2022
- An Efficient Elastic-Degenerate Text Index? Not Likely2020
- Graph-Based Representations for Supporting Genome Data Analysis and Visualization: Opportunities and Challenges2019
- Constructing Efficient Dictionaries in Close to Sorting Time2008
- A linear time pattern matching algorithm between a string and a tree2005
- Text Indexing and Dictionary Matching with One ErrorJournal of Algorithms, 2000
- Pattern Matching in HypertextJournal of Algorithms, 2000
- The LCA Problem Revisited2000
- String matching in hypertext1995
- A data structure for dynamic treesJournal of Computer and System Sciences, 1983