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 u1, …, uf of f strings s said to be an (f-)segmentation of a string P if P = u1 ·s uf. Li et al. [BIBM 2022] proposed a new variant of the LCS problem for given strings T1, T2 and an integer f, which we hereby call the segmental LCS problem (SegLCS), of finding (the length of) a longest string P that has an f-segmentation which can be embedded into both T1 and T2. Li et al. [IJTCS-FAW 2024] gave a dynamic programming solution that solves SegLCS in O(fn1n2) time with O(fn1 + n2) space, where n1 = |T1|, n2 = |T2|, and n1 n2. Recently, Banerjee et al. [ESA 2024] presented an algorithm which, for a constant f ≥ 3, solves SegLCS in O((n1n2)1-(1/3)f-2) 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 P of length m has an f-segmentation that can be embedded into a text T of length n. When f = 1, this is equivalent to substring matching, and when f = |P|, this is equivalent to subsequence matching. Our focus in this article is the case of general values of f, and our main contributions are threefold: (1) O((mn)1-ε)-time conditional lower bound for SegE under the strong exponential-time hypothesis (SETH), for any constant ε > 0. (2) O(mn)-time algorithm for SegE. (3) O(fn2(n1 - +1))-time algorithm for SegLCS where is the solution length.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…