{"title":"运行长度编码格式的广义约束最长公共子序列","authors":"En-An Song , Chang-Biau Yang , Kuo-Tsung Tseng","doi":"10.1016/j.ic.2025.105311","DOIUrl":null,"url":null,"abstract":"<div><div>The longest common subsequence (LCS) is commonly used as a similarity measurement between two given sequences (strings). Several variants of the LCS problem have been developed. The generalized constrained LCS (CLCS) problems have four variants: substring exclusion (STR-EC-LCS), substring inclusion, subsequence exclusion and subsequence inclusion. In the STR-EC-LCS problem, a given constraint string is excluded as a substring from the answer. For the STR-EC-LCS problem with run-length encoded (RLE) strings, we are given two strings <em>X</em> and <em>Y</em>, along with a constraint string <em>P</em>, consisting of <em>M</em>, <em>N</em> and <em>R</em> runs, respectively. In their plain (non-RLE) representations, the lengths of these strings are <span><math><mo>|</mo><mi>X</mi><mo>|</mo><mo>=</mo><mi>m</mi></math></span>, <span><math><mo>|</mo><mi>Y</mi><mo>|</mo><mo>=</mo><mi>n</mi></math></span> and <span><math><mo>|</mo><mi>P</mi><mo>|</mo><mo>=</mo><mi>r</mi></math></span>. We combine the state transition with the dynamic programming approach to solve the STR-EC-LCS problem with RLE strings. The time complexity of our algorithm is O<span><math><mo>(</mo><mi>r</mi><mo>(</mo><mi>M</mi><mi>n</mi><mo>+</mo><mi>m</mi><mi>N</mi><mo>)</mo><mo>)</mo></math></span>. The previous algorithm for STR-EC-LCS without RLE has a time complexity of O<span><math><mo>(</mo><mi>m</mi><mi>n</mi><mi>r</mi><mo>)</mo></math></span>. Since <span><math><mi>M</mi><mo>≤</mo><mi>m</mi></math></span> and <span><math><mi>N</mi><mo>≤</mo><mi>n</mi></math></span>, our algorithm improves the previous algorithm in time complexity. Additionally, our algorithm, which is based on state transitions, is universal and can be applied to the other three variants of the generalized constrained LCS problem with the same complexity.</div></div>","PeriodicalId":54985,"journal":{"name":"Information and Computation","volume":"305 ","pages":"Article 105311"},"PeriodicalIF":1.0000,"publicationDate":"2025-05-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"The generalized constrained longest common subsequence in the run-length encoded format\",\"authors\":\"En-An Song , Chang-Biau Yang , Kuo-Tsung Tseng\",\"doi\":\"10.1016/j.ic.2025.105311\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><div>The longest common subsequence (LCS) is commonly used as a similarity measurement between two given sequences (strings). Several variants of the LCS problem have been developed. The generalized constrained LCS (CLCS) problems have four variants: substring exclusion (STR-EC-LCS), substring inclusion, subsequence exclusion and subsequence inclusion. In the STR-EC-LCS problem, a given constraint string is excluded as a substring from the answer. For the STR-EC-LCS problem with run-length encoded (RLE) strings, we are given two strings <em>X</em> and <em>Y</em>, along with a constraint string <em>P</em>, consisting of <em>M</em>, <em>N</em> and <em>R</em> runs, respectively. In their plain (non-RLE) representations, the lengths of these strings are <span><math><mo>|</mo><mi>X</mi><mo>|</mo><mo>=</mo><mi>m</mi></math></span>, <span><math><mo>|</mo><mi>Y</mi><mo>|</mo><mo>=</mo><mi>n</mi></math></span> and <span><math><mo>|</mo><mi>P</mi><mo>|</mo><mo>=</mo><mi>r</mi></math></span>. We combine the state transition with the dynamic programming approach to solve the STR-EC-LCS problem with RLE strings. The time complexity of our algorithm is O<span><math><mo>(</mo><mi>r</mi><mo>(</mo><mi>M</mi><mi>n</mi><mo>+</mo><mi>m</mi><mi>N</mi><mo>)</mo><mo>)</mo></math></span>. The previous algorithm for STR-EC-LCS without RLE has a time complexity of O<span><math><mo>(</mo><mi>m</mi><mi>n</mi><mi>r</mi><mo>)</mo></math></span>. Since <span><math><mi>M</mi><mo>≤</mo><mi>m</mi></math></span> and <span><math><mi>N</mi><mo>≤</mo><mi>n</mi></math></span>, our algorithm improves the previous algorithm in time complexity. Additionally, our algorithm, which is based on state transitions, is universal and can be applied to the other three variants of the generalized constrained LCS problem with the same complexity.</div></div>\",\"PeriodicalId\":54985,\"journal\":{\"name\":\"Information and Computation\",\"volume\":\"305 \",\"pages\":\"Article 105311\"},\"PeriodicalIF\":1.0000,\"publicationDate\":\"2025-05-19\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Information and Computation\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S0890540125000471\",\"RegionNum\":4,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"COMPUTER SCIENCE, THEORY & METHODS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Information and Computation","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0890540125000471","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
The generalized constrained longest common subsequence in the run-length encoded format
The longest common subsequence (LCS) is commonly used as a similarity measurement between two given sequences (strings). Several variants of the LCS problem have been developed. The generalized constrained LCS (CLCS) problems have four variants: substring exclusion (STR-EC-LCS), substring inclusion, subsequence exclusion and subsequence inclusion. In the STR-EC-LCS problem, a given constraint string is excluded as a substring from the answer. For the STR-EC-LCS problem with run-length encoded (RLE) strings, we are given two strings X and Y, along with a constraint string P, consisting of M, N and R runs, respectively. In their plain (non-RLE) representations, the lengths of these strings are , and . We combine the state transition with the dynamic programming approach to solve the STR-EC-LCS problem with RLE strings. The time complexity of our algorithm is O. The previous algorithm for STR-EC-LCS without RLE has a time complexity of O. Since and , our algorithm improves the previous algorithm in time complexity. Additionally, our algorithm, which is based on state transitions, is universal and can be applied to the other three variants of the generalized constrained LCS problem with the same complexity.
期刊介绍:
Information and Computation welcomes original papers in all areas of theoretical computer science and computational applications of information theory. Survey articles of exceptional quality will also be considered. Particularly welcome are papers contributing new results in active theoretical areas such as
-Biological computation and computational biology-
Computational complexity-
Computer theorem-proving-
Concurrency and distributed process theory-
Cryptographic theory-
Data base theory-
Decision problems in logic-
Design and analysis of algorithms-
Discrete optimization and mathematical programming-
Inductive inference and learning theory-
Logic & constraint programming-
Program verification & model checking-
Probabilistic & Quantum computation-
Semantics of programming languages-
Symbolic computation, lambda calculus, and rewriting systems-
Types and typechecking