---
title: Net Occurrences in String Analysis
url: https://www.emergentmind.com/topics/net-occurrences
type: topic
---

# Net Occurrences in String Analysis

Net occurrences are a central notion in combinatorics on words, string processing, and applied pattern-mining, quantifying the number of “significant” repetitions of substrings in texts or sequences. The net occurrence of a repeat is defined through context-sensitive uniqueness of its surrounding substrings, offering a structural refinement to the standard count of (possibly overlapping) substring occurrences. This concept underlies efficient algorithms for maximal repeat discovery, string kernel computation, text compression, and fine-grained combinatorial analyses of infinite words such as Fibonacci and Thue-Morse sequences.

## 1. Formal Definitions and Characterizations

A substring $u$ of a string $T$ is a **repeat** if it appears at least twice in $T$. An **occurrence** $[i..j]$ of $u$ is a **net occurrence** if both its immediate left and right extensions are unique, i.e.,

- $\#\operatorname{occ}_T(aub) = 1$,
- $\#\operatorname{occ}_T(au) = 1$,
- $\#\operatorname{occ}_T(ub) = 1$,

where $a=T[i-1]$, $b=T[j+1]$, assuming sentinels at the boundaries. The **net frequency** $\mathrm{NF}(u,T)$ is the cardinality of net occurrences of $u$ in $T$. This definition is equivalent to requiring that any **occurrence** $[i..j]$ of $u$ in $T$ is not “covered” by a strictly longer repeat occurring elsewhere, making each net occurrence a witness to $u$’s maximal contextual distinctness [2408.00308, 2410.06837, 2511.11057].

Alternate characterizations employ structural properties of suffix trees and the Burrows-Wheeler Transform: for example, in the run-length BWT, all net occurrences of all repeats correspond one-to-one with run boundaries, yielding the global bound $\sum_x \mathrm{NF}(x) < 2r$ for $r$ BWT runs [2511.11057].

## 2. Algorithmic Computation: Offline and Online Methods

Efficient enumeration and reporting of net occurrences, as well as answering *Single-NF* (query for the net frequency of a pattern) and *All-NF* (report all substrings with positive net frequency) arise in several algorithmic frameworks:

- **Suffix Tree Methods**: Suffix trees allow $O(n)$-time offline extraction of all positive-NF substrings and their net frequencies via a traversal that exploits branching and extension-uniqueness properties. Online variants using implicit suffix trees (Ukkonen’s construction with Breslauer–Italiano maintenance) achieve $O(m)$ time for *Single-NF* on a constant-sized alphabet, and $O(n)$ for *All-NF* [2408.00308].
- **Weiner-based Algorithms**: For large alphabets, Weiner’s right-to-left suffix tree construction supplies an online $O(n\log\sigma)$-time algorithm, with $O(m\log\sigma)$ for *Single-NF* and optimal output-sensitive $O(|\mathsf{NF}^+(S)|)$ time for *All-NF*, eliminating the $O(\sigma^2)$ dependency of previous approaches [2410.06837].
- **Burrows-Wheeler Transform (BWT) and RLBWT**: Leveraging the compression of the run-length BWT, *r*-enumeration algorithms enumerate all net occurrences (context-sensitive repeats/NSMRs) in $O(n)$ time and $O(r)$ space and build data structures that answer *Single-NF* queries in $O(|P|)$ time, where $|P|$ is the query pattern length [2511.11057].
- **Suffix Array and BWT Structures**: Offline, suffix arrays combined with the LCP array and colored range listing data structures yield $O(n)$ time algorithms for All-NF and $O(m + \sigma)$ for Single-NF, with provably optimal runtimes and demonstrated scalability to massive data sets (GB-scale texts) [2404.12701].

<table>
  <thead>
    <tr><th>Algorithmic Paradigm</th><th>Single-NF Time</th><th>All-NF Time</th></tr>
  </thead>
  <tbody>
    <tr><td>Suffix Tree (const. alphabet)</td><td>$O(m)$</td><td>$O(n)$</td></tr>
    <tr><td>Weiner Tree (general $\sigma$)</td><td>$O(m\log\sigma)$</td><td>$O(n)$ (output sensitive)</td></tr>
    <tr><td>RLBWT ($r$ runs)</td><td>$O(|P|)$</td><td>$O(n)$</td></tr>
    <tr><td>Suffix Array/BWT</td><td>$O(m+\sigma)$</td><td>$O(n)$</td></tr>
  </tbody>
</table>

## 3. Structural Properties and Upper Bounds

Net occurrences display rich combinatorial structure:

