Abstract
The following tree pattern matching problem is considered: Given two unordered labeled trees P and T, find all occurrences of P in T. Here P and T are called a pattern tree and a target tree, respectively. We first introduce a new problem called the pseudo-tree pattern matching problem. Then we show two efficient bit-parallel algorithms for the pseudo-tree pattern matching problem. One runs in \(O(L_P\cdot n\cdot l\cdot \lceil \frac{h}{W}\rceil)\) time and \(O(n\cdot l\cdot \lceil \frac{h}{W}\rceil)\) space, and another one runs in \(O((L_P\cdot n+h\cdot 2^l)\cdot \lceil \frac{h\cdot l}{W}\rceil)\) time and \(O((n+h\cdot 2^l)\cdot \lceil \frac{h\cdot l}{W}\rceil)\) space, where n is the number of nodes in T, h and l are the height of P and the number of leaves of P, respectively, and W is the length of a computer-word. The parameter L P , called a recursive level of P, is defined to be the number of occurrences of the same label on a path from the root to a leaf. Hence we have L P ≤ h. Finally, we give an algorithm to extract all occurrences from pseud-occurrences in \(O(n\cdot L_P\cdot l^{3/2})\) time and O(n·L P ·l) space.
This research was supported by the Ministry of Education, Sports, Culture, Science and Technology, Grant-in-Aid for Scientific Research (C).
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Baeza-Yates, R., Gonnet, G.H.: A New Approach to Text Searching. Communications of the ACM 35(10), 74–82 (1992)
Chauve, C.: Tree pattern matching with a more general notion of occurrence of the pattern. Information Processing Letters 82, 197–201 (2001)
Cole, R., Hariharan, R.: Verifying Candidate Matches in Sparse and Wildcard Matching. In: Proc. of the 34th ACM STOC, pp. 592–601 (2002)
Cole, R., Hariharan, R.: Tree Pattern Matching to Subset Matching in Linear Time. SIAM J. Comput. 32(4), 1056–1066 (2003)
Dubiner, M., Galil, Z., Magen, E.: Faster Tree Pattern Matching. Journal of the ACM 41(2), 205–213 (1994)
Götz, M., Koch, C., Martens, W.: Efficient Algorithms for the Tree Homeomorphism Problem. In: Arenas, M., Schwartzbach, M.I. (eds.) DBPL 2007. LNCS, vol. 4797, pp. 17–31. Springer, Heidelberg (2007)
Hoffman, C.M., O’Donnell, M.J.: Pattern matching in trees. Journal of the ACM 29(1), 68–95 (1982)
Hopcroft, J.E., Karp, R.M.: An n 5/2 Algorithm for Maximum Matchings in Bipartite Graphs. SIAM J. Comput. 2(4), 225–231 (1973)
Kilpeläinen, P., Mannila, H.: Ordered and Unordered Tree Inclusion. SIAM J. Comput. 24(2), 340–356 (1995)
Leeuweno, J.V.: Graph Algorithms. In: Leeuwen, J.V. (ed.) Handbook of Theoretical Computer Science, Elsevier Science Pub., Amsterdam (1990)
Shamir, R., Tsur, D.: Faster Subtree Isomorphism. J. of Algorithms 33, 267–280 (1999)
Yao, J.T., Zhang, M.: A Fast Tree Pattern Matching Algorithm for XML Query. In: Proc. of the WI 2004, pp. 235–241 (2004)
Zezula, P., Mandreoli, F., Martoglia, R.: Tree Signatures and Unordered XML Pattern Matching. In: Van Emde Boas, P., Pokorný, J., Bieliková, M., Štuller, J. (eds.) SOFSEM 2004. LNCS, vol. 2932, pp. 122–139. Springer, Heidelberg (2004)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Yamamoto, H., Takenouchi, D. (2009). Bit-Parallel Tree Pattern Matching Algorithms for Unordered Labeled Trees . In: Dehne, F., Gavrilova, M., Sack, JR., Tóth , C.D. (eds) Algorithms and Data Structures. WADS 2009. Lecture Notes in Computer Science, vol 5664. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03367-4_48
Download citation
DOI: https://doi.org/10.1007/978-3-642-03367-4_48
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-03366-7
Online ISBN: 978-3-642-03367-4
eBook Packages: Computer ScienceComputer Science (R0)