Testing Suffixient Sets


Abstract

Suffixient sets are a novel prefix array (PA) compression technique based on subsampling PA (rather than compressing the entire array like previous techniques used to do): by storing very few entries of PA (in fact, a compressed number of entries), one can prove that pattern matching via binary search is still possible provided that random access is available on the text. In this paper, we tackle the problems of determining whether a given subset of text positions is (1) a suffixient set or (2) a suffixient set of minimum cardinality. We provide linear-time algorithms solving these problems.

1 Introduction↩︎

Suffixient sets (see Definition 1 for a formal definition) are a new suffix array (SA) [1] compression technique introduced by Depuydt et al.in 2024 [2], [3]. Unlike previous approaches, this method compresses the Prefix Array (PA), i.e., the mirror version of the SA storing the co-lexicographic order of the text’s prefixes, by subsampling a small set of positions corresponding to right-maximal substrings in the original text, rather than encoding the full PA. In [3], we proved that this subset of PA positions is sufficient to support pattern matching queries [4] via binary search, just as with the original suffix array, when providing random access to the text. In particular, this novel compression scheme outperforms the \(r\)-index [5] both in time and space due to a better memory locality and to the fact that the size of the smallest suffixient set is often smaller than the number of equal-letter runs in the Burrows-Wheeler transform (the parameter that ultimately determines the size of the r-index).

The size of indexes based on suffixient sets, such as the suffixient array in [3], is directly influenced by the cardinality of these sets. This underlines the importance of computing a suffixient set with the fewest amount of samples. In a previous work presented at SPIRE [6], we addressed the problem of computing a suffixient set of minimum cardinality for any given text. That work, however, left open the following complementary (and natural) questions:

Given set \(S \subseteq [1,n]\) and a text \(T \in \Sigma^n\), is \(S\) a suffixient set for \(T\)?

Given a suffixient set \(S \subseteq [1,n]\) and a text \(T \in \Sigma^n\), is \(S\) a suffixient set of minimum cardinality for \(T\)?

Observe that these natural problems were tackled for string attractors in [7]. Suffixient sets are indeed string attractors [3], but possess additional properties which make the algorithm in [7] not suitable for solving the above problems.

In this paper, we show that Problems [problem1] and [problem2] can be solved in linear time. An implementation of our algorithms is publicly available online in the repository https://github.com/regindex/suffixient.

2 Preliminaries↩︎

Given \(i, j, n \in \mathbb{N}\) such that \(1, \leq i, j \leq n\), and given a finite alphabet \(\Sigma = \{1, \dots, \sigma\}\), we use the following notation: \([i, j] = \{i, i + 1, \dots, j\}\), if \(i \leq j\) and \([i, j] = \emptyset\), otherwise; \([n]\) for the interval \([1, n]\); \(T = T[1, n]\) for a length-\(n\) string \(T\) over \(\Sigma\); \(\vert T \vert\) for the length of \(T\); \(\varepsilon\) for the empty string, which is the only string satisfying \(\vert \varepsilon \vert = 0\); \(T[i]\) for the \(i\)-th character of \(T\); \(T[i, j]\) for the substring \(T[i] \dots T[j]\), if \(i \leq j\), and \(T[i, j] = \varepsilon\), otherwise; \(T[1, i]\) for a prefix of \(T\) ending a position \(i\), and \(T[j, n]\) for a suffix of \(T\) starting at position \(j\). We define \(T^{\text{rev}} = T[n] \dots T[1]\). Given an integer array \(\mathcal{A}\), the previous smaller value array of \(\mathcal{A}\) is an integer array of length \(\vert \mathcal{A} \vert\) defined as \(\mathrm{PSV}(\mathcal{A})[i] = \max(\{j \,|\, j < i, A[j] < A[i]\}\cup \{0\})\) for all \(i\in [\vert \mathcal{A} \vert]\). The next smaller value array of \(\mathcal{A}\) is defined as \(\mathrm{NSV}(\mathcal{A})[i] = \min(\{j \,|\, j > i,A[j] < A[i]\}\cup \{ \vert \mathcal{A} \vert + 1 \})\) for all \(i\in [\vert \mathcal{A} \vert]\).

