Efficient Computation of Closed Substrings

📅 2025-06-06
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the efficient enumeration of closed substrings and their maximal variants (maximal closed substrings, MCSs) in a string. We present the first algorithm achieving $O(n log n)$ time and space complexity for enumerating all $Theta(n^2)$ closed substrings. For MCS extraction, we propose a lightweight method based on the suffix array and LCP array, ensuring both theoretical optimality and practical efficiency. To mitigate output explosion, we introduce a compact representation that significantly reduces output size. Furthermore, we fully characterize the asymptotic behavior of MCS counts in Fibonacci words, deriving the exact asymptotic formula $sim 1.382,F_n$. This constitutes the first near-linear-time algorithm for complete closed substring enumeration.

Technology Category

Data Mining & Knowledge Management: Data CompressionSearch and Optimization: Combinatorial OptimizationMachine Learning: Matrix & Tensor Methods

Application Category

Graph Algorithms and Modeling for the Web: Representation, reconstruction, and subgraph or motif discovery in Web-related graphsWeb Mining and Content Analysis: Robustness and generalizability of Web mining methodsSecurity and Privacy: Large-scale security measurements
📝 Abstract
A closed string $u$ is either of length one or contains a border that occurs only as a prefix and as a suffix in $u$ and nowhere else within $u$. In this paper, we present a fast and practical $O(nlog n)$ time algorithm to compute all $Theta(n^2)$ closed substrings by introducing a compact representation for all closed substrings of a string $ w[1..n]$, using only $O(n log n)$ space. We also present a simple and space-efficient solution to compute all maximal closed substrings (MCSs) using the suffix array ($mathsf{SA}$) and the longest common prefix ($mathsf{LCP}$) array of $w[1..n]$. Finally, we show that the exact number of MCSs ($M(f_n)$) in a Fibonacci word $ f_n $, for $n geq 5$, is $approx left(1 + frac{1}{phi^2} ight) F_n approx 1.382 F_n$, where $ phi $ is the golden ratio.
Problem

Research questions and friction points this paper is trying to address.

Develops fast algorithm to compute all closed substrings
Introduces compact representation for closed substrings
Calculates exact number of maximal closed substrings in Fibonacci words
Innovation

Methods, ideas, or system contributions that make the work stand out.

Fast O(n log n) algorithm for closed substrings
Compact O(n log n) space representation
Suffix and LCP arrays for maximal substrings
🔎 Similar Papers
No similar papers found.
💼 Related Jobs
No related jobs found.
S
Samkith K Jain
Department of Computing and Software, McMaster University, Canada
N
N. Mhaskar
Department of Computing and Software, McMaster University, Canada