Skip to main content

Order Preserving Pattern Matching on Trees and DAGs

  • Conference paper
  • First Online:
String Processing and Information Retrieval (SPIRE 2017)

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

Included in the following conference series:

Abstract

The order preserving pattern matching (OPPM) problem is, given a pattern string p and a text string t, find all substrings of t which have the same relative orders as p. In this paper, we consider two variants of the OPPM problem where a set of text strings is given as a tree or a DAG. We show that the OPPM problem for a single pattern p of length m and a text tree T of size N can be solved in \(O(m+N)\) time with O(m) working space if the characters of p are drawn from an integer alphabet of polynomial size. The time complexity becomes \(O(m \log m + N)\) if the pattern p is over a general ordered alphabet. We then show that the OPPM problem for a single pattern and a text DAG is NP-complete.

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 EPUB and 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

Notes

  1. 1.

    Simon [14] proposed an O(m)-space Morris-Pratt automaton for exact pattern matching, however, it is unclear if this can be extended to PPM or OPPM.

References

  1. Amir, A., Lewenstein, M., Lewenstein, N.: Pattern matching in hypertext. In: Dehne, F., Rau-Chaplin, A., Sack, J.-R., Tamassia, R. (eds.) WADS 1997. LNCS, vol. 1272, pp. 160–173. Springer, Heidelberg (1997). doi:10.1007/3-540-63307-3_56

    Chapter  Google Scholar 

  2. Amir, A., Lewenstein, M., Lewenstein, N.: Hypertext searching - a survey. In: Language, Culture, Computation. Computing - Theory and Technology - Essays Dedicated to Yaacov Choueka on the Occasion of his 75th Birthday, Part I, pp. 364–381 (2014)

    Google Scholar 

  3. Amir, A., Navarro, G.: Parameterized matching on non-linear structures. Inf. Process. Lett. 109(15), 864–867 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  4. Baeza-Yates, R.A.: Searching subsequences. Theor. Comput. Sci. 78(2), 363–376 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  5. Bose, P., Buss, J.F., Lubiw, A.: Pattern matching for permutations. In: Dehne, F., Sack, J.-R., Santoro, N., Whitesides, S. (eds.) WADS 1993. LNCS, vol. 709, pp. 200–209. Springer, Heidelberg (1993). doi:10.1007/3-540-57155-8_248

    Chapter  Google Scholar 

  6. Chhabra, T., Tarhio, J.: A filtration method for order-preserving matching. Inf. Process. Lett. 116(2), 71–74 (2016)

    Article  MathSciNet  MATH  Google Scholar 

  7. Cho, S., Na, J.C., Park, K., Sim, J.S.: A fast algorithm for order-preserving pattern matching. Inf. Process. Lett. 115(2), 397–402 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  8. Dubiner, M., Galil, Z., Magen, E.: Faster tree pattern matching. J. ACM 41(2), 205–213 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  9. Faro, S., Külekci, M.O.: Efficient algorithms for the order preserving pattern matching problem. In: Dondi, R., Fertin, G., Mauri, G. (eds.) AAIM 2016. LNCS, vol. 9778, pp. 185–196. Springer, Cham (2016). doi:10.1007/978-3-319-41168-2_16

    Chapter  Google Scholar 

  10. Kim, J., Eades, P., Fleischer, R., Hong, S., Iliopoulos, C.S., Park, K., Puglisi, S.J., Tokuyama, T.: Order-preserving matching. Theor. Comput. Sci. 525, 68–79 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  11. Kubica, M., Kulczynski, T., Radoszewski, J., Rytter, W., Walen, T.: A linear time algorithm for consecutive permutation pattern matching. Inf. Process. Lett. 113(12), 430–433 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  12. Morris, J.H., Pratt, V.R.: A linear pattern-matching algorithm. Technical report, 40, University of California, Berkeley (1970)

    Google Scholar 

  13. Park, K., Kim, D.K.: String matching in hypertext. In: Galil, Z., Ukkonen, E. (eds.) CPM 1995. LNCS, vol. 937, pp. 318–329. Springer, Heidelberg (1995). doi:10.1007/3-540-60044-2_51

    Chapter  Google Scholar 

  14. Simon, I.: String matching algorithms and automata. In: Karhumäki, J., Maurer, H., Rozenberg, G. (eds.) Results and Trends in Theoretical Computer Science. LNCS, vol. 812, pp. 386–395. Springer, Heidelberg (1994). doi:10.1007/3-540-58131-6_61

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Temma Nakamura .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Cite this paper

Nakamura, T., Inenaga, S., Bannai, H., Takeda, M. (2017). Order Preserving Pattern Matching on Trees and DAGs. In: Fici, G., Sciortino, M., Venturini, R. (eds) String Processing and Information Retrieval. SPIRE 2017. Lecture Notes in Computer Science(), vol 10508. Springer, Cham. https://doi.org/10.1007/978-3-319-67428-5_23

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-67428-5_23

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-67427-8

  • Online ISBN: 978-3-319-67428-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics