论文标题
更快的空间效率str-ic-LCS计算
Faster Space-Efficient STR-IC-LCS Computation
论文作者
论文摘要
比较两个给定字符串$ a $ a和$ b $的最基本方法之一是最长的常见子序列(LCS),其中的任务是(长度)的LCS $ a $ a $和$ b $。在本文中,我们处理了Str-IC-LCS问题,该问题是Chen和Chao提出的约束LCS问题之一[J.梳子。 Optim,2011]。 A string $Z$ is said to be an STR-IC-LCS of three given strings $A$, $B$, and $P$, if $Z$ is a longest string satisfying that (1) $Z$ includes $P$ as a substring and (2) $Z$ is a common subsequence of $A$ and $B$.我们为此问题提供了三种有效的算法:首先,我们从一个$ O(n^2)$ time和$ o((((\ ell+1)(n- \ ell+1))$ Space($ \ ell ell $ a $ a $ a $ a $ a $ a $ a $ $ b $ a $)的长度。当$ \ ell = o(1)$或$ n- \ ell = o(1)$时,此算法仅使用线性$ o(n)$ space。其次,我们提出了一种更快的算法,该算法在$ o(nr/\ log {r}+n(n- \ ell+1))$ time中工作,其中$ r $是$ p $的长度,同时保留$ o((\ ell+1)(n- \ ell+1)(n- \ ell+1))$太空效率。第三,我们提供了一种替代算法,该算法在$ O(nr/\ log {r}+n(n- \ ell'+1))$ time $ o((((\ ell'+1)(n- \ ell'+1))$ space中
One of the most fundamental method for comparing two given strings $A$ and $B$ is the longest common subsequence (LCS), where the task is to find (the length) of an LCS of $A$ and $B$. In this paper, we deal with the STR-IC-LCS problem which is one of the constrained LCS problems proposed by Chen and Chao [J. Comb. Optim, 2011]. A string $Z$ is said to be an STR-IC-LCS of three given strings $A$, $B$, and $P$, if $Z$ is a longest string satisfying that (1) $Z$ includes $P$ as a substring and (2) $Z$ is a common subsequence of $A$ and $B$. We present three efficient algorithms for this problem: First, we begin with a space-efficient solution which computes the length of an STR-IC-LCS in $O(n^2)$ time and $O((\ell+1)(n-\ell+1))$ space, where $\ell$ is the length of an LCS of $A$ and $B$ of length $n$. When $\ell = O(1)$ or $n-\ell = O(1)$, then this algorithm uses only linear $O(n)$ space. Second, we present a faster algorithm that works in $O(nr/\log{r}+n(n-\ell+1))$ time, where $r$ is the length of $P$, while retaining the $O((\ell+1)(n-\ell+1))$ space efficiency. Third, we give an alternative algorithm that runs in $O(nr/\log{r}+n(n-\ell'+1))$ time with $O((\ell'+1)(n-\ell'+1))$ space, where $\ell'$ denotes the STR-IC-LCS length for input strings $A$, $B$, and $P$.