- **Maximality**: Any substring $u$ with $\mathrm{NF}(u,T)>0$ must be a branching substring in the suffix tree and cannot be extended on either side without becoming unique. Only “significant” repeats—those which cannot be further extended while remaining a repeat—contribute nonzero net frequency [2408.00308, 2404.12701].
- **Global Bounds**: There are at most $n$ substrings $u$ with $\mathrm{NF}(u,T)>0$ for a text of length $n$; the sum of their lengths lies between $\Omega(n)$ and $O(n\log\delta)$ where $\delta$ is a repetitiveness measure [2408.00308, 2511.11057].
- **Compressed Space**: The total number of net occurrences over all repeats is less than $2r$, where $r$ is the number of RLBWT runs. Consequently, all context-diverse repeats (near-supermaximal repeats/NSMRs) can be enumerated in $O(r)$ space [2511.11057]. The number of minimal unique substrings (MUSs)—the dual objects to net occurrences—is also $<2r$ [2511.11057].

## 4. Combinatorial Analysis in Structured Words

Combinatorial investigations of net occurrences have focused on infinite morphic words:

- **Fibonacci Words**: Each Fibonacci word $F_i$ has exactly three net occurrences: the single occurrence of $F_{i-2}$ at position $f_{i-1}+1$, and two occurrences of $F_{i-2} Q_i$ at positions 1 and $f_{i-2}+1$, where $Q_i=F_{i-5}\cdots F_2$ [2505.02307]. These net occurrences form an overlapping net occurrence cover (ONOC), and any potential further occurrence would have to be a super-occurrence of a bridging net sub-occurrence, which is impossible by structural constraints.
- **Thue-Morse Words**: Each Thue-Morse word $\tau_i$ with $i\geq5$ contains exactly nine net occurrences, corresponding to two occurrences each of selected derived factors ($\tau_{i-2}$, $\overline{\tau_{i-2}}$, $\tau_{i-4}\,\overline{\tau_{i-3}}$, $\overline{\tau_{i-4}}\,\tau_{i-3}$) [2505.02307]. Explicit combinatorial recursions characterize all starting positions and the overlap structure of net occurrences.

These results establish tight lower bounds for the number of net occurrences in highly repetitive infinite sequences, thus providing combinatorial lower-bound instances for algorithmic analysis [2505.02307, 2404.12701].

## 5. Relationship to Minimal Unique Substrings and Coverage

A fundamental connection exists between net occurrences and minimal unique substrings (MUSs):

- **ENO-MUS Correspondence**: The sorted lists of extended net occurrences $\mathrm{ENO}(T)$ and MUSs $\mathrm{MUS}(T)$ interleave, and one can reconstruct one from the other in output-sensitive time [2411.12160].
- **Gap Filling**: Every gap between consecutive MUSs is a net occurrence of a repeat; conversely, every gap between extended net occurrences is a MUS.
- **Characterization**: The number of extended net occurrences in $T$ is exactly one less than the number of MUSs, i.e., $\#\mathrm{ENO}(T)=\#\mathrm{MUS}(T)-1$ [2411.12160]. This pairing yields efficient algorithms for enumerating both families from succinct representations.

These insights unify net occurrence theory with the broader study of string uniqueness and attractors in repetitive strings.

## 6. Space-Efficient and Online Algorithms

Recent research focuses on maintaining net occurrence sets under streaming or space-restricted models:

- **Sliding-Window Algorithms**: By tracking active/secondary points in a sliding suffix tree, all extended net occurrences in a window of size $d$ can be maintained in $O(d)$ space with $O(\#\mathrm{ENO}(W))$ reporting time [2411.12160].
- **CDAWG-Based Methods**: The implicit CDAWG of $T$ supports dynamic maintenance and output-optimal reporting of ENO$(T[1..i])$ in $O(e)$ space, with $e<2n$ and per-update time $O(\log\sigma)$. Constant-time support for all necessary substring queries is achieved through combinatorial extensions [2411.12160].
- **Compressed Data Structures**: Compacted reversed tries over net-positive repeats/NSMRs, constructed from the RLBWT, enable $O(r)$-space query support for net frequencies [2511.11057].

These approaches enable deployment in large-scale pipelines (compression, plagiarism detection, document fingerprinting) under stringent memory and latency constraints.

## 7. Applications and Significance

Net occurrence theory provides a rigorous framework for identifying “context-sensitive” repeats, with applications in:

- **Text Compression and Tokenization**: Net occurrences partition texts into significant blocks that cannot be subsumed by longer repeats, supporting maximal factorization and grammar-based models [2404.12701].
- **Bioinformatics and Sequence Analysis**: Enumeration of net occurrences corresponds to discovering context-diverse repeats, informative for genetic motif identification and DNA repeat masking [2511.11057].
- **String Kernel Methods**: Positive net frequency substrings capture “maximally distinctive” features, enhancing the accuracy and explainability of sequence-based learning methods [2408.00308].
- **Complexity Theory and Lower Bounds**: Tight asymptotics for the quantity and structure of net occurrences in morphic words underpin lower-bound constructions for string-processing algorithm runtimes [2505.02307].

Advances in both theory and scalable computation position net occurrences as a robust abstraction in symbolic, computational, and applied stringology.

Source: https://www.emergentmind.com/topics/net-occurrences