Approximate Cartesian Tree Matching with One Difference
Bastien Auvray, Julien David, Samah Ghazawi, Richard Groult, Gad M. Landau, Thierry Lecroq

TL;DR
This paper introduces the first algorithms for approximate Cartesian tree pattern matching with one difference, enabling efficient identification of similar patterns in texts with minimal differences.
Contribution
It presents a generic algorithm for approximate Cartesian tree matching with one difference and an automaton-based method extendable to multiple differences.
Findings
Algorithm has O(nM) worst-case complexity.
Average-case complexity is linear for several random models.
Automaton-based approach can handle more than one difference.
Abstract
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 algorithms for solving approximate Cartesian tree pattern matching with one difference given a pattern of length m and a text of length n. We present a generic algorithm that find all the factors of the text that have the same Cartesian tree of the pattern with one difference, using different notions of differences. We show that this algorithm has a O(nM) worst-case complexity and that, for several random models, the algorithm has a linear average-case complexity. We also present an automaton based algorithm, adapting [PALP19], that can be generalized to deal with more than one difference.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAlgorithms and Data Compression · Natural Language Processing Techniques · semigroups and automata theory
