On the Right-Seed Array of a String

  • Michalis Christou
  • Maxime Crochemore
  • Ondrej Guth
  • Costas S. Iliopoulos
  • Solon P. Pissis
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6842)


We consider the problem of finding the repetitive structure of a given fixed string y. A factor u of y is a cover of y, if every letter of y falls within some occurrence of u in y. A factor v of y is a seed of y, if it is a cover of a superstring of y. There exist linear-time algorithms for solving the minimal cover problem. The minimal seed problem is of much higher algorithmic difficulty, and no linear-time algorithm is known. In this article, we solve one of its variants – computing the minimal and maximal right-seed array of a given string. A right seed of y is the shortest suffix of y that it is a cover of a superstring of y. An integer array RS is the minimal right-seed (resp. maximal right-seed) array of y, if RS[i] is the minimal (resp. maximal) length of right seeds of \(y[0\mathinner{\ldotp\ldotp} i]\). We present an \(\ensuremath{\mathcal{O}}(n\log n)\) time algorithm that computes the minimal right-seed array of a given string, and a linear-time solution to compute the maximal right-seed array by detecting border-free prefixes of the given string.


algorithms on strings periodicity covers seeds 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Apostolico, A., Breslauer, D.: Of periods, quasiperiods, repetitions and covers. In: Mycielski, J., Rozenberg, G., Salomaa, A. (eds.) Structures in Logic and Computer Science. LNCS, vol. 1261, pp. 236–248. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  2. 2.
    Apostolico, A., Ehrenfeucht, A.: Efficient detection of quasiperiodicities in strings. Theor. Comput. Sci. 119(2), 247–265 (1993)MathSciNetCrossRefzbMATHGoogle Scholar
  3. 3.
    Bannai, H., Inenaga, S., Shinohara, A., Takeda, M.: Inferring strings from graphs and arrays. In: Rovan, B., Vojtáš, P. (eds.) MFCS 2003. LNCS, vol. 2747, pp. 208–217. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  4. 4.
    Breslauer, D.: An on-line string superprimitivity test. Inf. Process. Lett. 44(6), 345–347 (1992)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Christou, M., Crochemore, M., Iliopoulos, C.S., Kubica, M., Pissis, S.P., Radoszewski, J., Rytter, W., Szreder, B., Waleń, T.: Efficient seeds computation revisited. In: Giancarlo, R., Manzini, G. (eds.) CPM 2011. LNCS, vol. 6661, pp. 350–363. Springer, Heidelberg (accepted, 2011)Google Scholar
  6. 6.
    Clement, J., Crochemore, M., Rindone, G.: Reverse engineering prefix tables. In: Albers, S., Marion, J.-Y. (eds.) 26th International Symposium on Theoretical Aspects of Computer Science (STACS 2009), pp. 289–300. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany (2009), Google Scholar
  7. 7.
    Crochemore, M.: An optimal algorithm for computing the repetitions in a word. Inf. Process. Lett. 12(5), 244–250 (1981)MathSciNetCrossRefzbMATHGoogle Scholar
  8. 8.
    Crochemore, M., Hancart, C., Lecroq, T.: Algorithms on Strings. Cambridge University Press, New York (2007)CrossRefzbMATHGoogle Scholar
  9. 9.
    Crochemore, M., Iliopoulos, C., Pissis, S., Tischler, G.: Cover array string reconstruction. In: Amir, A., Parida, L. (eds.) CPM 2010. LNCS, vol. 6129, pp. 251–259. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  10. 10.
    Duval, J.-P., Lecroq, T., Lefebvre, A.: Border array on bounded alphabet. Journal of Automata, Languages and Combinatorics 10(1), 51–60 (2005)MathSciNetzbMATHGoogle Scholar
  11. 11.
    Franek, F., Gao, S., Lu, W., Ryan, P.J., Smyth, W.F., Sun, Y., Yang, L.: Verifying a Border array in linear time. J. Combinatorial Math. and Combinatorial Computing 42, 223–236 (2002)MathSciNetzbMATHGoogle Scholar
  12. 12.
    Franek, F., Smyth, W.F.: Reconstructing a Suffix Array. J. Foundations of Computer Sci. 17(6), 1281–1295 (2006)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Iliopoulos, C.S., Moore, D.W.G., Park, K.: Covering a string. Algorithmica 16, 289–297 (1996)MathSciNetCrossRefzbMATHGoogle Scholar
  14. 14.
    Knuth, D.E., Morris, J.H., Pratt, V.R.: Fast pattern matching in strings. SIAM J. Comput. 6(2), 323–350 (1977)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Li, Y., Smyth, W.F.: Computing the cover array in linear time. Algorithmica 32(1), 95–106 (2002)MathSciNetCrossRefzbMATHGoogle Scholar
  16. 16.
    Lothaire, M. (ed.): Algebraic Combinatorics on Words. Cambridge University Press, Cambridge (2001)zbMATHGoogle Scholar
  17. 17.
    Lothaire, M. (ed.): Appplied Combinatorics on Words. Cambridge University Press, Cambridge (2005)zbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Michalis Christou
    • 1
  • Maxime Crochemore
    • 1
    • 2
  • Ondrej Guth
    • 4
  • Costas S. Iliopoulos
    • 1
    • 3
  • Solon P. Pissis
    • 1
  1. 1.Dept. of InformaticsKing’s College LondonLondonUK
  2. 2.Université Paris-EstFrance
  3. 3.Digital Ecosystems & Business Intelligence InstituteCurtin UniversityPerthAustralia
  4. 4.Dept. of Theoretical Computer Science, Faculty of Information TechnologyCzech Technical University in PragueCzech Republic

Personalised recommendations