Fast lightweight suffix array construction and checking

  • Authors:
  • Stefan Burkhardt;Juha Kärkkäinen

  • Affiliations:
  • Max-Planck-Institut für Informatik, Saarbrücken, Germany;Max-Planck-Institut für Informatik, Saarbrücken, Germany

  • Venue:
  • CPM'03 Proceedings of the 14th annual conference on Combinatorial pattern matching
  • Year:
  • 2003

Quantified Score

Hi-index 0.01

Visualization

Abstract

We describe an algorithm that, for any v ∈ [2, n], constructs the suffix array of a string of length n in O(vn + n log n) time using O(v + n/ √v) space in addition to the input (the string) and the output (the suffix array). By setting v = log n, we obtain an O(n log n) time algorithm using O(n/√log n) extra space. This solves the open problem stated by Manzini and Ferragina [ESA '02] of whether there exists a lightweight (sublinear extra space) O(n log n) time algorithm. The key idea of the algorithm is to first sort a sample of suffixes chosen using mathematical constructs called difference covers. The algorithm is not only lightweight but also fast in practice as demonstrated by experiments. Additionally, we describe fast and lightweight suffix array checkers, i.e., algorithms that check the correctness of a suffix array.