Compact Enumeration of Maximal Closed Substrings in Run-Length Encoded Strings
arXiv:2607.02838
Abstract
A string is closed if , or if has a non-empty proper border occurring only as its prefix and suffix. A maximal closed substring (MCS) is a maximal occurrence of a closed string; equivalently, it is a maximal closed repeat (MCR). We study the problem of enumerating all MCS occurrences directly from the run-length encoding (RLE) of a string. For a string of length with RLE size , we give a compact representation of all MCS occurrences whose worst-case size is , and show that this bound is tight for this representation. Our approach is based on a characterization of MCS occurrences in terms of consecutive occurrences of their longest borders, together with data structures built on the RLE of . Denoting the resulting representation by , we compute it in time using working space.
Accepted for SPIRE 2026