We assume the reader to be familiar with the concepts of suffix array (\(\mathrm{SA}\)), Burrows-Wheeler Transform (\(\mathrm{BWT}\)), and Longest Common Prefix array (\(\mathrm{LCP}\)). For space reasons, we give the formal definitions in Appendix 6. By \(\mathrm{BWT}_r\), \(\mathrm{SA}_r\) and \(\mathrm{LCP}_r\) we mean \(\mathrm{BWT}(T^{\text{rev}})\), \(\mathrm{SA}(T^{\text{rev}})\), and \(\mathrm{LCP}(T^{\text{rev}})\), respectively. Given \(T \in \Sigma^n\) and \(i \in [n]\), by \(text(i) = n - \mathrm{SA}_r[i] + 1\) we indicate the position in \(T\) corresponding to the character \(\mathrm{BWT}_r[i]\). Moreover, given \(x \in [n]\) we denote by \(bwt(x) = \mathrm{SA}_r^{-1}[n + 1 - x]\) the position in \(\mathrm{BWT}_r\) of the character \(T[x]\). For any \(bwt(x) = k\), we define \(bwt(x)_{max} = k_{max} = k + 1\) if \(k < \vert \mathrm{BWT}_r\vert\) and \(\mathrm{LCP}_r[k] \leq \mathrm{LCP}_r[k + 1]\) and \(bwt(x)_{max} = k_{max} = k\), otherwise. For any \(i \in [2, n]\) and \(a, c \in \Sigma\), we say \(i\) is a \(c\)-run break if \(\mathrm{BWT}_r[i- 1, i] = ac\) or \(\mathrm{BWT}_r[i - 1, i] = ca\) and \(a \neq c\). We use \(box(k)\) to denote the maximal interval \([l_k, r_k]\) such that \(k \in [l_k, r_k]\) and \(\mathrm{LCP}_r[k] \leq \mathrm{LCP}_r[h]\), for \(h \in [l_k, r_k]\). We compute \(box(k) = [l_k, r_k] = [\mathrm{PSV}[k] + 1, \mathrm{NSV}[k] - 1]\) in \(O(1)\) time, where by \(\mathrm{PSV}\) and \(\mathrm{NSV}\) we mean \(\mathrm{PSV}(\mathrm{LCP}_r)\) and \(\mathrm{NSV}(\mathrm{LCP}_r)\), respectively.

We say that \(T[x, y]\) (\(x - 1 \leq y\)) is a right-maximal substring of \(T \in \Sigma^n\) if \(T[x, y]\) is a suffix of \(T\) or there exists \(a, b \in \Sigma\) such that \(a \neq b\) and both \(T[x, y]\cdot a\) and \(T[x, y]\cdot b\) occur in \(T\). Also, for \(c \in \{a, b\}\) we say that \(T[x, y]\cdot c\) is a one-character right-extension. In particular, we say that \(T[x, y]\cdot c\) is a \(c\)-right-extension. Note that the empty string \(\varepsilon\) is also right-maximal.

2.1 Suffixient sets↩︎

We start this section by recalling the suffixient set definition.

Definition 1 (Suffixient set [2], [6]). A set \(S \subseteq [n]\) is suffixient* for a string \(T\) if, for every one-character right-extension \(T[i,j]\) (\(j\geq i\)) of every right-maximal string \(T[i,j-1]\), there exists \(x\in S\) such that \(T[i,j]\) is a suffix of \(T[1,x]\).*

In [6], Cenzato et al. studied methods to build suffixient sets of smallest cardinality. All of their algorithms that compute a smallest suffixient set rely on the notion of supermaximal extensions.

Definition 2 (Supermaximal extensions [3], [6]). We say that \(T[i,j]\) (with \(j \ge i\)) is a supermaximal extension* if \(T[i,j-1]\) is right-maximal, and for each right-maximal \(T[i',j'-1] \neq T[i,j-1]\) (with \(i' \le j' \le n\)), \(T[i,j]\) is not a suffix of \(T[i',j']\).*

As proven in [3], [6], the set described in the following definition is, indeed, a suffixient set of the smallest cardinality.

Definition 3 (Suffixient set of smallest cardinality, [3], [6]). Let \(<_t\) be any total order on \([n]\). We define a set \(\mathcal{S}\subseteq [n]\) as follows: \(x \in \mathcal{S}\) if and only if there exists a supermaximal extension \(T[i,j]\) such that (i) \(T[i,j]\) is a suffix of \(T[1,x]\), and (ii) for all prefixes \(T[1,y]\) suffixed by \(T[i,j]\), if \(y\neq x\) then \(y <_t x\).

