Skip to main content
QUICK REVIEW

[Paper Review] Computing All Distinct Squares in Linear Time for Integer Alphabets

Hideo Bannai, Shunsuke Inenaga|arXiv (Cornell University)|Oct 11, 2016
Algorithms and Data CompressionComputer Science21 references3 citations
TL;DR

This paper presents a linear-time algorithm to compute all distinct squares in a string over an integer alphabet, leveraging suffix trees and a semi-dynamic lowest marked ancestor data structure. The key contribution is a O(n)-time construction of the minimal augmented suffix tree (MAST) topology, enabling efficient non-overlapping substring occurrence queries.

ABSTRACT

Given a string on an integer alphabet, we present an algorithm that computes the set of all distinct squares belonging to this string in time linear to the string length. As an application, we show how to compute the tree topology of the minimal augmented suffix tree in linear time. Asides from that, we elaborate an algorithm computing the longest previous table in a succinct representation using compressed working space.

Motivation & Objective

  • To compute all distinct squares in a string over an integer alphabet in linear time.
  • To enable efficient construction of the minimal augmented suffix tree (MAST) topology in linear time.
  • To provide a succinct, compressed representation of the longest previous factor (LPF) table.
  • To support online computation of distinct squares via a practical data structure design.

Proposed method

  • Uses a suffix array and LCP array to efficiently locate square substrings via range minimum queries (RMQ).
  • Employs a semi-dynamic lowest marked ancestor (LMA) data structure to track processed regions in the suffix tree.
  • Sorts square roots by length using integer sorting to process them in increasing order.
  • Uses a top-down traversal of the suffix tree to insert new nodes at the correct positions for square roots.
  • Represents the LPF table in 2n + o(n) bits and computes it using compressed working space.
  • Leverages RMQ on the LCP array to answer LCE queries in constant time.

Experimental results

Research questions

  • RQ1Can all distinct squares in a string be computed in linear time for integer alphabets?
  • RQ2Is it possible to construct the tree topology of the minimal augmented suffix tree (MAST) in O(n) time?
  • RQ3Can the longest previous factor (LPF) table be stored and computed using compressed space?
  • RQ4Can the algorithm be adapted for online processing of distinct squares?

Key findings

  • The algorithm computes all distinct squares in O(n) time for integer alphabets of size n^O(1).
  • The minimal augmented suffix tree (MAST) topology can be constructed in O(n) time, improving over the previous O(n log n) bound.
  • The LPF table is stored in 2n + o(n) bits and computed using compressed working space.
  • The method uses a semi-dynamic lowest marked ancestor structure to efficiently locate insertion points in the suffix tree.
  • The approach enables linear-time construction of MAST by inserting nodes at the correct depths corresponding to square roots.
  • The algorithm supports online processing of distinct squares, as shown in the appendix.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.