ORDERED AND UNORDERED TREE INCLUSION

Citation
P. Kilpelainen et H. Mannila, ORDERED AND UNORDERED TREE INCLUSION, SIAM journal on computing, 24(2), 1995, pp. 340-356
Citations number
27
Categorie Soggetti
Computer Sciences","Computer Science Theory & Methods",Mathematics
Journal title
ISSN journal
00975397
Volume
24
Issue
2
Year of publication
1995
Pages
340 - 356
Database
ISI
SICI code
0097-5397(1995)24:2<340:OAUTI>2.0.ZU;2-L
Abstract
The following tree-matching problem is considered: Given labeled trees P and T, can P be obtained from T by deleting nodes? Deleting a node It entails removing all edges incident to u and, if u has a parent v, replacing the edge from v to u by edges from v to the children of u. T he problem is motivated by the study of query languages for structured text databases. Simple solutions to this problem require exponential time. For ordered trees an algorithm is presented that requires O(\P\\ T\) time and space. The corresponding problem for unordered trees is a lso considered and a proof of its NP-completeness is given. An algorit hm is presented for the unordered problem. This algorithm works in O(\ P\\T\) time if the out-degrees of the nodes in P are bounded by a cons tant, and in polynomial time if they are O(log\T\).