Skip to main content

Computing Longest Single-arm-gapped Palindromes in a String

  • Conference paper
  • First Online:

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

Abstract

We introduce new types of approximate palindromes called single-arm-gapped palindromes (SAGPs). A SAGP contains a gap in either its left or right arm, which is in the form of either \(wguc u^R w^R\) or \(wuc u^Rgw^R\), where w and u are non-empty strings, \(w^R\) and \(u^R\) are their reversed strings respectively, g is a gap, and c is either a single character or the empty string. We classify SAGPs into two groups: those which have \(ucu^R\) as a maximal palindrome (type-1), and the others (type-2). We propose several algorithms to compute all type-1 SAGPs with longest arms occurring in a given string using suffix arrays, and them a linear-time algorithm based on suffix trees. We also show how to compute type-2 SAGPs with longest arms in linear time. We perform some preliminary experiments to evaluate practical performances of the proposed methods.

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

Buying options

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

Learn about institutional subscriptions

Notes

  1. 1.

    We modified a van Emde Boas tree implementation from https://code.google.com/archive/p/libveb/ so that it works with Visual C++.

References

  1. Apostolico, A., Breslauer, D., Galil, Z.: Parallel detection of all palindromes in a string. Theor. Comput. Sci. 141(1&2), 163–173 (1995)

    Article  MATH  Google Scholar 

  2. Bender, M.A., Farach-Colton, M.: The LCA problem revisited. In: Gonnet, G.H., Viola, A. (eds.) LATIN 2000. LNCS, vol. 1776, pp. 88–94. Springer, Heidelberg (2000). doi:10.1007/10719839_9

    Chapter  Google Scholar 

  3. Droubay, X., Pirillo, G.: Palindromes and sturmian words. Theor. Comput. Sci. 223(1–2), 73–85 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  4. van Emde Boas, P.: Preserving order in a forest in less than logarithmic time. In: FOCS, pp. 75–84 (1975)

    Google Scholar 

  5. Farach-Colton, M., Ferragina, P., Muthukrishnan, S.: On the sorting-complexity of suffix tree construction. J. ACM 47(6), 987–1011 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  6. Fujishige, Y., Nakamura, M., Inenaga, S., Bannai, H., Takeda, M.: Finding gapped palindromes online. In: Mäkinen, V., Puglisi, S.J., Salmela, L. (eds.) IWOCA 2016. LNCS, vol. 9843, pp. 191–202. Springer, Heidelberg (2016). doi:10.1007/978-3-319-44543-4_15

    Chapter  Google Scholar 

  7. Gawrychowski, P., Tomohiro, I., Inenaga, S., Köppl, D., Manea, F.: Efficiently finding all maximal \(\alpha \)-gapped repeats. In: STACS 2016, pp. 39:1–39:14 (2016)

    Google Scholar 

  8. Glen, A., Justin, J., Widmer, S., Zamboni, L.Q.: Palindromic richness. Eur. J. Comb. 30(2), 510–531 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  9. Gusfield, D.: Algorithms on Strings, Trees, and Sequences. Cambridge University Press, New York (1997)

    Book  MATH  Google Scholar 

  10. Hsu, P.H., Chen, K.Y., Chao, K.M.: Finding all approximate gapped palindromes. Int. J. Found. Comput. Sci. 21(6), 925–939 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  11. Kärkkäinen, J., Sanders, P., Burkhardt, S.: Linear work suffix array construction. J. ACM 53(6), 918–936 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  12. Kasai, T., Lee, G., Arimura, H., Arikawa, S., Park, K.: Linear-time longest-common-prefix computation in suffix arrays and its applications. In: Amir, A. (ed.) CPM 2001. LNCS, vol. 2089, pp. 181–192. Springer, Heidelberg (2001). doi:10.1007/3-540-48194-X_17

    Chapter  Google Scholar 

  13. Kolpakov, R., Kucherov, G.: Searching for gapped palindromes. Theor. Comput. Sci. 410(51), 5365–5373 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  14. Manacher, G.K.: A new linear-time on-line algorithm for finding the smallest initial palindrome of a string. J. ACM 22(3), 346–351 (1975)

    Article  MATH  Google Scholar 

  15. Manber, U., Myers, E.W.: Suffix arrays: a new method for on-line string searches. SIAM J. Comput. 22(5), 935–948 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  16. Shi, Y.Z., Wang, F.H., Wu, Y.Y., Tan, Z.J.: A coarse-grained model with implicit salt for RNAs: predicting 3D structure, stability and salt effect. J. Chem. Phys. 141(10), 105102 (2014)

    Article  Google Scholar 

  17. Weiner, P.: Linear pattern matching algorithms. In: 14th Annual Symposium on Switching and Automata Theory, pp. 1–11 (1973)

    Google Scholar 

  18. Westbrook, J.: Fast incremental planarity testing. In: Kuich, W. (ed.) ICALP 1992. LNCS, vol. 623, pp. 342–353. Springer, Heidelberg (1992). doi:10.1007/3-540-55719-9_86

    Chapter  Google Scholar 

  19. Willard, D.E.: Log-logarithmic worst-case range queries are possible in space \(\varTheta (N)\). Information Processing Letters 17, 81–84 (1983)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Acknowledgements

This work was funded by ImPACT Program of Council for Science, Technology and Innovation (Cabinet Office, Government of Japan), Tohoku University Division for Interdisciplinary Advance Research and Education, and JSPS KAKENHI Grant Numbers JP15H05706, JP24106010, JP26280003.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Shintaro Narisada .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Cite this paper

Narisada, S., Diptarama, Narisawa, K., Inenaga, S., Shinohara, A. (2017). Computing Longest Single-arm-gapped Palindromes in a String. In: Steffen, B., Baier, C., van den Brand, M., Eder, J., Hinchey, M., Margaria, T. (eds) SOFSEM 2017: Theory and Practice of Computer Science. SOFSEM 2017. Lecture Notes in Computer Science(), vol 10139. Springer, Cham. https://doi.org/10.1007/978-3-319-51963-0_29

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-51963-0_29

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-51962-3

  • Online ISBN: 978-3-319-51963-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics