Skip to main content

A Simple Streaming Bit-Parallel Algorithm for Swap Pattern Matching

  • Conference paper
  • First Online:
Mathematical Aspects of Computer and Information Sciences (MACIS 2017)

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

  • 574 Accesses

Abstract

The pattern matching problem with swaps is to find all occurrences of a pattern in a text while allowing the pattern to swap adjacent symbols. The goal is to design fast matching algorithm that takes advantage of the bit parallelism of bitwise machine instructions and has only streaming access to the input. We introduce a new approach to solve this problem based on the graph theoretic model and compare its performance to previously known algorithms. We also show that an approach using deterministic finite automata cannot achieve similarly efficient algorithms. Furthermore, we describe a fatal flaw in some of the previously published algorithms based on the same model. Finally, we provide experimental evaluation of our algorithm on real-world data.

V. Blažej—Supported by the SGS CTU project SGS17/209/OHK3/3T/18.

O. Suchý—Supported by grant 17-20065S of the Czech Science Foundation.

T. Valla—Supported by the Centre of Excellence – Inst. for Theor. Comp. Sci. 79 (project P202/12/G061 of the Czech Science Foundation.).

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

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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

Similar content being viewed by others

Notes

  1. 1.

    http://users.fit.cvut.cz/blazeva1/gsm.html.

  2. 2.

    To simplify the analysis, we assume that \(\log t < w\), i.e., the iteration counter fits into one memory cell.

  3. 3.

    ftp://ftp.ensembl.org/pub/release-90/fasta/homo_sapiens/dna/.

  4. 4.

    http://www.data-compression.info/Corpora/ProteinCorpus/.

  5. 5.

    http://corpus.canterbury.ac.nz/descriptions/large/bible.html.

References

  1. Ahmed, P., Iliopoulos, C.S., Islam, A.S., Rahman, M.S.: The swap matching problem revisited. Theoret. Comput. Sci. 557, 34–49 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  2. Amir, A., Aumann, Y., Landau, G.M., Lewenstein, M., Lewenstein, N.: Pattern matching with swaps. J. Algorithms 37(2), 247–266 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  3. Amir, A., Cole, R., Hariharan, R., Lewenstein, M., Porat, E.: Overlap matching. Inf. Comput. 181(1), 57–74 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  4. Amir, A., Landau, G.M., Lewenstein, M., Lewensteint, N.: Efficient special cases of pattern matching with swaps. Inform. Process. Lett. 68(3), 125–132 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  5. Antoniou, P., Iliopoulos, C.S., Jayasekera, I., Rahman, M.S.: Implementation of a swap matching algorithm using a graph theoretic model. In: Elloumi, M., Küng, J., Linial, M., Murphy, R.F., Schneider, K., Toma, C. (eds.) BIRD 2008. CCIS, vol. 13, pp. 446–455. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-70600-7_34

    Chapter  Google Scholar 

  6. Blažej, V., Suchý, O., Valla, T.: A simple streaming bit-parallel algorithm for swap pattern matching. CoRR abs/1606.04763 (2017). http://arxiv.org/abs/1606.04763

  7. Campanelli, M., Cantone, D., Faro, S.: A new algorithm for efficient pattern matching with swaps. In: Fiala, J., Kratochvíl, J., Miller, M. (eds.) IWOCA 2009. LNCS, vol. 5874, pp. 230–241. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-10217-2_24

    Chapter  Google Scholar 

  8. Cantone, D., Faro, S.: Pattern matching with swaps for short patterns in linear time. In: Nielsen, M., Kučera, A., Miltersen, P.B., Palamidessi, C., Tůma, P., Valencia, F. (eds.) SOFSEM 2009. LNCS, vol. 5404, pp. 255–266. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-540-95891-8_25

    Chapter  Google Scholar 

  9. Charras, C., Lecroq, T.: Handbook of Exact String Matching Algorithms. King’s College Publications, London (2004)

    MATH  Google Scholar 

  10. Chedid, F.: On pattern matching with swaps. In: AICCSA 2013, pp. 1–5. IEEE (2013)

    Google Scholar 

  11. Faro, S.: Swap matching in strings by simulating reactive automata. In: Proceedings of the Prague Stringology Conference 2013, pp. 7–20. CTU in Prague (2013)

    Google Scholar 

  12. Fredriksson, K., Giaquinta, E.: On a compact encoding of the swap automaton. Inf. Proces. Lett. 114(7), 392–396 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  13. Holub, J.: Personal communication (2015)

    Google Scholar 

  14. Iliopoulos, C.S., Rahman, M.S.: A new model to solve the swap matching problem and efficient algorithms for short patterns. In: Geffert, V., Karhumäki, J., Bertoni, A., Preneel, B., Návrat, P., Bieliková, M. (eds.) SOFSEM 2008. LNCS, vol. 4910, pp. 316–327. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-77566-9_27

    Chapter  Google Scholar 

  15. Lewin, B.: Genes for SMA: multum in parvo. Cell 80(1), 1–5 (1995)

    Article  Google Scholar 

  16. Muthukrishnan, S.: New results and open problems related to non-standard stringology. In: Galil, Z., Ukkonen, E. (eds.) CPM 1995. LNCS, vol. 937, pp. 298–317. Springer, Heidelberg (1995). https://doi.org/10.1007/3-540-60044-2_50

    Chapter  Google Scholar 

  17. Wagner, R.A., Lowrance, R.: An extension of the string-to-string correction problem. J. ACM 22(2), 177–183 (1975)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Václav Blažej .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Blažej, V., Suchý, O., Valla, T. (2017). A Simple Streaming Bit-Parallel Algorithm for Swap Pattern Matching. In: Blömer, J., Kotsireas, I., Kutsia, T., Simos, D. (eds) Mathematical Aspects of Computer and Information Sciences. MACIS 2017. Lecture Notes in Computer Science(), vol 10693. Springer, Cham. https://doi.org/10.1007/978-3-319-72453-9_28

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-72453-9_28

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-72452-2

  • Online ISBN: 978-3-319-72453-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics