ORDERED AND UNORDERED TREE INCLUSION

被引:114
作者
KILPELAINEN, P
MANNILA, H
机构
关键词
TREES; PATTERN MATCHING; DYNAMIC PROGRAMMING; NP-COMPLETENESS;
D O I
10.1137/S0097539791218202
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
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. The 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 also considered and a proof of its NP-completeness is given. An algorithm 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 constant, and in polynomial time if they are O(log\T\).
引用
收藏
页码:340 / 356
页数:17
相关论文
共 26 条
[1]  
[Anonymous], P 30 FOCS
[2]  
[Anonymous], 1971, STOC 71, DOI DOI 10.1145/800157.805047
[3]  
Bollobas B., 1986, COMBINATORICA
[4]   ON THE NUMBER OF DATABASES AND CLOSURE OPERATIONS [J].
BUROSCH, G ;
DEMETROVICS, J ;
KATONA, GOH ;
KLEITMAN, DJ ;
SAPOZHENKO, AA .
THEORETICAL COMPUTER SCIENCE, 1991, 78 (02) :377-381
[5]  
Dubiner M., 1990, Proceedings. 31st Annual Symposium on Foundations of Computer Science (Cat. No.90CH2925-6), P145, DOI 10.1109/FSCS.1990.89533
[6]  
Garey M.R., 1979, COMPUTERS INTRACTABI, V174
[7]  
GONNET GH, 1987, 13TH P INT C VER LAR, P339
[8]   PATTERN-MATCHING IN TREES [J].
HOFFMANN, CM ;
ODONNELL, MJ .
JOURNAL OF THE ACM, 1982, 29 (01) :68-95
[9]   THE NP-COMPLETENESS COLUMN - AN ONGOING GUIDE [J].
JOHNSON, DS .
JOURNAL OF ALGORITHMS, 1987, 8 (02) :285-303
[10]  
KILPELAINEN P, 1992, THESIS U HELSINKI