International Symposium on String Processing and Information Retrieval

SPIRE 2015: String Processing and Information Retrieval pp 246-257

# Computing the Longest Unbordered Substring

• Paweł Gawrychowski
• Gregory Kucherov
• Benjamin Sach
• Tatiana Starikovskaya
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9309)

## Abstract

A substring of a string is unbordered if its only border is the empty string. The study of unbordered substrings goes back to the paper of Ehrenfeucht and Silberger [Discr. Math 26 (1979)]. The main focus of their and subsequent papers was to elucidate the relationship between the longest unbordered substring and the minimal period of strings. In this paper, we consider the algorithmic problem of computing the longest unbordered substring of a string. The problem was introduced recently by G. Kucherov et al. [CPM (2015)], where the authors showed that the average-case running time of the simple, border-array based algorithm can be bounded by $$\mathcal {O}(\max \{n, n^2/\sigma ^4\})$$ for $$\sigma$$ being the size of the alphabet. (The worst-case running time remained $$\mathcal {O}(n^2)$$.) Here we propose two algorithms, both presenting substantial theoretical improvements to the result of [11]. The first algorithm has $$\mathcal {O}(n \log n)$$ average-case running time and $$\mathcal {O}(n^2)$$ worst-case running time, and the second algorithm has $$\mathcal {O}(n^{1.5})$$ worst-case running time.

## Preview

### References

1. 1.
Assous, R., Pouzet, M.: Une caractérisation des mots périodiques. Journal of Discrete Mathematics 25(1), 1–5 (1979)
2. 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)
3. 3.
Bender, M.A., Farach-Colton, M.: The level ancestor problem simplified. In: Rajsbaum, S. (ed.) LATIN 2002. LNCS, vol. 2286, pp. 508–515. Springer, Heidelberg (2002)
4. 4.
Duval, J.-P.: Relationship between the period of a finite word and the length of its unbordered segments. Journal of Discrete Mathematics 40(1), 31–44 (1982)
5. 5.
Duval, J.-P., Lecroq, T., Lefebvre, A.: Linear computation of unbordered conjugate on unordered alphabet. Journal of Theoretical Computer Science 522, 77–84 (2014)
6. 6.
Ehrenfeucht, A., Silberger, D.M.: Periodicity and unbordered segments of words. Journal of Discrete Mathematics 26(2), 101–109 (1979)
7. 7.
Farach-Colton, M.: Optimal suffix tree construction with large alphabets. In: Proceedings of the 38th Annual Symposium on Foundations of Computer Science, pp. 137–143. IEEE Computer Society (1997)Google Scholar
8. 8.
Holub, S̆., Nowotka, D.: The Ehrenfeucht-Silberger problem. Journal of Combinatorial Theory, Series A 119(3), 668–682 (2012)Google Scholar
9. 9.
Ilie, L., Navarro, G., Tinta, L.: The longest common extension problem revisited and applications to approximate string searching. Journal of Discrete Algorithms 8(4), 418–428 (2010)
10. 10.
Jacobson, G.: Space-efficient static trees and graphs. In: Proceedings of the 30th Annual Symposium on Foundations of Computer Science, pp. 549–554 (October 1989)Google Scholar
11. 11.
Loptev, A., Kucherov, G., Starikovskaya, T.: On maximal unbordered factors. In: Cicalese, F., Porat, E., Vaccaro, U. (eds.) CPM 2015. LNCS, vol. 9133, pp. 343–354. Springer, Heidelberg (2015)
12. 12.
Morris, Jr., J.H., Pratt, V.R.: A linear pattern-matching algorithm, report 40. Technical report, University of California, Berkeley (1970)Google Scholar
13. 13.
Szpankowski, W.: Average Case Analysis of Algorithms on Sequences. John Wiley & Sons Inc. (2001)Google Scholar
14. 14.
Weiner, P.: Linear pattern matching algorithms. In: Proceedings of the 14th Annual IEEE Symposium on Foundations of Computer Science, pp. 1–11 (1973)Google Scholar

© Springer International Publishing Switzerland 2015

## Authors and Affiliations

• Paweł Gawrychowski
• 1
• Gregory Kucherov
• 2
• Benjamin Sach
• 3
• Tatiana Starikovskaya
• 3
1. 1.University of WarsawWarsawPoland
2. 2.Laboratoire d’Informatique Gaspard MongeUniversité Paris-Est and CNRSChamps-sur-MarneFrance
3. 3.University of BristolBristolEngland