Online and Offline Algorithms for Counting Distinct Closed Factors via Sliding Suffix Trees
Takuya Mieno, Shun Takahashi, Kazuhisa Seto, and Takashi Horiyama

TL;DR
This paper introduces two algorithms, one online and one offline, that efficiently count distinct closed factors in a string using sliding suffix trees, improving computational performance.
Contribution
It presents novel online and offline algorithms for counting distinct closed factors in strings, leveraging sliding suffix trees for improved efficiency.
Findings
Online algorithm runs in O(n log σ) time with O(n) space.
Offline algorithm achieves O(n) time complexity with O(n) space.
Both algorithms effectively utilize suffix trees for sliding window processing.
Abstract
A string is said to be closed if its length is one, or if it has a non-empty factor that occurs both as a prefix and as a suffix of the string, but does not occur elsewhere. The notion of closed words was introduced by [Fici, WORDS 2011]. Recently, the maximum number of distinct closed factors occurring in a string was investigated by [Parshina and Puzynina, Theor. Comput. Sci. 2024], and an asymptotic tight bound was proved. In this paper, we propose two algorithms to count the distinct closed factors in a string T of length n over an alphabet of size \sigma. The first algorithm runs in O(n log \sigma) time using O(n) space for string T given in an online manner. The second algorithm runs in O(n) time using O(n) space for string T given in an offline manner. Both algorithms utilize suffix trees for sliding windows.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAlgorithms and Data Compression · Data Management and Algorithms · Text and Document Classification Technologies