3 Testing suffixient sets↩︎

In the search for a method to solve Problem [problem1], as a first step, by Definition 1 it seems natural to find a strategy to capture all of the right-maximal substrings of \(T\). In that sense, the following observation will be useful.

For each \(c\)-right-extension \(T[k, l]\) \((k \leq l)\) of every right-maximal string \(T[k, l - 1]\), there exists at least one \(c\)-run break \(i\) such that \(T[k, l]\) is a suffix of \(T[text(i') - \mathrm{LCP}_r[i], text(i')]\), with \(i' \in \{i - 1, i\}\) and \(\mathrm{BWT}_r[i'] = c\).

This observation induces an operative method to solve Problem [problem1]: for each run-break \(i\), with \(i' \in \{i - 1, i\}\) evaluate if there exists \(x \in \mathcal{S}\) such that \(T[text(i') - \mathrm{LCP}_r[i], text(i')]\) suffixes \(T[1, x]\).

In the following, in Lemma 1 we show a method to determine if one string suffixes another in \(O(1)\) time, so we can easily develop a quadratic algorithm solving Problem [problem1] (Section 3.1), and in Section 3.2 we present the linear-time version of this method. Finally, in Section 3.3 we present a method to solve Problem [problem2] by generalizing the approach used in the previous sections.

3.1 A simple quadratic algorithm for Suffixiency↩︎

From the following lemma, we obtain a method to evaluate if \(T[1, x]\) is suffixed by a right-extension \(T[y, z]\) in \(O(1)\) time.

Lemma 1. Given \(x \in [n]\), let \(k = bwt(x)\), and let \(j\) be a \(c\)-run break, such that \(j' \in \{j - 1, j\}\) and \(\mathrm{BWT}_r[j'] = c\). We have, \(P = T[text(j') - \mathrm{LCP}_r[j], text(j')]\) suffixes \(T[1, x]\) if and only if \(\mathrm{BWT}_r[k] = c\) and \(\mathrm{PSV}[j] < k_{\max} < \mathrm{NSV}[j]\).

