Approximate Cartesian Tree Matching: an Approach Using Swaps

06/28/2023
by   Bastien Auvray, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/22/2019

Cartesian Tree Matching and Indexing

We introduce a new metric of match, called Cartesian tree matching, whic...
research
10/26/2021

Linear Approximate Pattern Matching Algorithm

Pattern matching is a fundamental process in almost every scientific dom...
research
02/27/2022

Parallel algorithm for pattern matching problems under substring consistent equivalence relations

Given a text and a pattern over an alphabet, the pattern matching proble...
research
02/09/2018

Self-Bounded Prediction Suffix Tree via Approximate String Matching

Prediction suffix trees (PST) provide an effective tool for sequence mod...
research
03/01/2020

An Algorithm for Consensus Trees

We consider the tree consensus problem, an important problem in bioinfor...
research
06/02/2020

Efficient tree-structured categorical retrieval

We study a document retrieval problem in the new framework where D text ...
research
02/19/2020

Fast and linear-time string matching algorithms based on the distances of q-gram occurrences

Given a text T of length n and a pattern P of length m, the string match...

Please sign up or login with your details

Forgot password? Click here to reset