Efficient Identification of k-Closed Strings

  • Hayam Alamro
  • Mai Alzamel
  • Costas S. Iliopoulos
  • Solon P. Pissis
  • Steven WattsEmail author
  • Wing-Kin Sung
Conference paper
Part of the Communications in Computer and Information Science book series (CCIS, volume 744)


A closed string contains a proper factor occurring as both a prefix and a suffix but not elsewhere in the string. Closed strings were introduced by Fici (WORDS 2011) as objects of combinatorial interest. In this paper, we extend this definition to k-closed strings, for which a level of approximation is permitted up to a number of Hamming distance errors, set by the parameter k. We then address the problem of identifying whether or not a given string of length n over an integer alphabet is k-closed and additionally specifying the border resulting in the string being k-closed. Specifically, we present an \(\mathcal {O}(kn)\)-time and \(\mathcal {O}(n)\)-space algorithm to achieve this along with the pseudocode of an implementation.


  1. 1.
    Almirantis, Y., Charalampopoulos, P., Gao, J., Iliopoulos, C.S., Mohamed, M., Pissis, S.P., Polychronopoulos, D.: On avoided words, absent words, and their application to biological sequence analysis. Algorithms Mol. Biol. 12(1), 5 (2017)CrossRefGoogle Scholar
  2. 2.
    Badkobeh, G., Bannai, H., Goto, K., Tomohiro, I., Iliopoulos, C.S., Inenaga, S., Puglisi, S.J., Sugimoto, S.: Closed factorization. Discret. Appl. Math. 212, 23–29 (2016). Stringology AlgorithmsMathSciNetCrossRefzbMATHGoogle Scholar
  3. 3.
    Badkobeh, G., Fici, G., Lipták, Z.: A note on words with the smallest number of closed factors. CoRR, abs/1305.6395 (2013)Google Scholar
  4. 4.
    Barton, C., Iliopoulos, C.S., Pissis, S.P., Smyth, W.F.: Fast and simple computations using prefix tables under hamming and edit distance. In: Kratochvíl, J., Miller, M., Froncek, D. (eds.) IWOCA 2014. LNCS, vol. 8986, pp. 49–61. Springer, Cham (2015). doi: 10.1007/978-3-319-19315-1_5 CrossRefGoogle Scholar
  5. 5.
    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 CrossRefGoogle Scholar
  6. 6.
    Crochemore, M., Hancart, C., Lecroq, T.: Algorithms on Strings. Cambridge University Press, Cambridge (2007)CrossRefzbMATHGoogle Scholar
  7. 7.
    Farach, M.: Optimal suffix tree construction with large alphabets. In: 38th Annual Symposium on Foundations of Computer Science, Proceedings, pp. 137–143. IEEE (1997)Google Scholar
  8. 8.
    Fici, G.: A classification of trapezoidal words. In: Proceedings 8th International Conference Words 2011, Prague, Electronic Proceedings in Theoretical Computer Science, vol. 63, pp. 129–137 (2011)Google Scholar
  9. 9.
    Galil, Z., Giancarlo, R.: Improved string matching with \(k\) mismatches. SIGACT News 17(4), 52–54 (1986)CrossRefzbMATHGoogle Scholar
  10. 10.
    Gog, S., Beller, T., Moffat, A., Petri, M.: From theory to practice: plug and play with succinct data structures. In: Gudmundsson, J., Katajainen, J. (eds.) SEA 2014. LNCS, vol. 8504, pp. 326–337. Springer, Cham (2014). doi: 10.1007/978-3-319-07959-2_28 Google Scholar
  11. 11.
    Landau, G.M., Vishkin, U.: Efficient string matching with \(k\) mismatches. Theoret. Comput. Sci. 43, 239–249 (1986)MathSciNetCrossRefzbMATHGoogle Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  • Hayam Alamro
    • 1
  • Mai Alzamel
    • 1
  • Costas S. Iliopoulos
    • 1
  • Solon P. Pissis
    • 1
  • Steven Watts
    • 1
    Email author
  • Wing-Kin Sung
    • 2
  1. 1.Department of InformaticsKing’s College LondonLondonUK
  2. 2.Department of Computer ScienceNational University of SingaporeSingaporeSingapore

Personalised recommendations