Skip to main content

Bit-Parallel Tree Pattern Matching Algorithms for Unordered Labeled Trees

  • Conference paper
Algorithms and Data Structures (WADS 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5664))

Included in the following conference series:

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).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Baeza-Yates, R., Gonnet, G.H.: A New Approach to Text Searching. Communications of the ACM 35(10), 74–82 (1992)

    Article  Google Scholar 

  2. Chauve, C.: Tree pattern matching with a more general notion of occurrence of the pattern. Information Processing Letters 82, 197–201 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  3. Cole, R., Hariharan, R.: Verifying Candidate Matches in Sparse and Wildcard Matching. In: Proc. of the 34th ACM STOC, pp. 592–601 (2002)

    Google Scholar 

  4. Cole, R., Hariharan, R.: Tree Pattern Matching to Subset Matching in Linear Time. SIAM J. Comput. 32(4), 1056–1066 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  5. Dubiner, M., Galil, Z., Magen, E.: Faster Tree Pattern Matching. Journal of the ACM 41(2), 205–213 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  6. 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)

    Chapter  Google Scholar 

  7. Hoffman, C.M., O’Donnell, M.J.: Pattern matching in trees. Journal of the ACM 29(1), 68–95 (1982)

    Article  MathSciNet  MATH  Google Scholar 

  8. 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)

    Article  MathSciNet  MATH  Google Scholar 

  9. Kilpeläinen, P., Mannila, H.: Ordered and Unordered Tree Inclusion. SIAM J. Comput. 24(2), 340–356 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  10. Leeuweno, J.V.: Graph Algorithms. In: Leeuwen, J.V. (ed.) Handbook of Theoretical Computer Science, Elsevier Science Pub., Amsterdam (1990)

    Google Scholar 

  11. Shamir, R., Tsur, D.: Faster Subtree Isomorphism. J. of Algorithms 33, 267–280 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  12. Yao, J.T., Zhang, M.: A Fast Tree Pattern Matching Algorithm for XML Query. In: Proc. of the WI 2004, pp. 235–241 (2004)

    Google Scholar 

  13. 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)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics