---
title: Minimal Unique Substring (MUS)
url: https://www.emergentmind.com/topics/minimal-unique-substring-mus
type: topic
---

# Minimal Unique Substring (MUS)

A minimal unique substring (MUS) of a string \(T\) is a substring that occurs exactly once in \(T\) and is minimal with respect to that uniqueness: deleting its first character or its last character yields a repeating substring. Equivalently, every proper substring of a MUS is repeating. MUSs are typically identified with their occurrence intervals \([s,t]\), form a non-nesting family, and their total number in a string of length \(n\) is at most \(n\) [1909.02804] [1609.07220].

## 1. Formal definition and core structural properties

Let \(T\) be a string of length \(n\) over an alphabet \(\Sigma\), and let \(\mathrm{occ}_T(w)\) denote the number of occurrences of a string \(w\) in \(T\). A substring \(u=T[s..t]\) is unique if \(\mathrm{occ}_T(u)=1\), and repeating if \(\mathrm{occ}_T(u)\ge 2\). The standard MUS definition is
\[
\MUS(T)=\{[s,t]\mid \mathrm{occ}_T(T[s..t])=1,\ \mathrm{occ}_T(T[s+1..t])\ge 2,\ \mathrm{occ}_T(T[s..t-1])\ge 2\},
\]
which is equivalent to requiring every proper substring of \(T[s..t]\) to be repeating [1909.02804].

Two structural properties recur throughout the literature. First, distinct MUSs do not nest. If \(T[i..j]\) and \(T[i'..j']\) are MUSs with \(i<i'\le j'<j\), then \(T[i..j]\) contains \(T[i'..j']\), forcing the inner substring to occur once and contradicting minimality. Second, for each start position \(i\), there is at most one MUS commencing at \(i\); otherwise one candidate would be a proper prefix of the other, and the shorter one would prevent the longer one from being minimal. These two facts together yield the global bound \(|\MUS(T)|\le n\) [2508.16092].

Concrete examples illustrate the definition sharply. For \(T=\texttt{ababa}\), the substring \(\texttt{bab}\) is a MUS because it occurs once, while both \(\texttt{ba}\) and \(\texttt{ab}\) occur twice; in fact \(\MUS(\texttt{ababa})=\{\texttt{bab}\}\). For \(T=\texttt{abcd}\), using the convention that the empty string \(\varepsilon\) occurs \(n+1\) times, each single character is a MUS and no longer substring is minimal, so \(\MUS(T)=\{\texttt{a},\texttt{b},\texttt{c},\texttt{d}\}\) [2508.16092].

## 2. Relation to shortest unique substrings

MUSs are closely tied to shortest unique substring (SUS) queries. For a query interval \([s,t]\subseteq[1,n]\), a substring \(T[i..j]\) is a SUS for \([s,t]\) if it is unique, contains \([s,t]\), and every strictly shorter substring containing \([s,t]\) is repeating. The special case \(s=t=p\) yields point-SUS queries [1609.07220] [1905.12854].

The algorithmic connection is direct: all known optimal solutions for both point- and interval-SUS queries follow the same high-level plan of first computing \(\MUS(T)\), or an equivalent structure, and then building auxiliary arrays that enumerate exactly those unique substrings covering the query that are minimal in length. In the classical linear-time preprocessing framework, this supports \(O(k)\) query time for point SUS and \(O(k')\) query time for interval SUS, where \(k\) and \(k'\) are the output sizes [1609.07220].

This dependence on MUSs persists in succinct indexing. A space-efficient formulation marks MUS starts and ends with the bit-vectors \(MB_T\) and \(ME_T\), augments them with rank/select, and emulates virtual arrays of MUS start positions, end positions, and lengths. On top of these, an interval-SUS structure of \(4n+o(n)\) bits answers any interval query in output-sensitive \(O(\mathrm{occ})\) time, while a point-SUS structure of \(\lceil(\log_2 3+1)n\rceil+o(n)\) bits supports point queries in the same \(O(\mathrm{occ})\) time [1905.12854].

## 3. Linear-time computation and compact representation

The standard linear-time route to all MUSs uses suffix arrays and longest-common-prefix information. Let \(SA[1..n]\) be the suffix array of \(T\), and \(LCP[1..n]\) the usual adjacent-suffix LCP array, with sentinel zeros at the boundaries. For each suffix \(SA[r]=i\), define
\[
\ell(i)=\max(LCP[r],LCP[r+1]).
\]
Then \(T[i..i+\ell(i)]\) is the shortest unique substring starting at \(i\); moreover it is minimal unique, and every MUS arises in this way. Consequently, after building \(SA\) and \(LCP\) in \(O(n)\) time, one computes each \(\ell(i)\) and outputs the corresponding intervals, obtaining all MUSs in \(O(n)\) total time [2508.16092].

The same viewpoint underlies bit-space reductions. In the space-efficient construction, \(MB_T[i]=1\) iff \(i\) is the start of some MUS and \(ME_T[i]=1\) iff \(i\) is its end; each vector contains exactly \(m=|\MUS_T|\) one-bits. Rank/select over these bit-vectors emulates the arrays
\[
X_T[j]=\text{start of the \(j\)th MUS},\quad
Y_T[j]=\text{end of the \(j\)th MUS},\quad
MUSlen_T[j]=Y_T[j]-X_T[j]+1,
\]
and an \(RmQ\) structure over \(MUSlen_T\) supports constant-time range minima for SUS reporting [1905.12854].

The same paper gives a small-space MUS construction pipeline. A single left-to-right scan, combined with compact LCP/ISA access, computes \(MB_T\) and \(ME_T\) in \(O(n\pi_a(n))\) time using \(2n+\pi_s(n)\) bits; choosing the in-place \(\mathrm{succPLCP}+\Phi\) representation yields \(\pi_a(n)=O(1)\) and \(\pi_s(n)=4n+o(n)\), hence true \(O(n)\) time in \(O(n)\) bits [1905.12854]. This places MUS computation in the class of linear-time, linear-bit string indexing primitives.

## 4. Sliding-window MUSs

The MUS problem has also been studied in a sliding-window model. For a fixed width \(d\), one considers the sequence of windows \(T[i..i+d-1]\) and asks how \(\MUS(T[i..i+d-1])\) changes as the window moves one position to the right. The central combinatorial result is that a single slide changes only a constant number of MUSs:
\[
|\MUS(T[i..i+d-1])\triangle \MUS(T[i+1..i+d])|\le 4,
\]
and the size difference satisfies
\[
-1\le |\MUS(W')|-|\MUS(W)|\le 2.
\]
Therefore the total symmetric-difference mass over all \(n-d\) slides is \(O(n)\) [1909.02804].

The analysis uses two auxiliary suffix notions for a window \(S\): the longest repeating suffix \(\mathrm{lrs}(S)\), namely the longest suffix with at least two occurrences in \(S\), and the shortest quasi-unique suffix \(\mathrm{sqs}(S)\), namely the shortest suffix with at most two occurrences in \(S\). Their interaction controls when MUSs are inserted or deleted after a slide [1909.02804].

The maintenance algorithm operates in \(O(n\log \sigma)\) time and \(O(d)\) space, where \(\sigma\) is the maximum number of distinct characters in every window. Its core data structures are a sliding-window suffix tree, three active points—the primary point \(pp_{i,j}\) for \(\mathrm{lrs}_{i,j}\), the secondary point \(sp_{i,j}\) for \(\mathrm{sqs}_{i,j}\), and the tertiary point \(tp_{i,j}\) for the longest suffix occurring at least three times—and circular arrays \(S2E\) and \(E2S\) of length \(d\), which record the unique end of the MUS starting at a position and the start of the MUS ending at a position. Because MUSs do not nest, these arrays support \(O(1)\) insertion and deletion of individual MUS intervals. Setting \(d=n\) yields an online \(O(n\log \sigma)\)-time, \(O(n)\)-space algorithm for all MUSs of \(T\) [1909.02804].

## 5. Extremal combinatorics and local density

Although \(|\MUS(T)|\le n\) globally, MUSs can cluster around a single position. For
\[
MUS(T,i)=\{w\in MUS(T)\mid w=T[k..j]\text{ with }k\le i\le j\},
\]
the maximum possible value of \(|MUS(T,i)|\) over strings of length \(n\) is \(\Theta(\sqrt{n})\). The upper bound states that \(|MUS(T,i)|=O(\sqrt{n})\) for every \(T\) and every position \(i\); the lower bound gives an infinite family of strings \(T_m\) of length \(\Theta(m^2)\) and a position \(p\) such that \(|MUS(T_m,p)|\ge m-2=\Omega(\sqrt{|T_m|})\) [2508.16092].

This local bound has direct algorithmic consequences. Any data structure that must list all MUSs covering a query position may require \(\Omega(\sqrt{n})\) output time in the worst case. The same paper notes that, under single-character edits, a position-based update can destroy and create MUSs covering the edited position, and the \(\Theta(\sqrt{n})\) crossing bound quantifies the worst-case local sensitivity of MUS sets [2508.16092].

Related SUS bounds show that MUSs act as a sparse underlying structure for denser shortest-covering families. If \(m=|\MUS_S|\), then the total number of point-SUS intervals over all positions satisfies
\[
|\mathcal{PS}_S|\le \left\lfloor\frac{3n-1}{2}\right\rfloor,
\]
and this is tight; for non-trivial interval-SUSs,
\[
|\mathcal{IS}_S|\le 2n-m\le 2n.
\]
These results explain why output-sensitive SUS data structures remain linear in total output size even though they may report more intervals than the MUS set itself [1609.07220].

## 6. Variants, applications, and open directions

The exact uniqueness model has been extended to approximate uniqueness. In the \(k\)-mismatch setting, a substring \(S[a..b]\) is \(k\)-mismatch unique if there is no other equal-length substring \(S[a'..b']\) with Hamming distance at most \(k\). The corresponding shortest-covering query, denoted \(SUS^k(p)\), can be solved by an in-place three-stage framework: first compute left-bounded shortest unique substrings \(LSUS^k\), then the rightmost shortest \(LSUS\) covering each position \(SLS^k\), and finally assemble \(SUS^k\) either from \(SLS^k\) or by extending the previous answer. The framework uses only the read-only string \(S\) plus arrays \(A\) and \(B\), for peak memory \(2n\) machine words \(+\,n\) bytes, and runs in \(O(n)\) time for \(k=0\) and \(O(n^2)\) time for any \(k\ge 1\) [1512.00378].

Applications of MUS- and SUS-based uniqueness analysis are concentrated in string indexing and computational biology. The sliding-window work explicitly lists shortest-unique-substring queries, anti-dictionary compression via minimal absent words, and indexing problems in bioinformatics; the approximate framework further points to primer design for PCR, read-uniqueness in genome assembly, and marker discovery between strains, where a bounded number of mismatches must be tolerated [1909.02804] [1512.00378].

Several open directions remain explicit in the literature. Proposed extensions include handling edits in dynamic strings and higher-order “unique fragments” under different occurrence models [1909.02804]. On the SUS side, open questions include whether the all-point-SUS problem can be solved in less than \(O(n)\) space, whether the same \(O(n)\)-preprocessing and \(O(k)\)-query bounds can be achieved on compressed representations such as run-length or grammar compression, and whether the fixed-alphabet conjecture
\[
|\mathcal{PS}_S|\le n+\sigma-2
\]
holds for all strings over an alphabet of size \(\sigma\) [1609.07220]. These questions indicate that, despite the linear-time computability of MUSs and their clean non-nesting structure, the fine-grained geometry of uniqueness in strings is still not fully characterized.

Source: https://www.emergentmind.com/topics/minimal-unique-substring-mus