Abstract
We consider the following problem: Given ordered albeled trees S and T, can S be obtained from T by deleting nodes? Deletion of the root node u of a subtree with children 〈T 1, ..., T n 〉 means replacing the subtree by the trees T 1, ..., T n . The problem is motivated by the study of query languages for structured text data bases. The simple solutions to this problem require exponential time. We give an algorithm based on dynamic programming requiring O(|S||T|) time and space.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Beeri, C., A formal approach to object-oriented databases. Data & Knowledge Engineering 5 (1990), 353–382.
Cai, J., Paige, R., Tarjan, R., More efficient bottom-up tree pattern matching. In: Proc. of the 15th Colloqium on Trees in Algebra and Programming (CAAP'90), p. 72–86.
Dubiner, M., Galil, Z., Magen, E., Faster tree pattern matching. In: Proc. of the Symposium on Foundations of Computer Science (FOCS'90), p. 145–150.
Gonnet, G., Tompa, F., Mind your grammar — a new approach to text databases. In: Proc. of the Conference on Very Large Data Bases (VLDB'87), p. 339–346.
Hoffman, C.M., O'Donnell, M.J., Pattern matching in trees. J. ACM, 29, 1 (January 1982), 68–95.
Johnson, D.S., The NP-completeness column: an ongoing guide. J. Algorithms 8 (1987), 285–303.
Hirschberg, D.S., A linear space algorithm for computing maximal common subsequences. CACM 18, 6 (June 1975), 341–343.
Kilpeläinen, P., Query languages for structured text databases. Ph.D. Thesis, University of Helsinki; in preparation.
Knuth, D.E., The Art of Computer Programming, Vol. 1. Addison-Wesley 1969.
Kosaraju, S.R., Efficient tree pattern matching. In: Proc. of the Symposium on Foundations of Computer Science (FOCS'89), p. 178–183.
Mannila, H., Räihä, K.-J., On query languages for the p-string data model. In: Information Modelling and Knowledge Bases, H. Kangassalo, S. Ohsuga, H. Jaakkola (eds.), IOS Press, 1990, p. 469–482.
Reyner, S.W., An analysis of a good algorithm for the subtree problem. SIAM J. Computing 6, 4 (December 1977), 730–732.
Robertson, N., Seymour, P.D., Graph Minors. II. Algorithmic aspects of tree-width. J. Algorithms 7 (1986), 309–322.
Shasha, D., Zhang, K., Fast algorithms for the unit cost editing distance between trees. J. Algorithms 11 (1990), 581–621.
Tai, K.-C., The tree-to-tree correction problem. J. ACM 26, 3 (July 1979), 422–433.
Zhang, K., Shasha, D., Simple fast algorithms for the editing distance between trees and related problems. SIAM Journal of Computing 18, 6 (December 1989), 1245–1262.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kilpeläinen, P., Mannila, H. (1991). The tree inclusion problem. In: Abramsky, S., Maibaum, T.S.E. (eds) TAPSOFT '91. CAAP 1991. Lecture Notes in Computer Science, vol 493. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-53982-4_12
Download citation
DOI: https://doi.org/10.1007/3-540-53982-4_12
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-53982-7
Online ISBN: 978-3-540-46563-8
eBook Packages: Springer Book Archive