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

子序列匹配与带段数约束的最长公共子序列

Subsequence Matching and LCS with Segment Number Constraints

Yuki Yonemoto, Takuya Mieno, Shunsuke Inenaga, Ryo Yoshinaka, Ayumi Shinohara

AI总结:

本文研究分段LCS(SegLCS)和分段子序列匹配(SegE)问题,提出SegE的SETH条件时间下界、O(mn)时间算法,以及SegLCS的O(fn2(n1-ℓ+1))时间算法。

摘要:

最长公共子序列(LCS)是字符串处理中的一个基本问题,已有大量算法研究、扩展和应用。若字符串 $P$ 可表示为 $P = u_1 \cdots u_f$,则称序列 $u_1, \ldots, u_f$(共 $f$ 个字符串)为字符串 $P$ 的一个($f$)分段。Li 等人 [BIBM 2022] 针对给定字符串 $T_1, T_2$ 和整数 $f$ 提出了 LCS 问题的一个新变体,我们在此称之为分段 LCS 问题(SegLCS),即寻找(长度)最长的字符串 $P$,使得 $P$ 具有一个 $f$ 分段且该分段可嵌入到 $T_1$ 和 $T_2$ 中。Li 等人 [IJTCS-FAW 2024] 给出了一个动态规划解法,在 $O(fn_1n_2)$ 时间和 $O(fn_1 + n_2)$ 空间内解决 SegLCS,其中 $n_1 = |T_1|$,$n_2 = |T_2|$,且 $n_1 \le n_2$。最近,Banerjee 等人 [ESA 2024] 提出了一种算法,对于常数 $f \geq 3$,在 $\tilde{O}((n_1n_2)^{1-(1/3)^{f-2}})$ 时间内解决 SegLCS。本文我们处理 SegLCS 以及分段子序列模式匹配问题 SegE,后者询问长度为 $m$ 的模式 $P$ 是否具有一个 $f$ 分段可嵌入到长度为 $n$ 的文本 $T$ 中。当 $f = 1$ 时,这等价于子串匹配;当 $f = |P|$ 时,这等价于子序列匹配。本文关注 $f$ 为一般值的情况,我们的主要贡献有三方面:(1)在强指数时间假设(SETH)下,对于任意常数 $ε> 0$,给出 SegE 的 $O((mn)^{1-ε})$ 时间条件下界。(2)给出 SegE 的 $O(mn)$ 时间算法。(3)给出 SegLCS 的 $O(fn_2(n_1 - \ell+1))$ 时间算法,其中 $\ell$ 为解的长度。

英文摘要:

The longest common subsequence (LCS) is a fundamental problem in string processing which has numerous algorithmic studies, extensions, and applications. A sequence $u_1, \ldots, u_f$ of $f$ strings s said to be an ($f$-)segmentation of a string $P$ if $P = u_1 \cdots u_f$. Li et al. [BIBM 2022] proposed a new variant of the LCS problem for given strings $T_1, T_2$ and an integer $f$, which we hereby call the segmental LCS problem (SegLCS), of finding (the length of) a longest string $P$ that has an $f$-segmentation which can be embedded into both $T_1$ and $T_2$. Li et al. [IJTCS-FAW 2024] gave a dynamic programming solution that solves SegLCS in $O(fn_1n_2)$ time with $O(fn_1 + n_2)$ space, where $n_1 = |T_1|$, $n_2 = |T_2|$, and $n_1 \le n_2$. Recently, Banerjee et al. [ESA 2024] presented an algorithm which, for a constant $f \geq 3$, solves SegLCS in $\tilde{O}((n_1n_2)^{1-(1/3)^{f-2}})$ time. In this paper, we deal with SegLCS as well as the problem of segmental subsequence pattern matching, SegE, that asks to determine whether a pattern $P$ of length $m$ has an $f$-segmentation that can be embedded into a text $T$ of length $n$. When $f = 1$, this is equivalent to substring matching, and when $f = |P|$, this is equivalent to subsequence matching. Our focus in this article is the case of general values of $f$, and our main contributions are threefold: (1) $O((mn)^{1-ε})$-time conditional lower bound for SegE under the strong exponential-time hypothesis (SETH), for any constant $ε> 0$. (2) $O(mn)$-time algorithm for SegE. (3) $O(fn_2(n_1 - \ell+1))$-time algorithm for SegLCS where $\ell$ is the solution length.

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

↑