Wenfeng Lai, Adiesha Liyanage, Binhai Zhu, Peng Zou
{"title":"最长字母重复子序列及相关问题","authors":"Wenfeng Lai, Adiesha Liyanage, Binhai Zhu, Peng Zou","doi":"10.1007/s00236-024-00459-7","DOIUrl":null,"url":null,"abstract":"<div><p>Motivated by computing duplication patterns in sequences, a new problem called the longest letter-duplicated subsequence (LLDS) is proposed. Given a sequence <i>S</i> of length <i>n</i>, a letter-duplicated subsequence is a subsequence of <i>S</i> in the form of <span>\\(x_1^{d_1}x_2^{d_2}\\ldots x_k^{d_k}\\)</span> with <span>\\(x_i\\in \\Sigma \\)</span>, <span>\\(x_j\\ne x_{j+1}\\)</span> and <span>\\(d_i\\ge 2\\)</span> for all <i>i</i> in [<i>k</i>] and <i>j</i> in <span>\\([k-1]\\)</span>. A linear time algorithm for computing a longest letter-duplicated subsequence (LLDS) of <i>S</i> can be easily obtained. In this paper, we focus on two variants of this problem: (1) ‘all-appearance’ version, i.e., all letters in <span>\\(\\Sigma \\)</span> must appear in the solution, and (2) the weighted version. For the former, we obtain dichotomous results: We prove that, when each letter appears in <i>S</i> at least 4 times, the problem and a relaxed version on feasibility testing (FT) are both NP-hard. The reduction is from <span>\\((3^+,1,2^-)\\)</span>-SAT, where all 3-clauses (i.e., containing 3 lals) are monotone (i.e., containing only positive literals) and all 2-clauses contain only negative literals. We then show that when each letter appears in <i>S</i> at most 3 times, then the problem admits an <i>O</i>(<i>n</i>) time algorithm. Finally, we consider the weighted version, where the weight of a block <span>\\(x_i^{d_i} (d_i\\ge 2)\\)</span> could be any positive function which might not grow with <span>\\(d_i\\)</span>. We give a non-trivial <span>\\(O(n^2)\\)</span> time dynamic programming algorithm for this version, i.e., computing an LD-subsequence of <i>S</i> whose weight is maximized.</p></div>","PeriodicalId":7189,"journal":{"name":"Acta Informatica","volume":"61 3","pages":"315 - 329"},"PeriodicalIF":0.4000,"publicationDate":"2024-07-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://link.springer.com/content/pdf/10.1007/s00236-024-00459-7.pdf","citationCount":"0","resultStr":"{\"title\":\"The longest letter-duplicated subsequence and related problems\",\"authors\":\"Wenfeng Lai, Adiesha Liyanage, Binhai Zhu, Peng Zou\",\"doi\":\"10.1007/s00236-024-00459-7\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><p>Motivated by computing duplication patterns in sequences, a new problem called the longest letter-duplicated subsequence (LLDS) is proposed. Given a sequence <i>S</i> of length <i>n</i>, a letter-duplicated subsequence is a subsequence of <i>S</i> in the form of <span>\\\\(x_1^{d_1}x_2^{d_2}\\\\ldots x_k^{d_k}\\\\)</span> with <span>\\\\(x_i\\\\in \\\\Sigma \\\\)</span>, <span>\\\\(x_j\\\\ne x_{j+1}\\\\)</span> and <span>\\\\(d_i\\\\ge 2\\\\)</span> for all <i>i</i> in [<i>k</i>] and <i>j</i> in <span>\\\\([k-1]\\\\)</span>. A linear time algorithm for computing a longest letter-duplicated subsequence (LLDS) of <i>S</i> can be easily obtained. In this paper, we focus on two variants of this problem: (1) ‘all-appearance’ version, i.e., all letters in <span>\\\\(\\\\Sigma \\\\)</span> must appear in the solution, and (2) the weighted version. For the former, we obtain dichotomous results: We prove that, when each letter appears in <i>S</i> at least 4 times, the problem and a relaxed version on feasibility testing (FT) are both NP-hard. The reduction is from <span>\\\\((3^+,1,2^-)\\\\)</span>-SAT, where all 3-clauses (i.e., containing 3 lals) are monotone (i.e., containing only positive literals) and all 2-clauses contain only negative literals. We then show that when each letter appears in <i>S</i> at most 3 times, then the problem admits an <i>O</i>(<i>n</i>) time algorithm. Finally, we consider the weighted version, where the weight of a block <span>\\\\(x_i^{d_i} (d_i\\\\ge 2)\\\\)</span> could be any positive function which might not grow with <span>\\\\(d_i\\\\)</span>. We give a non-trivial <span>\\\\(O(n^2)\\\\)</span> time dynamic programming algorithm for this version, i.e., computing an LD-subsequence of <i>S</i> whose weight is maximized.</p></div>\",\"PeriodicalId\":7189,\"journal\":{\"name\":\"Acta Informatica\",\"volume\":\"61 3\",\"pages\":\"315 - 329\"},\"PeriodicalIF\":0.4000,\"publicationDate\":\"2024-07-20\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"https://link.springer.com/content/pdf/10.1007/s00236-024-00459-7.pdf\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Acta Informatica\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://link.springer.com/article/10.1007/s00236-024-00459-7\",\"RegionNum\":4,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q4\",\"JCRName\":\"COMPUTER SCIENCE, INFORMATION SYSTEMS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Acta Informatica","FirstCategoryId":"94","ListUrlMain":"https://link.springer.com/article/10.1007/s00236-024-00459-7","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0
摘要
受计算序列中重复模式的启发,我们提出了一个称为最长字母重复子序列(LLDS)的新问题。给定一个长度为 n 的序列 S,对于 [k] 中的所有 i 和 \([k-1]\) 中的所有 j,字母重复子序列是 S 的一个子序列,其形式为 \(x_1^{d_1}x_2^{d_2}\ldots x_k^{d_k}\) with \(x_i\in \Sigma \), \(x_j\ne x_{j+1}\) and \(d_i\ge 2\) 。计算 S 的最长字母重复子序列(LLDS)的线性时间算法很容易得到。在本文中,我们将重点讨论这个问题的两个变体:(1)"全部出现 "版本,即解中必须出现 \(\Sigma \) 中的所有字母;(2)加权版本。对于前者,我们得到了二分结果:我们证明,当每个字母在 S 中至少出现 4 次时,这个问题和可行性测试(FT)的简化版本都是 NP-困难的。该问题是由\((3^+,1,2^-)\)-SAT 简化而来的,其中所有 3 个分句(即包含 3 个字面量)都是单调的(即只包含正字面量),而所有 2 个分句只包含负字面量。然后我们证明,当每个字母在 S 中最多出现 3 次时,该问题的算法时间为 O(n)。最后,我们考虑了加权版本,其中块 \(x_i^{d_i} (d_i\ge 2)\)的权重可以是任何正函数,它可能不会随着 \(d_i\)的增长而增长。对于这个版本,我们给出了一种非微妙的(O(n^2))时间动态编程算法,即计算 S 的 LD 子序列,其权重最大化。
The longest letter-duplicated subsequence and related problems
Motivated by computing duplication patterns in sequences, a new problem called the longest letter-duplicated subsequence (LLDS) is proposed. Given a sequence S of length n, a letter-duplicated subsequence is a subsequence of S in the form of \(x_1^{d_1}x_2^{d_2}\ldots x_k^{d_k}\) with \(x_i\in \Sigma \), \(x_j\ne x_{j+1}\) and \(d_i\ge 2\) for all i in [k] and j in \([k-1]\). A linear time algorithm for computing a longest letter-duplicated subsequence (LLDS) of S can be easily obtained. In this paper, we focus on two variants of this problem: (1) ‘all-appearance’ version, i.e., all letters in \(\Sigma \) must appear in the solution, and (2) the weighted version. For the former, we obtain dichotomous results: We prove that, when each letter appears in S at least 4 times, the problem and a relaxed version on feasibility testing (FT) are both NP-hard. The reduction is from \((3^+,1,2^-)\)-SAT, where all 3-clauses (i.e., containing 3 lals) are monotone (i.e., containing only positive literals) and all 2-clauses contain only negative literals. We then show that when each letter appears in S at most 3 times, then the problem admits an O(n) time algorithm. Finally, we consider the weighted version, where the weight of a block \(x_i^{d_i} (d_i\ge 2)\) could be any positive function which might not grow with \(d_i\). We give a non-trivial \(O(n^2)\) time dynamic programming algorithm for this version, i.e., computing an LD-subsequence of S whose weight is maximized.
期刊介绍:
Acta Informatica provides international dissemination of articles on formal methods for the design and analysis of programs, computing systems and information structures, as well as related fields of Theoretical Computer Science such as Automata Theory, Logic in Computer Science, and Algorithmics.
Topics of interest include:
• semantics of programming languages
• models and modeling languages for concurrent, distributed, reactive and mobile systems
• models and modeling languages for timed, hybrid and probabilistic systems
• specification, program analysis and verification
• model checking and theorem proving
• modal, temporal, first- and higher-order logics, and their variants
• constraint logic, SAT/SMT-solving techniques
• theoretical aspects of databases, semi-structured data and finite model theory
• theoretical aspects of artificial intelligence, knowledge representation, description logic
• automata theory, formal languages, term and graph rewriting
• game-based models, synthesis
• type theory, typed calculi
• algebraic, coalgebraic and categorical methods
• formal aspects of performance, dependability and reliability analysis
• foundations of information and network security
• parallel, distributed and randomized algorithms
• design and analysis of algorithms
• foundations of network and communication protocols.