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 O~(nmω-1)+O(N)-time algorithm [Bernardini et al., SIAM J. Comput. 2022], where ω denotes the matrix multiplication exponent and the O~(·) 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 O(k2mG+kN) time, under edit distance, or 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 Ω(mN) time in the worst case. In this paper we make progress in this direction. We show that 1-EDSM can be solved in O((nm2+N)logm) or O(nm3+N) time under edit distance. For the decision version of the problem, we present a faster O(nm2logm+Nloglogm)-time algorithm. We also show that 1-EDSM can be solved in O(nm2+Nlogm) 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.

Elastic-degenerate string matching with 1 error or mismatch / G. Bernardini, E. Gabory, S.P. Pissis, L. Stougie, M. Sweering, W. Zuba. - In: THEORY OF COMPUTING SYSTEMS. - ISSN 1432-4350. - 68:5(2024 Oct), pp. 1442-1467. [10.1007/s00224-024-10194-8]

Elastic-degenerate string matching with 1 error or mismatch

G. Bernardini
Primo
;
2024

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 O~(nmω-1)+O(N)-time algorithm [Bernardini et al., SIAM J. Comput. 2022], where ω denotes the matrix multiplication exponent and the O~(·) 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 O(k2mG+kN) time, under edit distance, or 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 Ω(mN) time in the worst case. In this paper we make progress in this direction. We show that 1-EDSM can be solved in O((nm2+N)logm) or O(nm3+N) time under edit distance. For the decision version of the problem, we present a faster O(nm2logm+Nloglogm)-time algorithm. We also show that 1-EDSM can be solved in O(nm2+Nlogm) 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.
string algorithms; approximate string matching; edit distance; Hamming distance; elastic-degenerate strings
Settore INFO-01/A - Informatica
   Pan-genome Graph Algorithms and Data Integration
   PANGAIA
   European Commission
   Horizon 2020 Framework Programme
   872539

   ALgorithms for PAngenome Computational Analysis
   ALPACA
   European Commission
   Horizon 2020 Framework Programme
   956229

   NETCO-PD: 14 experienced researchers in network science for Europe
   NETCO-PD
   European Commission
   Horizon 2020 Framework Programme
   101034253
ott-2024
Article (author)
File in questo prodotto:
File Dimensione Formato  
s00224-024-10194-8.pdf

accesso aperto

Tipologia: Publisher's version/PDF
Dimensione 825.19 kB
Formato Adobe PDF
825.19 kB Adobe PDF Visualizza/Apri
Pubblicazioni consigliate

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/2434/1131036
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 4
  • ???jsp.display-item.citation.isi??? 3
  • OpenAlex ND
social impact