Forward linearised tree pattern matching using tree pattern border array
Autoři
Rok
2024
Publikováno
Discrete Applied Mathematics. 2024, 352 33-43. ISSN 1872-6771.
Typ
Článek
Anotace
We define a tree pattern border array as a property of linearised trees analogous to border arrays from the string domain. We consider tree patterns with node wildcards and subtree wildcards. Then we use the tree pattern border array in a new forward tree pattern matching algorithm for ordered ranked trees. The algorithm finds all occurrences of a single linearised tree pattern in a linearised input tree. As with the classical Morris–Pratt algorithm for searching in strings, the tree pattern border array is used to determine shift lengths in the searching phase of the tree pattern matching algorithm. We compare this new algorithm with the best performing previously existing algorithms based on backward linearised tree pattern matching algorithms, (non-)linearised tree pattern matching algorithms using finite tree automata or stringpath matchers. We show that our new algorithm outperforms other tree pattern matching algorithms in single tree pattern matching.
Forward Linearised Tree Pattern Matching Using Tree Pattern Border Array
Autoři
Rok
2020
Publikováno
Proceedings of the Prague Stringology Conference 2020. Praha: Czech Technical University in Prague, 2020. p. 61-73. ISBN 978-80-01-06749-9.
Typ
Stať ve sborníku
Anotace
We define a tree pattern border array as a property of linearised trees analogous to border arrays from the string domain. We use it to define a new forward tree pattern matching algorithm for ordered trees, which finds all occurrences of a single given linearised tree pattern in a linearised input tree. As with the classical Morris-Pratt algorithm, the tree pattern border array is used to determine shift lengths in the matching phase of the tree pattern matching algorithm.
We compare the new algorithm with the best performing previously existing algorithms based on backward linearised tree pattern matching algorithms, (non-)linearised tree pattern matching algorithms using finite tree automata or stringpath matchers. We show that the presented algorithm outperforms these for single tree pattern matching.