arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1810.03551cs.DS
收藏

次线性时间近似在线模式匹配

Approximate Online Pattern Matching in Sub-linear Time

Diptarka Chakraborty, Debarati Das, Michal Koucky

摘要:

本文研究编辑距离下的近似模式匹配问题。在这个问题中,我们给出了一个长度为$w$的模式$P$和一个长度为$n$的文本$T$,以及一个正整数$k$。目标是找到$T$中的所有位置$j$,使得存在以$j$结束的$T$的子串,其与模式$P$的编辑距离最多为$k$。回想一下,两个字符串之间的编辑距离是将一个字符串转换为另一个字符串所需的最小字符插入、删除和替换次数。对于$\{1,...,n\}$中的位置$t$,令$k_t$为$P$与以$t$结尾的$T$的任何子串之间的最小编辑距离。本文给出序列$k_1,k_2,...,k_{n}$的一个常数因子逼近.我们考虑离线和在线设置。在离线设置中,$P$和$T$都可用,我们提出了一种算法,对于$\{1,...,n\}$中的所有$t$,计算$k_t$的值近似在一个常数因子内。我们的算法的最坏情况下的运行时间是$O(n w^{3/4})$。因此,我们打破了这个问题的$O(nw)$ -时间障碍。在在线设置中,我们得到$P$,然后$T$一次到达一个符号。我们设计了一种算法,在$T$的第$t$个符号到达时,近似在$O(1)$ -乘法因子和$w^{8/9}$ -加法误差内计算$k_t$。我们的算法需要$O(w^{1-(7/54)})$分摊时间每个符号的到来,并采取$O(w^{1-(1/54)})$额外的空间,除了存储模式$P$。我们的两个算法都是随机的,并以高概率产生正确的答案。据我们所知,这是第一个最坏情况下的次线性(在模式的长度)时间和次线性简洁空间算法的在线近似模式匹配问题。

英文摘要:

We consider the approximate pattern matching problem under edit distance. In this problem we are given a pattern $P$ of length $w$ and a text $T$ of length $n$ over some alphabet $Σ$, and a positive integer $k$. The goal is to find all the positions $j$ in $T$ such that there is a substring of $T$ ending at $j$ which has edit distance at most $k$ from the pattern $P$. Recall, the edit distance between two strings is the minimum number of character insertions, deletions, and substitutions required to transform one string into the other. For a position $t$ in $\{1,...,n\}$, let $k_t$ be the smallest edit distance between $P$ and any substring of $T$ ending at $t$. In this paper we give a constant factor approximation to the sequence $k_1,k_2,...,k_{n}$. We consider both offline and online settings. In the offline setting, where both $P$ and $T$ are available, we present an algorithm that for all $t$ in $\{1,...,n\}$, computes the value of $k_t$ approximately within a constant factor. The worst case running time of our algorithm is $O(n w^{3/4})$. As a consequence we break the $O(nw)$-time barrier for this problem. In the online setting, we are given $P$ and then $T$ arrives one symbol at a time. We design an algorithm that upon arrival of the $t$-th symbol of $T$ computes $k_t$ approximately within $O(1)$-multiplicative factor and $w^{8/9}$-additive error. Our algorithm takes $O(w^{1-(7/54)})$ amortized time per symbol arrival and takes $O(w^{1-(1/54)})$ additional space apart from storing the pattern $P$. Both of our algorithms are randomized and produce correct answer with high probability. To the best of our knowledge this is the first worst-case sub-linear (in the length of the pattern) time and sub-linear succinct space algorithm for online approximate pattern matching problem.

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

↑