[Paper Review] Longest Unbordered Factor in Quasilinear Time
This paper presents an O(n log n)-time randomized algorithm and an O(n log n log² log n)-time deterministic variant to compute the Longest Unbordered Factor Array for any word over a general alphabet. The algorithm efficiently determines, for each position in the word, the length of the longest unbordered factor starting at that position, significantly improving upon the previous O(n^1.5)-time bound for integer alphabets and extending the solution to all alphabets with a novel combinatorial approach based on successor factors and hook pointers.
A border u of a word w is a proper factor of w occurring both as a prefix and as a suffix. The maximal unbordered factor of w is the longest factor of w which does not have a border. Here an O(n log n)-time with high probability (or O(n log n log^2 log n)-time deterministic) algorithm to compute the Longest Unbordered Factor Array of w for general alphabets is presented, where n is the length of w. This array specifies the length of the maximal unbordered factor starting at each position of w. This is a major improvement on the running time of the currently best worst-case algorithm working in O(n^{1.5}) time for integer alphabets [Gawrychowski et al., 2015].
Motivation & Objective
- To compute the Longest Unbordered Factor Array for every position in a word, which specifies the length of the longest unbordered factor starting at each position.
- To overcome the O(n^1.5) worst-case time complexity of prior algorithms for integer alphabets by introducing a novel combinatorial approach.
- To extend the solution beyond integer alphabets to general alphabets, enabling efficient computation for arbitrary alphabets.
- To achieve a significant improvement in time complexity over the previous best algorithm, which only computed the maximal unbordered factor and not the full array.
- To provide both a randomized algorithm with high probability O(n log n) time and a deterministic O(n log n log² log n) time variant.
Proposed method
- The algorithm uses the concept of Longest Successor Factors (LSFℓ and LSFr) to precompute candidate references for unbordered factors.
- It maintains a HOOK array to track the earliest position where a factor can be extended without introducing a border.
- For each position i from right to left, the algorithm computes the longest unbordered factor starting at i using dynamic programming with references from LSFℓ and LSFr.
- It employs a potential reference check to update the HOOK array and avoid redundant recomputation.
- The algorithm leverages combinatorial properties of unbordered words and the duality between borders and periods to bound the number of relevant comparisons.
- The randomized version uses expected bounds on unbordered factor length to achieve O(n log n) time with high probability.
Experimental results
Research questions
- RQ1Can the Longest Unbordered Factor Array be computed in sub-quadratic time for general alphabets?
- RQ2What is the optimal time complexity for computing the full array of longest unbordered factors across all positions?
- RQ3How can the duality between borders and periods be exploited to design a faster algorithm?
- RQ4Can a randomized algorithm achieve O(n log n) time complexity with high probability for general alphabets?
- RQ5What is the deterministic time complexity of computing the Longest Unbordered Factor Array, and can it be made competitive with the randomized version?
Key findings
- The paper presents a randomized algorithm that computes the Longest Unbordered Factor Array in O(n log n) time with high probability for any alphabet.
- A deterministic variant of the algorithm runs in O(n log n log² log n) time, providing a worst-case guarantee.
- The algorithm improves upon the previous O(n^1.5)-time bound for integer alphabets, which only computed the maximal unbordered factor, not the full array.
- The approach is general and applies to arbitrary alphabets, not just integer alphabets of polynomial size in n.
- The worst-case behavior of the algorithm is bounded by Θ(n log n) total stack size in the worst-case input family, confirming the theoretical time bounds.
- The algorithm uses a novel data structure combining successor factors and hook pointers to efficiently propagate unbordered factor information from right to left.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.