Proof. (\(\Rightarrow\)) Let \(Q = T[x - \mathrm{LCP}_r[k_{\max}], x]\) and assume that \(P\) suffixes \(T[1, x]\). By definition of \(\mathrm{SA}_r\), \(\mathrm{LCP}_r[k_{max}]\) is the length of the largest suffix that \(T[1, x]\) shares with any other substring of \(T\), then \(P\) also suffixes \(Q\). In particular, \(P' = P[1, \vert P \vert - 1]\) suffixes \(Q' = Q[1, \vert Q \vert - 1]\), so the area in \(\mathrm{SA}_r\) corresponding to \((Q')^{\text{rev}}\) is included in the area in \(\mathrm{SA}_r\) of \((P')^{\text{rev}}\), which implies \(\mathrm{PSV}[j] < k_{\max} < \mathrm{NSV}[j]\). In addition, since \(P\) suffixes \(T[1, x]\), we have \(T[text(j')] = T[x] = \mathrm{BWT}_r[j'] = \mathrm{BWT}_r[k] = c\).

(\(\Leftarrow\)) We proceed by the contrapositive. Assume \(P\) does not suffixes \(T[1, x]\). Then, we have \(T[text(j')] = \mathrm{BWT}_r[j'] \neq \mathrm{BWT}_r[k] = T[x]\) or \(k_{\max} \not\in box(j)\), which implies \(k_{\max} \leq \mathrm{PSV}[j]\) or \(\mathrm{PSV}[j] \leq k_{\max}\). 0◻ ◻

From Observation [obs:run-break-right-ext] and Lemma 1 we immediately obtain a simple algorithm to solve Problem [problem1]: for each \(c\)-run break \(i\) in \(\mathrm{BWT}_r\) evaluate if there exists \(x \in \mathcal{S}\) such that \(bwt(x)_{\max} \in box(i)\) and \(\mathrm{BWT}_r[bwt(x)] = c\). Since there are \(O(n)\) run-breaks in \(\mathrm{BWT}_r\), and in the worst case we have to scan the whole set \(\mathcal{S}\) to find such an \(x\), and \(\vert \mathcal{S}\vert = O(n)\), this simple algorithm runs in \(O(n^2)\) time.

3.2 A linear algorithm for Suffixiency↩︎

In this section, we propose a method to evaluate each position \(x\) in \(\mathcal{S}\) only while \(T[1, x]\) is suffixed by the strings induced by the run-breaks we process, ultimately leading to a linear-time algorithm.

In a first step, we take advantage of the following.

Lemma 2. Let \(i \in [n]\) and let \(i \neq j \in [n]\) such that \(j \not\in box(i)\). If \(j < i\) then for any \(k < j\), we have \(k \not\in box(i)\). On the other hand, if \(i < j\), then for any \(j < g\), it holds \(g \not \in box(i)\).

Proof. Since \(j \not\in box(i)\), we have \(j \leq \mathrm{PSV}[i]\) or \(\mathrm{NSV}[i] \leq j\). In the former case, we have \(j < i\), so \(k < j \leq \mathrm{PSV}[i]\) holds for any \(k < j\), then \(k \not\in box(i)\). In the second case, we have \(i < j\), thus \(\mathrm{NSV}[i] < j < g\) holds for any \(j < g\), so \(g \not\in box(i)\).0◻ ◻

Suppose that for some \(c\)-run break \(i\) (with \(i' \in \{i - 1, i\}\) and \(\mathrm{BWT}_r[i'] = c\)) we want to determine if there exists \(x \in \mathcal{S}\) such that \(P = T[text(i') - \mathrm{LCP}_r[i], text(i')]\) suffixes \(T[1, x]\). Lemma 2 tells us that if \(bwt(x)_{\max} \not\in box(i)\), we have two cases: (i) if \(bwt(x)_{\max} < i\), then for any \(y \in \mathcal{S}\) such that \(bwt(y)_{\max} < bwt(x)_{\max}\) we have \(P\) also does not suffix \(T[1, y]\); otherwise, (ii) for any \(z \in \mathcal{S}\) such that \(bwt(x)_{\max} < bwt(z)_{\max}\) we have \(P\) also does not suffix \(T[1, z]\).

Following the above idea, we propose the first linear-time algorithm to solve Problem [problem1]. This procedure is summarized in Algorithm 3 in Appendix 5.

The algorithm maintains three sets during the computation: a set \(\mathcal{A} = \{bwt(x) \mid x \in \mathcal{S}\}\) (i.e., the elements of \(\mathcal{S}\) replaced by their position in \(\mathrm{BWT}_r\)), a set \(\mathcal{B} = sort(\mathcal{A})\), and a set \(\mathcal{C}\) such that \(\mathcal{C}[c][k] = h_{\max}\), where \(h\) is the \(k\)-th entry in \(\mathcal{B}\) with \(\mathrm{BWT}_r[h] = c\). Now, for a given \(c\)-run break \(i\), suppose that we scan \(\mathcal{C}[c]\) from \(1\) to \(a \in [n]\) until we find for the first entry such that \(\mathcal{C}[c][a] \in box(i)\), then for the next \(c\)-run break \(j\) (with \(j' \in \{j - 1, j\}\) and \(\mathrm{BWT}[j'] = c\)) there is no need to scan positions \(1, \dots, a - 1\) of \(\mathcal{C}[c]\), since we know that \(T[text(j') - \mathrm{LCP}_r[j], text(j')]\) cannot suffix any of the prefixes of \(T\) induced by those positions. Using this observation, we keep, for each \(c \in \Sigma\), a pointer in \(\mathcal{P}[c]\), pointing to the last visited element in \(\mathcal{C}[c]\). Then, each time we find a \(c\)-run break \(i\), we start comparing from the last pointed position of \(\mathcal{C}[c]\). If we reach a position \(h > i\), and \(h_{\max} \not\in box(i)\), then we know that \(\mathcal{S}\) cannot be suffixient.

