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

全动态字符串集合上的所有后缀-前缀匹配

All-Pairs Suffix-Prefix on Fully Dynamic Set of Strings

Masaru Kikuchi, Shunsuke Inenaga

AI总结:

本文研究了全动态字符串集合上的所有后缀-前缀(APSP)匹配问题,提出了一种O(n)空间的数据结构,能够在O(|S_i| log σ + i)时间内高效处理新字符串的插入与匹配,并扩展至支持字符串删除的完全动态版本。

摘要:

所有后缀-前缀(APSP)问题是字符串处理中的一个经典问题,在生物信息学中有重要应用。给定包含 $k$ 个字符串的集合 $\mathcal{S} = \{S_1, \ldots, S_k\}$,APSP 问题要求为 $\mathcal{S}$ 中所有 $k^2$ 个有序字符串对 $\langle S_i, S_j \rangle$ 计算 $S_i$ 的最长后缀,使其成为 $S_j$ 的前缀。在本文中,我们考虑 APSP 问题的动态版本,允许向字符串集合中插入新字符串。我们的目标是,每次新字符串 $S_i$ 到达当前包含 $i-1$ 个字符串的集合 $\mathcal{S}_{i-1} = \{S_1, \ldots, S_{i-1}\}$ 时,为所有 $1 \leq j \leq i$ 计算:(1) $S_i$ 的作为 $S_j$ 前缀的最长后缀,以及 (2) $S_i$ 的作为 $S_j$ 后缀的最长前缀。我们提出了一种 $O(n)$ 空间的数据结构,对于每个给定的新字符串 $S_i$,它能在 $O(|S_i| \log σ+ i)$ 时间内计算出 (1) 和 (2),其中 $n$ 是字符串的总长度。此外,我们还展示了如何将我们的方法扩展到允许同时插入和删除字符串的 APSP 问题的完全动态版本。

英文摘要:

The all-pairs suffix-prefix (APSP) problem is a classical problem in string processing which has important applications in bioinformatics. Given a set $\mathcal{S} = \{S_1, \ldots, S_k\}$ of $k$ strings, the APSP problem asks one to compute the longest suffix of $S_i$ that is a prefix of $S_j$ for all $k^2$ ordered pairs $\langle S_i, S_j \rangle$ of strings in $\mathcal{S}$. In this paper, we consider the dynamic version of the APSP problem that allows for insertions of new strings to the set of strings. Our objective is, each time a new string $S_i$ arrives to the current set $\mathcal{S}_{i-1} = \{S_1, \ldots, S_{i-1}\}$ of $i-1$ strings, to compute (1) the longest suffix of $S_i$ that is a prefix of $S_j$ and (2) the longest prefix of $S_i$ that is a suffix of $S_j$ for all $1 \leq j \leq i$. We propose an $O(n)$-space data structure which computes (1) and (2) in $O(|S_i| \log σ+ i)$ time for each new given string $S_i$, where $n$ is the total length of the strings. Further, we show how to extend our methods to the fully dynamic version of the APSP problem allowing for both insertions and deletions of strings.

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

↑