TY - JOUR
T1 - Tree template matching in unranked ordered trees
AU - Christou, Michalis
AU - Flouri, Tomáš
AU - Iliopoulos, Costas S.
AU - Janoušek, Jan
AU - Melichar, Bořivoj
AU - Pissis, Solon P.
AU - Žd'Árek, Jan
PY - 2013/5/1
Y1 - 2013/5/1
N2 - We consider the problem of tree template matching, a type of tree pattern matching, where the tree templates have some of their leaves denoted as "don't care", and propose a solution based on the bottom-up technique. Specifically, we transform the tree pattern matching problem for unranked ordered trees to a string matching problem, by transforming the tree template and the subject tree to strings representing their postfix bar notation, and then propose a table-driven algorithm to solve it. The proposed algorithm is divided into two phases: the preprocessing and the searching phase. The tree template is preprocessed once, and the searching phase can be applied to many subject trees, without the need of preprocessing the tree template again. Although we prove that the space required for preprocessing is exponential in the size of the tree template in the worst case, we show that for a specific class of tree templates, the space required is linear in the size of the tree template. The time for the searching phase is linear in the size of the subject tree in the worst case. Thus, the algorithm is asymptotically optimal when one needs to search for a given tree template, of constant to logarithmic size, in many subject trees.
AB - We consider the problem of tree template matching, a type of tree pattern matching, where the tree templates have some of their leaves denoted as "don't care", and propose a solution based on the bottom-up technique. Specifically, we transform the tree pattern matching problem for unranked ordered trees to a string matching problem, by transforming the tree template and the subject tree to strings representing their postfix bar notation, and then propose a table-driven algorithm to solve it. The proposed algorithm is divided into two phases: the preprocessing and the searching phase. The tree template is preprocessed once, and the searching phase can be applied to many subject trees, without the need of preprocessing the tree template again. Although we prove that the space required for preprocessing is exponential in the size of the tree template in the worst case, we show that for a specific class of tree templates, the space required is linear in the size of the tree template. The time for the searching phase is linear in the size of the subject tree in the worst case. Thus, the algorithm is asymptotically optimal when one needs to search for a given tree template, of constant to logarithmic size, in many subject trees.
KW - Algorithms on strings
KW - Tree pattern matching
KW - Tree template matching
UR - http://www.scopus.com/inward/record.url?scp=84878221541&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84878221541&partnerID=8YFLogxK
U2 - 10.1016/j.jda.2013.02.001
DO - 10.1016/j.jda.2013.02.001
M3 - Article
AN - SCOPUS:84878221541
VL - 20
SP - 51
EP - 60
JO - Journal of Discrete Algorithms
JF - Journal of Discrete Algorithms
SN - 1570-8667
ER -