在两个字符串之间计算和枚举最小子公共超序列
Computing and Enumerating Minimal Common Supersequences Between Two Strings
AI总结:
本文研究了在两个字符串间计算最小子公共超序列及枚举所有可能解的问题,提出在O(n)时间内计算并使用O(n²)空间和O(n)延迟的数据结构高效枚举所有解。
摘要:
给定k个长度不超过n的字符串,计算它们的最短公共超序列是一个已知的NP难问题(当k无界时)。另一方面,当k=2时,可以使用动态规划在O(n²)时间内计算最短公共超序列作为教科书示例。本文考虑在k=2输入字符串间计算最小子公共超序列并枚举所有最小子公共超序列的问题。我们的结果总结如下:对于k=2输入字符串,最小子公共超序列可在O(n)时间内计算。(该方法当k为常数时也有效)。两个输入字符串之间的所有最小子公共超序列可使用O(n²)空间和O(n)延迟的数据结构进行枚举,且该数据结构可在O(n³)时间内构建。
英文摘要:
Given \(k\) strings each of length at most $n$, computing the shortest common supersequence of them is a well-known NP-hard problem (when \(k\) is unbounded). On the other hand, when \(k=2\), such a shortest common supersequence can be computed in \(O(n^2)\) time using dynamic programming as a textbook example. In this paper, we consider the problem of computing a \emph{minimal} common supersequence and enumerating all minimal common supersequences for \(k=2\) input strings. Our results are summarized as follows. A minimal common supersequence of \(k=2\) input strings can be computed in $O(n)$ time. (The method also works when \(k\) is a constant). All minimal common supersequences between two input strings can be enumerated with a data structure of $O(n^2)$ space and an $O(n)$ time delay, and the data structure can be constructed in $O(n^3)$ time.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。