Algorithm 3 runs in linear time and space. Arrays \(\mathrm{BWT}_r\), \(\mathrm{SA}\), \(\mathrm{LCP}_r\), \(\mathrm{PSV}\), and \(\mathrm{NSV}\) consume \(O(n)\) space. Arrays \(\mathcal{A}\), \(\mathcal{B}\), and \(\mathcal{C}\) use \(\vert \mathcal{S} \vert = O(n)\), and the array \(\mathcal{P}\) uses \(O(\sigma)\) space. So, the total algorithm space consumption is \(O(n)\). Computing arrays on lines [line:linear95computing-arrays] and [line:linear95computing-psv-nsv] takes \(O(n)\) time [1], [8]. In addition, computing the sets \(\mathcal{A}\) (by computing \(\mathrm{SA}_r^{-1}[n - s + 1]\)), \(\mathcal{B}\) (by radix-sorting \(\mathcal{A}\)), and \(\mathcal{C}\) (by traversing \(\mathcal{B}\) and appending \(i_{\max}\) to the end of \(\mathcal{C}[\mathrm{BWT}_r(i)]\) in \(O(1)\) for each \(i \in \mathcal{B}\)) on line [line:linear95computing-sets] also takes \(O(n)\) time. Finally, the rest of the algorithm is a scan of \(\mathrm{BWT}_r\), which can be done in \(O(n)\) time, and a while loop inside that scan of \(\mathrm{BWT}_r\) which sequentially traverses in total at most the \(\vert \mathcal{S}\vert\) positions in all the list in \(\mathcal{C}\), so Algorithm 3 runs in linear-time. Correctness follows from Lemmas 1 and 2.

In other words, we have proven the following.

Lemma 3. Given \(T\in \Sigma^n\) and \(\mathcal{S}\subseteq [n]\), Algorithm 3 solves Problem [problem1] in \(O(n)\) time and \(O(n)\) words of space.

3.3 Testing Minimum Suffixiency↩︎

Let \(\mathcal{S}\subseteq [n]\) be a suffixient set for \(T \in \Sigma^n\). By Definition 3, have that \(\mathcal{S}\) is of the smallest cardinality for \(T\) if for each \(x, y \in \mathcal{S}\) such that \(x \neq y\) it holds \(T[x - \mathrm{LCP}_r[bwt(x)_{\max}], x]\) does not suffix \(T[y - \mathrm{LCP}_r[bwt(y)_{\max}], y]\), and vice versa. From the above analysis, we get the following.

A suffixient set \(\mathcal{S}\) is a suffixient set of the smallest cardinality for \(T\) if for any \(x, y \in \mathcal{S}\) such that \(x \neq y\), it holds \(\mathrm{BWT}_r[bwt(x)] \neq \mathrm{BWT}_r[bwt(y)]\) or \(box(bwt(x)_{\max}) \cap box(bwt(y)_{\max}) = \emptyset\).

Proof. Let \(k = bwt(x)\) and \(h = bwt(y)\). By Lemma 1 we have that \(P = T[x - \mathrm{LCP}_r[k_{\max}], x]\) suffixes \(Q = T[y - \mathrm{LCP}_r[h_{\max}], y]\) if and only if \(\mathrm{BWT}_r[k] = \mathrm{BWT}_r[h]\) and \(\mathrm{PSV}[k] < h_{\max} < \mathrm{NSV}[k]\). Similarly, we have that \(Q\) suffixes \(P\) if and only if \(\mathrm{BWT}_r[k] = \mathrm{BWT}_r[h]\) and \(\mathrm{PSV}[h] < k_{\max} < \mathrm{NSV}[h]\).Then, if neither \(P\) suffixes \(Q\) nor \(Q\) suffixes \(P\) we have \(\mathrm{BWT}_r[k] \neq \mathrm{BWT}_r[h]\) or \(h_{\max} \not\in box(k)\) and \(k_{\max} \not \in box(h)\), from which we conclude \(box(k_{\max}) \cap box(h_{\max}) = \emptyset\).0◻ ◻

We are now ready to show a linear-time algorithm to solve Problem [problem2]. This procedure is summarized in Algorithm 4 in Appendix 5.

The algorithm uses the same set \(\mathcal{C}\) as the one used in Algorithm 3, and if for some \(c \in \Sigma\) and \(j \in [2, \vert \mathcal{C}[c] \vert]\) it holds \(\mathrm{PSV}[\mathcal{C}[c][j]] < \mathrm{NSV}[\mathcal{C}[c][j - 1]]\) (so, their boxes overlap), we know that \(\mathcal{S}\) cannot be a suffixient set of the smallest cardinality. With respect to the running time, it takes \(O(n)\) time to compute the same arrays as those used in Algorithm 3. In addition, we sequentially scan the array \(\mathcal{C}\), which has exactly \(\vert \mathcal{S}\vert\) entries, so it takes \(O(n)\) time. Correctness follows from Lemma 1 and Proposition [lem:def-smallest-suffixient]. In other words, we have proven the following.

