Abstract
In the problem of ordered tree inclusion two ordered labeled trees P and T are given, and the pattern tree P matches the target tree T at a node x, if there exists a one-to-one map f from the nodes of P to the nodes of T which preserves the labels, the ancestor relation and the left-to-right ordering of the nodes. In [7] Kilpeläinen and Mannila give an algorithm that solves the problem of ordered tree inclusion in time and space Θ(∣P∣ · ∣T∣). In this paper we present a new algorithm for the ordered tree inclusion problem with time complexity O(∣Σ p ∣ · ∣T∣ +#matches · DEPTH(T)), where Σ p is the alphabet of the labels of the pattern tree and #matches is the number of pairs (v, w) ∈ P * T with LABEL(v)=LABEL(w). The space complexity of our algorithm is O ∣gS p ∣ · ∣T∣ + #matches).
This work was supported by the DFG under grant Bl 320-1
Preview
Unable to display preview. Download preview PDF.
References
M. Dubiner, Z. Galil and E. Magen, Faster Tree Pattern Matching, Proc. 31st FOCS (1990), pp. 145–150.
G. H. Gonnet and F. Wm. Tompa, Mind your Grammar-a New Approach to Text Databases, Proc. of the Conf. on Very Large Databases 1987 (VLDB'87), pp. 339–346.
C. M. Hoffman and M. J. O'Donnell, Pattern Matching in Trees, JACM 29 (1982), pp. 68–95.
P. Kilpeläinen, G. Linden, H. Mannila and E. Nikunen, A Structured Document Database System, in R. Furuta (ed.), EP'90-Proc. of the Int. Conf. on Electronic Publishing, Document Manipulation & Typography, The Cambridge Series on Electronic Publishing, Cambridge University Press, 1990.
P. Kilpeläinen and H. Mannila, Retrieval from Hierarchical Texts by Partial Patterns, in R. Korfhage, E. Rasmussen and P. Willet (eds.), SIGIR '93-Proc. of the 16th Ann. Int. ACM SIGIR Conf. on Research and Development in Informational Retrieval 1993, pp. 214–222.
P. Kilpeläinen and H. Mannila, Query Primitives for Tree-Structured Data, Proc. 5th CPM (1994), pp. 213–225.
P. Kilpeläinen and H. Mannila, Ordered and Unordered Tree Inclusion, SIAM J. Comput. 24 (1995), pp. 340–356.
D. E. Knuth, The Art of Computer Programming, Vol. 1, Addison-Wesley, Reading, MA, 1969, p. 347.
S. R. Kosaraju, Efficient Tree Pattern Matching, Proc. 30th FOCS (1989), pp. 178–183.
K. Zhang and D. Shasha, Simple Fast Algorithms for the Editing Distance between Trees and Related Problems, SIAM J. Comput. 18 (1989), pp. 1245–1262.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Richter, T. (1997). A new algorithm for the ordered tree inclusion problem. In: Apostolico, A., Hein, J. (eds) Combinatorial Pattern Matching. CPM 1997. Lecture Notes in Computer Science, vol 1264. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-63220-4_57
Download citation
DOI: https://doi.org/10.1007/3-540-63220-4_57
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-63220-7
Online ISBN: 978-3-540-69214-0
eBook Packages: Springer Book Archive