Lune

SODA2023顶会

Optimal Square Detection Over General Alphabets

Jonas Ellert, Pawel Gawrychowski, Garance Gourdel

摘要

Squares (fragments of the form xx, for some string x) are arguably the most natural type of repetition in strings. The basic algorithmic question concerning squares is to check if a given string of length n is square-free, that is, does not contain a fragment of such form. Main and Lorentz [J. Algorithms 1984] designed an O(n log n) time algorithm for this problem, and proved a matching lower bound assuming the so-called general alphabet, meaning that the algorithm is only allowed to check if two characters are equal. However, their lower bound also assumes that there are Ω(n) distinct symbols in the string. As an open question, they asked if there is a faster algorithm if one restricts the size of the alphabet. Crochemore [Theor. Comput. Sci. 1986] designed a linear-time algorithm for constant-size alphabets, and combined with more recent results his approach in fact implies such an algorithm for linearly-sortable alphabets. Very recently, Ellert and Fischer [ICALP 2021] significantly relaxed this assumption by designing a linear-time algorithm for general ordered alphabets, that is, assuming a linear order on the characters that permits constant time order comparisons. However, the open question of Main and Lorentz from 1984 remained unresolved for general (unordered) alphabets. In this paper, we show that testing square-freeness of a length-n string over general alphabet of size σ can be done with O(n log σ) comparisons, and cannot be done with o(n log σ) comparisons. We complement this result with an O(n log σ) time algorithm in the Word RAM model. Finally, we extend the algorithm to reporting all the runs (maximal repetitions) in the same complexity.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • On the Hardness Hierarchy for the O(n√log n) Complexity in the Word RAM 引用了 Lempel-Ziv (LZ77) Factorization in Sublinear Time
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper2

  1. Lempel-Ziv (LZ77) Factorization in Sublinear TimeDominik Kempa, Tomasz KociumakaFOCS 2024 · 2 次引用
  2. On the Hardness Hierarchy for the O(n√log n) Complexity in the Word RAMDominik Kempa, Tomasz KociumakaSTOC 2025

相关 Paper

  1. Approximating text-to-pattern Hamming distancesTimothy M. Chan, Shay Golan, Tomasz Kociumaka, Tsvi Kopelowitz 等STOC 2020 · 2 次引用
  2. Testing forbidden order-pattern properties on hypergridsHarish Chandramouleeswaran, Ilan Newman, Tomer Pelleg, Nithin VarmaSODA 2026
  3. Optimal Distribution-Free Sample-Based Testing of Subsequence-FreenessDana Ron, Asaf RosinSODA 2021 · 3 次引用
  4. Tight Bounds for Sorting Under Partial InformationIvor van der Hoog, Daniel RutschmannFOCS 2024 · 8 次引用
  5. Near-Optimal Property Testers for Pattern MatchingCe Jin, Tomasz KociumakaFOCS 2025 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