Giulia Bernardini, Esteban Gabory, Solon P. Pissis, Leen Stougie, Michelle Sweering, Wiktor Zuba
{"title":"弹性去生成字符串匹配,1 次错误或不匹配","authors":"Giulia Bernardini, Esteban Gabory, Solon P. Pissis, Leen Stougie, Michelle Sweering, Wiktor Zuba","doi":"10.1007/s00224-024-10194-8","DOIUrl":null,"url":null,"abstract":"<p>An elastic-degenerate (ED) string is a sequence of <i>n</i> finite sets of strings of total length <i>N</i>, introduced to represent a set of related DNA sequences, also known as a <i>pangenome</i>. The ED string matching (EDSM) problem consists in reporting all occurrences of a pattern of length <i>m</i> in an ED text. The EDSM problem has recently received some attention by the combinatorial pattern matching community, culminating in an <span>\\(\\mathcal {\\tilde{O}}(nm^{\\omega -1})+\\mathcal {O}(N)\\)</span>-time algorithm [Bernardini et al., SIAM J. Comput. 2022], where <span>\\(\\omega \\)</span> denotes the matrix multiplication exponent and the <span>\\(\\mathcal {\\tilde{O}}(\\cdot )\\)</span> notation suppresses polylog factors. In the <i>k</i>-EDSM problem, the approximate version of EDSM, we are asked to report all pattern occurrences with at most <i>k</i> errors. <i>k</i>-EDSM can be solved in <span>\\(\\mathcal {O}(k^2mG+kN)\\)</span> time, under edit distance, or <span>\\(\\mathcal {O}(kmG+kN)\\)</span> time, under Hamming distance, where <i>G</i> denotes the total number of strings in the ED text [Bernardini et al., Theor. Comput. Sci. 2020]. Unfortunately, <i>G</i> is only bounded by <i>N</i>, and so even for <span>\\(k=1\\)</span>, the existing algorithms run in <span>\\(\\varOmega (mN)\\)</span> time in the worst case. In this paper we make progress in this direction. We show that 1-EDSM can be solved in <span>\\(\\mathcal {O}((nm^2 + N)\\log m)\\)</span> or <span>\\(\\mathcal {O}(nm^3 + N)\\)</span> time under edit distance. For the decision version of the problem, we present a faster <span>\\(\\mathcal {O}(nm^2\\sqrt{\\log m} + N\\log \\log m)\\)</span>-time algorithm. We also show that 1-EDSM can be solved in <span>\\(\\mathcal {O}(nm^2 + N\\log m)\\)</span> 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 <i>k</i>-errata trees for indexing with errors [Cole et al., STOC 2004]. This is an extended version of a paper presented at LATIN 2022.</p>","PeriodicalId":22832,"journal":{"name":"Theory of Computing Systems","volume":"101 1","pages":""},"PeriodicalIF":0.6000,"publicationDate":"2024-09-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Elastic-Degenerate String Matching with 1 Error or Mismatch\",\"authors\":\"Giulia Bernardini, Esteban Gabory, Solon P. Pissis, Leen Stougie, Michelle Sweering, Wiktor Zuba\",\"doi\":\"10.1007/s00224-024-10194-8\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<p>An elastic-degenerate (ED) string is a sequence of <i>n</i> finite sets of strings of total length <i>N</i>, introduced to represent a set of related DNA sequences, also known as a <i>pangenome</i>. The ED string matching (EDSM) problem consists in reporting all occurrences of a pattern of length <i>m</i> in an ED text. The EDSM problem has recently received some attention by the combinatorial pattern matching community, culminating in an <span>\\\\(\\\\mathcal {\\\\tilde{O}}(nm^{\\\\omega -1})+\\\\mathcal {O}(N)\\\\)</span>-time algorithm [Bernardini et al., SIAM J. Comput. 2022], where <span>\\\\(\\\\omega \\\\)</span> denotes the matrix multiplication exponent and the <span>\\\\(\\\\mathcal {\\\\tilde{O}}(\\\\cdot )\\\\)</span> notation suppresses polylog factors. In the <i>k</i>-EDSM problem, the approximate version of EDSM, we are asked to report all pattern occurrences with at most <i>k</i> errors. <i>k</i>-EDSM can be solved in <span>\\\\(\\\\mathcal {O}(k^2mG+kN)\\\\)</span> time, under edit distance, or <span>\\\\(\\\\mathcal {O}(kmG+kN)\\\\)</span> time, under Hamming distance, where <i>G</i> denotes the total number of strings in the ED text [Bernardini et al., Theor. Comput. Sci. 2020]. Unfortunately, <i>G</i> is only bounded by <i>N</i>, and so even for <span>\\\\(k=1\\\\)</span>, the existing algorithms run in <span>\\\\(\\\\varOmega (mN)\\\\)</span> time in the worst case. In this paper we make progress in this direction. We show that 1-EDSM can be solved in <span>\\\\(\\\\mathcal {O}((nm^2 + N)\\\\log m)\\\\)</span> or <span>\\\\(\\\\mathcal {O}(nm^3 + N)\\\\)</span> time under edit distance. For the decision version of the problem, we present a faster <span>\\\\(\\\\mathcal {O}(nm^2\\\\sqrt{\\\\log m} + N\\\\log \\\\log m)\\\\)</span>-time algorithm. We also show that 1-EDSM can be solved in <span>\\\\(\\\\mathcal {O}(nm^2 + N\\\\log m)\\\\)</span> 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 <i>k</i>-errata trees for indexing with errors [Cole et al., STOC 2004]. This is an extended version of a paper presented at LATIN 2022.</p>\",\"PeriodicalId\":22832,\"journal\":{\"name\":\"Theory of Computing Systems\",\"volume\":\"101 1\",\"pages\":\"\"},\"PeriodicalIF\":0.6000,\"publicationDate\":\"2024-09-16\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Theory of Computing Systems\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://doi.org/10.1007/s00224-024-10194-8\",\"RegionNum\":4,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q4\",\"JCRName\":\"COMPUTER SCIENCE, THEORY & METHODS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Theory of Computing Systems","FirstCategoryId":"94","ListUrlMain":"https://doi.org/10.1007/s00224-024-10194-8","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
引用次数: 0
摘要
弹性退化(ED)字符串是总长度为 N 的 n 个有限字符串集合的序列,用来表示一组相关的 DNA 序列,也称为泛基因组。ED 字符串匹配(EDSM)问题包括报告 ED 文本中长度为 m 的模式的所有出现情况。最近,EDSM 问题受到了组合模式匹配界的关注,最终产生了一种 \(\mathcal {\tilde{O}}(nm^{\omega -1})+\mathcal {O}(N)\)-time 算法 [Bernardini et al、SIAM J. Comput. 2022],其中 \(\omega \) 表示矩阵乘法指数,而 \(\mathcal {\tilde{O}}(\cdot )\) 符号抑制了多对数因子。在 k-EDSM 问题(EDSM 的近似版本)中,我们被要求以最多 k 个错误来报告所有模式的出现。在编辑距离下,k-ESM 可以在 \(\mathcal {O}(k^2mG+kN)\) 时间内求解,或在汉明距离下,在 \(\mathcal {O}(kmG+kN)\) 时间内求解,其中 G 表示 ED 文本中字符串的总数 [Bernardini et al、计算科学理论,2020 年]。不幸的是,G 仅以 N 为界,因此即使对于 \(k=1\),现有算法在最坏情况下也需要 \(\varOmega(mN)\)时间。在本文中,我们在这个方向上取得了进展。我们证明在编辑距离下,1-EDSM 可以在 \(\mathcal {O}((nm^2 + N)\log m)\)或 \(\mathcal {O}(nm^3 + N)\)时间内求解。对于决策版本的问题,我们提出了一种更快的 \(\mathcal {O}(nm^2\sqrt{\log m} + N\log \log m)\时间算法。我们还证明,在汉明距离下,1-EDSM 可以在 \(\mathcal {O}(nm^2 + N\log m)\)时间内求解。我们的编辑距离算法依赖于从 1-EDSM 到经典计算几何问题(2d 矩形刺入或 2d 范围虚空)特殊实例的非难还原,我们展示了如何高效地解决这些问题。为了获得更快的汉明距离算法,我们采用了 k-errata 树,并对其进行了调整,以实现有误差的索引[科尔等人,STOC 2004]。本文是在 LATIN 2022 大会上发表的论文的扩展版本。
Elastic-Degenerate String Matching with 1 Error or Mismatch
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.
期刊介绍:
TOCS is devoted to publishing original research from all areas of theoretical computer science, ranging from foundational areas such as computational complexity, to fundamental areas such as algorithms and data structures, to focused areas such as parallel and distributed algorithms and architectures.