Lemma 4. Given \(T\in \Sigma^n\) and \(\mathcal{S}\subseteq [n]\), Algorithm 4 solves Problem [problem2] in \(O(n)\) time and \(O(n)\) words of space.

Since Algorithm 4 uses the same data structures as Algorithm 3 and it consists of a single scan of \(\mathcal{C}\), we can add it as an additional step of Algorithm 3 without changing the time bounds of both algorithms. We describe them separately for ease of explanation. In Algorithm 1, we show both tests working on a single algorithm.

Figure 1: Determines if \mathcal{S} is a smallest suffixient set for a string T\in\Sigma^n

Additionally, in Figure 2 of Appendix 4, we show an example of how Algorithms 3 and 4 work.

4 Example of data structures used to test Suffixiency and Minimum Suffixiency↩︎

In Figure 2 we show an example of the data structures used to test Suffixiency and Minimum Suffixiency. In the caption of the image it is described how the algorithms works.

Figure 2: The figure shows the data used by Algorithm 3 to solve problems [problem1] and [problem2]. There are three sets on the right of the figure: S_1 (which is suffixient of smallest cardinality), S_2 (which is not suffixient), and S_3 (which is suffixient but not of smallest cardinality). They are shown with the respective sets \mathcal{A}_j, \mathcal{B}_j, and \mathcal{C}_j (j \in[1, 3]) used in the algorithms. For brevity, we show how (i) Algorithm 3 works on the G-run breaks over the sets S_1 and S_2, and how (ii) Algorithm 4 works over the sets S_1 and S_3, and the lists \mathcal{C}_1[A] and \mathcal{C}_3[A]. (i) For the first G-run break at position 4, we have \mathrm{PSV}[4] = 3 < \mathcal{C}_1[G][P[G] = 1] = 5 < \mathrm{NSV}[4] = 8. For the next G-run break at position 5, we have \mathrm{PSV}[5] = 3 < \mathcal{C}_1[G][P[G] = 1] = 5 < \mathrm{NSV}[5] = 8. The next G-run break occurs at position 20. Since we have \mathcal{C}_1[G][P[G] = 1] = 5 < \mathrm{PSV}[20] = 16, we increment \mathcal{P}[G] = \mathcal{P}[G] + 1 = 2. Now, we have \mathrm{PSV}[20] = 16 < \mathcal{C}_1[G][P[G] = 2] = 20 < \mathrm{NSV}[20] = 21, and we conclude that every G-run break box is covered by some element in \mathcal{C}_1[G]. In the case of set S_2, for the first G-run break at position 4 we have \mathrm{PSV}[4], \mathrm{NSV}[4] < \mathcal{C}_2[G][P[G] = 1] = 20, so the algorithm rejects S_2 as a suffixient set. (ii) For \mathcal{C}_1[A], we have \mathrm{NSV}[\mathcal{C}_1[A][1] = 6] = 7 < 11 = \mathrm{PSV}[\mathcal{C}_1[A][2] = 12], \mathrm{NSV}[\mathcal{C}_1[A][2] = 12] = 13 < 16 = \mathrm{PSV}[\mathcal{C}_1[A][3] = 20], so we conclude that none of the G-right-extension included in \mathcal{S}_1 suffixes another of them. In the case of set S_3, we have \mathrm{PSV}[\mathcal{C}_3[A][3] = 12] = 11 < 13 = \mathrm{NSV}[\mathcal{C}[A][2] = 11], so the two boxes overlap and Algorithm 4 rejects the set S_3 as a suffixient set of smallest cardinality.

5 Algorithms testing Suffixiency and Minimum Suffixiency↩︎

In this section we show the algorithms described in Section 3. In Algorithm 3 we show the algorithm solving Problem [problem1] described in Section 3.2. In addition, in Algorithm 4 we show the algorithm solving Problem [problem2] described in Section 3.3.

Figure 3: Determines if \mathcal{S} is a suffixient set for a string T\in\Sigma^n
Figure 4: Determines if a suffixient set \mathcal{S} is of the smallest cardinality

6 Deferred material from Section 2↩︎

