arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.13174cs.DS
收藏

文本到模式汉明距离的更快算法

Faster Algorithms for Text-to-Pattern Hamming Distances

Timothy M. Chan, Ce Jin, Virginia Vassilevska Williams, Yinzhan Xu

AI总结:

研究文本到模式汉明距离问题,提出打破数十年记录的随机与确定性精确算法及更快的近似算法,并证明其与3SUM计数版本的细粒度等价性。

摘要:

我们研究经典的文本到模式汉明距离问题:给定长度为$m$的模式$P$和长度为$n$的文本$T$,两者均在多项式规模字母表上,在具有$Θ(\log n)$位字的标准字RAM模型下,计算每个移位$i$下$P$与$T[i..i+m-1]$之间的汉明距离。\n- 我们为该问题提供了$O(n\sqrt{m})$时间的拉斯维加斯随机算法,打破了数十年前的$O(n \sqrt{m \log m})$运行时间[Abrahamson, SICOMP 1987]。我们还获得了一个确定性算法,其运行时间略高,为$O(n\sqrt{m}(\log m\log\log m)^{1/4})$。我们的随机算法扩展至$k$有界设置,运行时间为$O(n+\frac{nk}{\sqrt{m}})$,移除了早期算法中所有额外的对数因子[Gawrychowski and Uznański, ICALP 2018; Chan, Golan, Kociumaka, Kopelowitz and Porat, STOC 2020]。\n- 对于文本到模式汉明距离的$(1+ε)$近似版本,我们给出了$\tilde{O}(ε^{-0.93}n)$时间的蒙特卡洛随机算法,打破了先前的$\tilde{O}(ε^{-1}n)$运行时间[Kopelowitz and Porat, FOCS 2015; Kopelowitz and Porat, SOSA 2018]。\n我们的近似算法利用了与$3$SUM的联系,并结合了Fredman技巧、等式矩阵乘积和随机采样;特别地,我们在$3$SUM和Exact Triangle的近似计数版本上获得了新结果,这可能具有独立意义。我们的精确算法使用了哈希、位打包FFT和递归的新颖组合;特别地,在全集大小接近元素数量平方的情况下,我们获得了计算两个整数集合和集的更快算法。\n我们还证明了精确文本到模式汉明距离问题与范围受限的$3$SUM计数版本之间的细粒度等价性。

英文摘要:

We study the classic Text-to-Pattern Hamming Distances problem: given a pattern $P$ of length $m$ and a text $T$ of length $n$, both over a polynomial-size alphabet, compute the Hamming distance between $P$ and $T[i\, .\, . \, i+m-1]$ for every shift $i$, under the standard Word-RAM model with $Θ(\log n)$-bit words. - We provide an $O(n\sqrt{m})$ time Las Vegas randomized algorithm for this problem, beating the decades-old $O(n \sqrt{m \log m})$ running time [Abrahamson, SICOMP 1987]. We also obtain a deterministic algorithm, with a slightly higher $O(n\sqrt{m}(\log m\log\log m)^{1/4})$ running time. Our randomized algorithm extends to the $k$-bounded setting, with running time $O\big(n+\frac{nk}{\sqrt{m}}\big)$, removing all the extra logarithmic factors from earlier algorithms [Gawrychowski and Uznański, ICALP 2018; Chan, Golan, Kociumaka, Kopelowitz and Porat, STOC 2020]. - For the $(1+ε)$-approximate version of Text-to-Pattern Hamming Distances, we give an $\tilde{O}(ε^{-0.93}n)$ time Monte Carlo randomized algorithm, beating the previous $\tilde{O}(ε^{-1}n)$ running time [Kopelowitz and Porat, FOCS 2015; Kopelowitz and Porat, SOSA 2018]. Our approximation algorithm exploits a connection with $3$SUM, and uses a combination of Fredman's trick, equality matrix product, and random sampling; in particular, we obtain new results on approximate counting versions of $3$SUM and Exact Triangle, which may be of independent interest. Our exact algorithms use a novel combination of hashing, bit-packed FFT, and recursion; in particular, we obtain a faster algorithm for computing the sumset of two integer sets, in the regime when the universe size is close to quadratic in the number of elements. We also prove a fine-grained equivalence between the exact Text-to-Pattern Hamming Distances problem and a range-restricted, counting version of $3$SUM.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