English

Subsequence Matching and LCS under Cartesian-Tree Equivalence

Data Structures and Algorithms 2026-01-01 v4

Abstract

Two strings of the same length are said to Cartesian-tree match (CT-match) if their Cartesian-trees are isomorphic [Park et al., TCS 2020]. Cartesian-tree matching is a natural model that allows for capturing similarities of numerical sequences. Oizumi et al. [CPM 2022] showed that subsequence pattern matching under CT-matching model (CT-MSeq) can be solved in O(nmloglogn)O(nm \log \log n) time, where nn and mm are text and pattern lengths, respectively. This current article follows this line of research, and gives the following new results: (1) An O(nm)O(nm)-time CT-MSeq algorithm for binary alphabets; (2) An O((nm)1ϵ)O((nm)^{1-\epsilon})-time conditional lower bound for the CT-MSeq problem on alphabets of size 4, for any constant ϵ>0\epsilon > 0, under the Orthogonal Vector Hypothesis (OVH). Further, we introduce the new problem of longest common subsequence under CT-matching (CT-LCS) for two given strings SS and TT of length nn, and present the following results: (3) An O(n6)O(n^6)-time CT-LCS algorithm for general ordered alphabets; (4) An O(n2/logn)O(n^2 / \log n)-time CT-LCS algorithm for binary alphabets; (5) An O(n2ϵ)O(n^{2-\epsilon})-time conditional lower bound for the CT-LCS problem on alphabets of size 5, for any constant ϵ>0\epsilon > 0, under OVH.

Keywords

Cite

@article{arxiv.2402.19146,
  title  = {Subsequence Matching and LCS under Cartesian-Tree Equivalence},
  author = {Taketo Tsujimoto and Yuki Yonemoto and Hiroki Shibata and Takuya Mieno and Yuto Nakashima and Shunsuke Inenaga},
  journal= {arXiv preprint arXiv:2402.19146},
  year   = {2026}
}

Comments

Accepted for Theory of Computing Systems

R2 v1 2026-06-28T15:04:34.106Z