Given \(\alpha, \beta \in \Sigma^*\), the lexicographic order \(<_{lex}\) is defined as follows: \(\alpha <_{lex} \beta\) if and only if there exists \(j \in \mathbb{N}\) such that \(\alpha[1, j] = \beta[1, j]\) and \(j = \vert \alpha \vert\) or \(\alpha[j + 1] \neq \beta[j + 1]\). Given \(T\in\Sigma^n\), the suffix array \(\mathrm{SA}(T)\) of \(T\) is a permutation of \([n]\) such that for any \(1 \leq i < j \leq n\) holds \(T[\mathrm{SA}(T)[i], n] <_{lex} T[\mathrm{SA}(T)[j], n]\).

The longest common prefix \(lcp(\alpha, \beta)\) between \(\alpha\) and \(\beta\) is defined as \(lcp(\alpha, \beta) = \lambda\) if and only if for every \(i \in [\lambda]\) it holds \(\alpha[i] = \beta[i]\) and \(\lambda = \min(\vert \alpha \vert, \vert \beta \vert)\) or \(\alpha[\lambda + 1] \neq \beta[\lambda + 1]\).

The Longest Common Prefix array \(\mathrm{LCP}(T)\) of \(T\) is defined as \(\mathrm{LCP}(T)[i] = lcp(T[\mathrm{SA}(T)[i - 1], n], T[\mathrm{SA}(T)[i], n])\), if \(i \in [2, n]\), and \(\mathrm{LCP}(T)[i] = 0\), otherwise.

The Burrows-Wheeler Transform \(\mathrm{BWT}(T)\) is a permutation of the characters of \(T\) such that \(\mathrm{BWT}(T)[i]\) the character in \(T\) to the left of the starting position of the \(i\)-th suffix of \(T\), namely \(\mathrm{BWT}(T)[i] = T[\mathrm{SA}[i] - 1]\), if \(i \in [2, n]\), and \(\mathrm{BWT}(T)[i] = T[n]\), otherwise.

References↩︎

[1]
U. Manber and E. W. Myers, “Suffix arrays: A new method for on-line string searches,” SIAM J. Comput., vol. 22, no. 5, pp. 935–948, 1993, doi: 10.1137/0222058.
[2]
L. Depuydt, T. Gagie, B. Langmead, G. Manzini, and N. Prezza, “Suffixient sets,” CoRR, vol. abs/2312.01359, 2023, doi: 10.48550/ARXIV.2312.01359.
[3]
D. Cenzato et al., “Suffixient arrays: A new efficient suffix array compression technique,” CoRR, vol. abs/2407.18753, 2025, doi: 10.48550/ARXIV.2407.18753.
[4]
G. Navarro, “Indexing highly repetitive string collections, part II: Compressed indexes,” ACM Comput. Surv., vol. 54, no. 2, pp. 26:1–26:32, 2022, doi: 10.1145/3432999.
[5]
T. Gagie, G. Navarro, and N. Prezza, “Fully functional suffix trees and optimal text searching in BWT-runs bounded space,” J. ACM, vol. 67, no. 1, pp. 2:1–2:54, 2020, doi: 10.1145/3375890.
[6]
D. Cenzato, F. Olivares, and N. Prezza, “On computing the smallest suffixient set , booktitle = Proceedings of 31st International Symposium on String Processing and Information Retrieval, SPIRE 2024, series = Lecture Notes in Computer Science,” 2024, vol. 14899, pp. 73–87, doi: 10.1007/978-3-031-72200-4\_6.
[7]
D. Kempa, A. Policriti, N. Prezza, and booktitle=26th. A. E. S. on A. (ESA. 2018). Rotenberg Eva, “String attractors: Verification and optimization,” 2018 , organization={Schloss Dagstuhl--Leibniz-Zentrum f{\"u}r Informatik}, pp. 52–1.
[8]
O. Berkman, B. Schieber, and U. Vishkin, “Optimal doubly logarithmic parallel algorithms based on finding all nearest smaller values,” Journal of Algorithms, vol. 14, no. 3, pp. 344–370, 1993, doi: 10.1006/jagm.1993.1018.

  1. Funded by the European Union (ERC, REGINDEX, 101039208). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council. Neither the European Union nor the granting authority can be held responsible for them.↩︎

  2. Funded by Basal Funds FB0001 and AFB240001, and Fondecyt Grant 1260080, ANID, Chile.↩︎