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(nm \log \log n)$ time, where $n$ and $m$ are text and pattern lengths, respectively. This current article follows this line of research, and gives the following new results: (1) An $O(nm)$-time CT-MSeq algorithm for binary alphabets; (2) An $O((nm)^{1-ε})$-time conditional lower bound for the CT-MSeq problem on alphabets of size 4, for any constant $ε> 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 $S$ and $T$ of length $n$, and present the following results: (3) An $O(n^6)$-time CT-LCS algorithm for general ordered alphabets; (4) An $O(n^2 / \log n)$-time CT-LCS algorithm for binary alphabets; (5) An $O(n^{2-ε})$-time conditional lower bound for the CT-LCS problem on alphabets of size 5, for any constant $ε> 0$, under OVH.
翻译:若两个等长字符串的笛卡尔树同构,则称它们满足笛卡尔树匹配(CT-匹配)[Park et al., TCS 2020]。笛卡尔树匹配是一种能够捕捉数值序列相似性的自然模型。Oizumi 等人 [CPM 2022] 证明了在 CT-匹配模型下的子序列模式匹配问题(CT-MSeq)可在 $O(nm \log \log n)$ 时间内求解,其中 $n$ 和 $m$ 分别为文本和模式串的长度。本文沿袭此研究方向,并给出以下新结果:(1)针对二元字母表,提出一个 $O(nm)$ 时间的 CT-MSeq 算法;(2)基于正交向量假说(OVH),对于任意常数 $ε> 0$,在字母表大小为 4 的情况下,证明了 CT-MSeq 问题存在 $O((nm)^{1-ε})$ 时间的条件性下界。此外,我们针对两个给定长度为 $n$ 的字符串 $S$ 和 $T$,引入了 CT-匹配下的最长公共子序列新问题(CT-LCS),并呈现以下结果:(3)针对一般有序字母表,提出一个 $O(n^6)$ 时间的 CT-LCS 算法;(4)针对二元字母表,提出一个 $O(n^2 / \log n)$ 时间的 CT-LCS 算法;(5)基于 OVH,对于任意常数 $ε> 0$,在字母表大小为 5 的情况下,证明了 CT-LCS 问题存在 $O(n^{2-ε})$ 时间的条件性下界。