论文标题

笛卡尔树子级匹配

Cartesian Tree Subsequence Matching

论文作者

Oizumi, Tsubasa, Kai, Takeshi, Mieno, Takuya, Inenaga, Shunsuke, Arimura, Hiroki

论文摘要

Park等。 [TCS 2020]观察到,两个(数值)字符串之间的相似性可以被笛卡尔树捕获:弦的笛卡尔树是一棵二进制树,是通过将字符串的最小值作为树的根来递归构造的。如果其笛卡尔树是同构的,则据说两个符合笛卡尔树的弦。 Park等。 [TCS 2020]介绍了以下笛卡尔树的子字符串匹配(CTMSTR)问题:给定一个文本字符串$ t $长度$ n $和长度$ m $的图案字符串,找到每个连续的子字符串$ s = t [i..j] $ s $ t $ t $ t $ s $ s $ s $ s $ s $ s $和$ p $ cartesian-cartesian-tree匹配。他们展示了如何以$ \ tilde {o}(n+m)$时间解决此问题。在本文中,我们介绍了笛卡尔树子序列匹配(CTMSEQ)问题,该问题要求找到每个最小的子字符串$ s = t [i..j] $ t $ of $ t $的$,这样$ s $ s $包含cartesian-tree cartesian-tree匹配$ p $ p $。我们证明可以在$ O(m n p(n))$时间中有效解决CTMSEQ问题,其中$ p(n)$表示动态前任查询的更新/查询时间。通过使用合适的动态前任数据结构,我们获得了$ O(Mn \ log \ log n)$ - 时间和$ O(N \ log M)$ - 用于CTMSEQ的空间解决方案。这将CTMSEQ与密切相关的订单保留子序列匹配(OPMSEQ)进行了对比,该匹配(OPMSEQ)被Bose等人证明是NP-HARD。 [IPL 1998]。

Park et al. [TCS 2020] observed that the similarity between two (numerical) strings can be captured by the Cartesian trees: The Cartesian tree of a string is a binary tree recursively constructed by picking up the smallest value of the string as the root of the tree. Two strings of equal length are said to Cartesian-tree match if their Cartesian trees are isomorphic. Park et al. [TCS 2020] introduced the following Cartesian tree substring matching (CTMStr) problem: Given a text string $T$ of length $n$ and a pattern string of length $m$, find every consecutive substring $S = T[i..j]$ of a text string $T$ such that $S$ and $P$ Cartesian-tree match. They showed how to solve this problem in $\tilde{O}(n+m)$ time. In this paper, we introduce the Cartesian tree subsequence matching (CTMSeq) problem, that asks to find every minimal substring $S = T[i..j]$ of $T$ such that $S$ contains a subsequence $S'$ which Cartesian-tree matches $P$. We prove that the CTMSeq problem can be solved efficiently, in $O(m n p(n))$ time, where $p(n)$ denotes the update/query time for dynamic predecessor queries. By using a suitable dynamic predecessor data structure, we obtain $O(mn \log \log n)$-time and $O(n \log m)$-space solution for CTMSeq. This contrasts CTMSeq with closely related order-preserving subsequence matching (OPMSeq) which was shown to be NP-hard by Bose et al. [IPL 1998].

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源