arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.16065cs.DS
收藏

近似笛卡尔树匹配:一种使用交换操作的方法

Approximate Cartesian Tree Matching: an Approach Using Swaps

Bastien Auvray, Julien David, Richard Groult, Thierry Lecroq

AI总结:

本文首次研究带一次相邻交换的近似笛卡尔树模式匹配,提出两种算法,分别以 Theta(mn) 时间和 O((m^2 + n)log m) 时间找出文本中与模式在一次换位后具有相同笛卡尔树的所有因子。

摘要:

笛卡尔树模式匹配是指找出文本中所有与给定模式具有相同笛卡尔树的因子。对于精确匹配情形,已有理论和实践上的解决方案。本文提出了首个用于求解近似笛卡尔树模式匹配的算法。我们考虑带一次交换的笛卡尔树模式匹配:给定长度为 m 的模式和长度为 n 的文本,我们提出两种算法,用于找出文本中所有在相邻两个符号发生一次换位后与模式具有相同笛卡尔树的因子。第一种算法利用一次交换后笛卡尔树线性表示(称为父距离)的刻画,运行时间为 Theta(mn),空间为 Theta(m)。第二种算法生成在一次交换后与模式具有相同笛卡尔树的所有序列的父距离表,运行时间为 O((m^2 + n)log m),空间复杂度为 O(m^2)。

英文摘要:

Cartesian tree pattern matching consists of finding all the factors of a text that have the same Cartesian tree than a given pattern. There already exist theoretical and practical solutions for the exact case. In this paper, we propose the first algorithm for solving approximate Cartesian tree pattern matching. We consider Cartesian tree pattern matching with one swap: given a pattern of length m and a text of length n we present two algorithms that find all the factors of the text that have the same Cartesian tree of the pattern after one transposition of two adjacent symbols. The first algorithm uses a characterization of a linear representation of the Cartesian trees called parent-distance after one swap and runs in time Theta(mn) using Theta(m) space. The second algorithm generates all the parent-distance tables of sequences that have the same Cartesian tree than the pattern after one swap. It runs in time O((m^2 + n)log m) and has O(m^2) space complexity.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