arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.14850quant-phcs.DS
收藏

多字符串匹配问题的量子算法

Quantum Algorithm for the Multiple String Matching Problem

Kamil Khadiev, Danil Serov

AI总结:

本文针对多字符串匹配问题提出一种量子算法,查询复杂度为 O(n+√(mL log n)+m log n),时间复杂度为 O^*(n+√(mL)),达到量子下界(仅差对数因子),可视为 Aho-Corasick 算法的量子类比,在长单词字典场景下优势显著。

摘要:

考虑多字符串匹配问题。在该问题中,我们考虑一个长度为 n 的长字符串,记为 t,该字符串被称为文本。我们还考虑一个由 m 个字符串组成的序列,记为 S,我们将其称为字典。字典中所有字符串的总长度用变量 L 表示。目标是识别文本中所有来自字典的字符串实例。该问题的标准经典解法是 Aho-Corasick 算法,其查询和时间复杂度均为 O(n+L)。同时,该问题的经典下界同样是 Ω(n+L)。我们提出一种量子算法,其查询复杂度为 O(n+√(mL log n)+m log n),时间复杂度为 O(n+√(mL log n) log b+m log n)=O^*(n+√(mL)),其中 b 是字典中字符串的最大长度。这一改进在字典由长单词组成的情况下尤为显著。我们的算法复杂度等于量子下界 O(n+√(mL)),仅相差一个对数因子。在某种意义上,我们的算法可以视为 Aho-Corasick 算法的量子类比。

英文摘要:

Let us consider the Multiple String Matching Problem. In this problem, we consider a long string, denoted by $t$, of length $n$. This string is referred to as a text. We also consider a sequence of $m$ strings, denoted by $S$, which we refer to as a dictionary. The total length of all strings from the dictionary is represented by the variable L. The objective is to identify all instances of strings from the dictionary within the text. The standard classical solution to this problem is Aho-Corasick Algorithm that has $O(n+L)$ query and time complexity. At the same time, the classical lower bound for the problem is the same $Ω(n+L)$. We propose a quantum algorithm with $O(n+\sqrt{mL\log n}+m\log n)$ query complexity and $O(n+\sqrt{mL\log n}\log b+m\log n)=O^*(n+\sqrt{mL})$ time complexity, where $b$ is the maximal length of strings from the dictionary. This improvement is particularly significant in the case of dictionaries comprising long words. Our algorithm's complexity is equal to the quantum lower bound $O(n + \sqrt{mL})$, up to a log factor. In some sense, our algorithm can be viewed as a quantum analogue of the Aho-Corasick algorithm.

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

↑