Subsequence Matching and LCS with Segment Number Constraints
Abstract
The longest common subsequence (LCS) is a fundamental problem in string processing which has numerous algorithmic studies, extensions, and applications. A sequence of strings s said to be an (-)segmentation of a string if . Li et al. [BIBM 2022] proposed a new variant of the LCS problem for given strings and an integer , which we hereby call the segmental LCS problem (SegLCS), of finding (the length of) a longest string that has an -segmentation which can be embedded into both and . Li et al. [IJTCS-FAW 2024] gave a dynamic programming solution that solves SegLCS in time with space, where , , and . Recently, Banerjee et al. [ESA 2024] presented an algorithm which, for a constant , solves SegLCS in 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 of length has an -segmentation that can be embedded into a text of length . When , this is equivalent to substring matching, and when , this is equivalent to subsequence matching. Our focus in this article is the case of general values of , and our main contributions are threefold: (1) -time conditional lower bound for SegE under the strong exponential-time hypothesis (SETH), for any constant . (2) -time algorithm for SegE. (3) -time algorithm for SegLCS where is the solution length.
Cite
@article{arxiv.2407.19796,
title = {Subsequence Matching and LCS with Segment Number Constraints},
author = {Yuki Yonemoto and Takuya Mieno and Shunsuke Inenaga and Ryo Yoshinaka and Ayumi Shinohara},
journal= {arXiv preprint arXiv:2407.19796},
year = {2025}
}