Abstract 1 Introduction 2 Preliminaries 3 Occurrences of maximal repeats crossing the edited position 4 Upper bound for total out-degrees of nodes w.r.t. π—‘πŸβˆͺπ—‘πŸ‘β’π€ 5 Upper bound for total out-degrees of nodes w.r.t. π—‘πŸβˆͺ𝗀 6 Upper bound for total out-degrees of nodes w.r.t. π—‘πŸ‘β’π 7 Tighter upper bound for strings ending with $ 8 Conclusions References

Constant Multiplicative Sensitivity on the CDAWGs

Rikuya Hamai ORCID Department of Information Science and Technology, Kyushu University, Fukuoka, Japan    Hiroto Fujimaru ORCID Department of Information Science and Technology, Kyushu University, Fukuoka, Japan    Shunsuke Inenaga ORCID Department of Informatics, Kyushu University, Fukuoka, Japan
Abstract

Compact directed acyclic word graphs (CDAWGs) [Blumer et al. 1987] are a fundamental data structure on strings with applications in text pattern searching, data compression, and pattern discovery. Intuitively, the CDAWG of a string T is obtained by merging isomorphic subtrees of the suffix tree [Weiner 1973] of the same string T, and thus CDAWGs are a compact indexing structure. Indeed, the CDAWG size 𝖾 can be sublinear in n for some highly repetitive strings. Of its various applications, the CDAWG allows for computing pattern occurrences, maximal exact matches (MEMs), minimal absent words (MAWs), and minimal unique substrings (MUSs) in optimal time using O⁒(𝖾) space. For designing space-efficient data storage, it is crucial that the underlying data structure is robust against data edits and errors. As a mathematical measure for this, the notion of compression sensitivity [Akagi et al. 2023] was introduced as the maximum of the size increase in the compressed data structures after edits operations. In this paper, we investigate the sensitivity of CDAWGs when a single character edit operation is performed at an arbitrary position in the input string T. We show that the size of the CDAWG after an edit operation on T is asymptotically at most 8 times larger than the original CDAWG before the edit. This O⁒(1) upper bound significantly improves on the only known upper bound O⁒(n/log⁑n) for the problem.

Keywords and phrases:
string data structures, maximal repeats, data compression, compression sensitivity, CDAWGs
Funding:
Rikuya Hamai: JST BOOST Grant Number JPMJBS2406.
Hiroto Fujimaru: JST BOOST Grant Number JPMJBS2406.
Shunsuke Inenaga: JSPS KAKENHI Grant Numbers JP23K24808 and JP23K18466.
Copyright and License:
[Uncaptioned image] © Rikuya Hamai, Hiroto Fujimaru, and Shunsuke Inenaga; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Mathematics of computing β†’ Combinatorial algorithms
Editors:
Philip Bille and Nicola Prezza

1 Introduction

Compact directed acyclic word graphs (CDAWGs) [4] are a fundamental data structure on strings with applications in text pattern searching, data compression, and pattern discovery. Intuitively, the CDAWG of a string T (denoted 𝖒𝖣𝖠𝖢𝖦⁒(T)) is a minimal partial DFA that is obtained by merging isomorphic subtrees of the suffix tree [30] of the same string T. Let 𝖾 denote the size (i.e. the number of edges) of the CDAWG for the input string. It is known that 𝖾≀2⁒nβˆ’2 holds [4] for any strings of length n, and 𝖾 can be sublinear in n for some highly repetitive strings [27, 2, 25]. CDAWGs can thus be regarded as a compressed text indexing structure, which can be stored in O⁒(𝖾) space without explicitly storing the string [3, 14]. A grammar-based string compression of size O⁒(𝖾) is also known [3, 7].

Given a pattern P of length m, the CDAWG of text T permits exact pattern matching in optimal O⁒(m+o⁒c⁒c) time with O⁒(𝖾) space, where o⁒c⁒c is the number of occurrences of P in T. By adapting the suffix-tree based approach (Algorithm 1 in [23]), inexact matches such as exact maximal matches (MEMs) and generalized MEMs (k-MEMs and k-rare MEMs) can also be computed in optimal O⁒(m) time and with O⁒(𝖾) space by the CDAWG. Finding (generalized) MEMs has important applications in bioinformatics. CDAWGs are also used as a space-efficient data structure allowing for optimal-time detection of β€œunusual words” (such as minimal absent words (MAWs) [8], minimal unique substrings (MUSs) [13]), and string net occurrences [12] from the input string with O⁒(𝖾) space each [3, 16, 20]. On a more practical side, CDAWGs enjoy applications in natural language processing [29] and in analysis of text generated by language models (LMs) [19].

In this paper, we consider the multiplicative sensitivity of the CDAWG size 𝖾 which is defined by the worst-case value of 𝖾⁒(Tβ€²)/𝖾⁒(T), where T is the input string and Tβ€² is a string obtained by performing a single-character edit operation on T. In case where the edit operation to the string T is performed at either end of T, then the multiplicative sensitivity of CDAWGs is known to be asymptotically at most 2, and it is tight [15, 9]. However, the general case with an arbitrary single-character-wise edit on T was not well understood for CDAWGs. In this paper, we prove that any edit operation at an arbitrary position on the string can increase the size of the CDAWG asymptotically at most 8 times larger than the original. We emphasize that the only known upper bound for the sensitivity of CDAWGs is O⁒(n/log⁑n), which trivially follows since π–ΎβˆˆO⁒(n) and π–ΎβˆˆΞ©β’(log⁑n) for any string of length n [4, 3]. Our technique for proving the constant sensitivity of CDAWGs is purely combinatorial, which involves new and original ideas that were not present in the special case of left/right-end edits [15, 9].

Compression sensitivity.

Following the earlier work of Lagarde and Perifel [18] and Akagi et al. [1], string compressors and repetitiveness measures can be categorized into three classes:

  1. (A)

    Stable: Those whose multiplicative sensitivity is O⁒(1);

  2. (B)

    Changeable: Those whose multiplicative sensitivity is polylog⁒(n);

  3. (C)

    Catastrophic: Those whose multiplicative sensitivity is O⁒(nc) with some constant 0<c≀1.

To mention a few of them, it is shown in [1] that Class (A) includes the substring complexity [17], the smallest macro scheme [28], the Lempel-Ziv 77 families [31, 28], and the smallest grammar [26, 6]. Our new result implies that the CDAWGs belong to Class (A). Class (B) includes run-length Burrows-Wheeler transform (RLBWT) as shown in [1, 10, 11], and lex-parse [24] as shown by Nakashima et al. [22]. It is shown by Lagarde and Perifel [18] that the Lempel-Ziv 78 [32] belongs to Class (C).

2 Preliminaries

Strings.

Let Ξ£ be an alphabet of size Οƒ. An element of Ξ£βˆ— is called a string. For a string TβˆˆΞ£βˆ—, the length of T is denoted by |T|. The empty string, denoted by Ξ΅, is the string of length 0. For any non-negative integer nβ‰₯0, let Ξ£n denote the set of strings of length n. For any two strings S and T, let 𝖾𝖽⁒(S,T) denote the edit distance between S and T. For any string T and a non-negative integer β„“β‰₯0, let 𝒦⁒(T,β„“)={Sβˆ£π–Ύπ–½β’(S,T)=β„“}.

For string T=u⁒v⁒w, u, v, and w are called a prefix, substring, and suffix of T, respectively. The sets of prefixes, substrings, and suffixes of string T are denoted by 𝖯𝗋𝖾𝖿𝗂𝗑⁒(T), π–²π—Žπ–»π—Œπ—π—‹β’(T), and π–²π—Žπ–Ώπ–Ώπ—‚π—‘β’(T), respectively. For a string T of length n, T⁒[i] denotes the ith character of T for 1≀i≀n, and T[i..j]=T[i]β‹―T[j] denotes the substring of T that begins at position i and ends at position j on T for 1≀i≀j≀n.

Maximal substrings and maximal repeats.

A substring wβˆˆπ–²π—Žπ–»π—Œπ—π—‹β’(T) of T is left-maximal if (1) wβˆˆπ–―π—‹π–Ύπ–Ώπ—‚π—‘β’(T) or (2) there exist two distinct characters a,b∈Σ such that a⁒w,b⁒wβˆˆπ–²π—Žπ–»π—Œπ—π—‹β’(T), and it is right-maximal if (1) wβˆˆπ–²π—Žπ–Ώπ–Ώπ—‚π—‘β’(T) or (2) there exist two distinct characters a,b∈Σ such that w⁒a,w⁒bβˆˆπ–²π—Žπ–»π—Œπ—π—‹β’(T). These substrings w that occur at least twice in T are also called left-maximal repeats and right-maximal repeats in T, respectively.

Let 𝖫𝖾𝖿𝗍𝖬⁒(T) and 𝖱𝗂𝗀𝗁𝗍𝖬⁒(T) denote the sets of left-maximal and right-maximal substrings in T. Let 𝖬⁒(T)=𝖫𝖾𝖿𝗍𝖬⁒(T)βˆ©π–±π—‚π—€π—π—π–¬β’(T). The elements in 𝖬⁒(T) are called maximal substrings in T, and the elements in 𝖬⁒(T)βˆ–{T} are called maximal repeats in T. A character a∈Σ is said to be a right-extension of a maximal repeat w of T if w⁒aβˆˆπ–²π—Žπ–»π—Œπ—π—‹β’(T).

For any substring w of a string T, we define its left-representation and right-representation by 𝗅𝖾𝗑𝗉T⁒(w)=α⁒w and 𝗋𝖾𝗑𝗉T⁒(w)=w⁒β, where Ξ±,Ξ²βˆˆΞ£βˆ— are the shortest strings such that α⁒w is left-maximal in T and w⁒β is right-maximal in T, respectively.

CDAWG.

The compact directed acyclic word graph (CDAWG) of a string T, denoted 𝖒𝖣𝖠𝖢𝖦⁒(T), is the minimal DFA that recognizes all substrings of T, in which each transition (edge) is labeled by a non-empty substring of T. 𝖒𝖣𝖠𝖢𝖦⁒(T) has a unique source that represents the empty string Ξ΅ and a unique sink that represents T. All the other internal nodes represent the maximal repeats in T, namely, the set of the longest strings represented by the nodes of 𝖒𝖣𝖠𝖢𝖦⁒(T) are equal to 𝖬⁒(T). See Figure 1 for a concrete example of CDAWGs. The size of 𝖒𝖣𝖠𝖢𝖦⁒(T) for a string T of length n is the number 𝖾⁒(T) of edges in 𝖒𝖣𝖠𝖢𝖦⁒(T), which is equal to the number of right-extensions of maximal repeats in T. For each xβˆˆπ–¬β’(T), let 𝖽T⁒(x) denote the number of out-edges of node x in 𝖒𝖣𝖠𝖢𝖦⁒(T). It is clear that 𝖾⁒(T)=βˆ‘xβˆˆπ–¬β’(T)𝖽T⁒(x). In what follows, we will identify maximal substrings with CDAWG nodes, and right-extensions of maximal repeats with CDAWG edges, respectively.

Figure 1: Illustration for 𝖒𝖣𝖠𝖢𝖦⁒(T) of string T=(πšŠπš‹)𝟸⁒𝚌⁒(πšŠπš‹)𝟸⁒𝚍. The longest strings represented by the nodes of 𝖒𝖣𝖠𝖢𝖦⁒(T) are the maximal substrings in 𝖬⁒(T)={Ξ΅,πšŠπš‹,(πšŠπš‹)𝟸,(πšŠπš‹)𝟸⁒𝚌⁒(πšŠπš‹)𝟸⁒𝚍}.

Sensitivity of CDAWG size and our results.

Using the measure 𝖾, we define the worst-case multiplicative sensitivity of the CDAWG with an edit operation (insertion, deletion, or substitution) by 𝖬𝖲⁒(𝖾,n)=maxT∈Σn,Tβ€²βˆˆπ’¦β’(T,1)⁑{𝖾⁒(Tβ€²)/𝖾⁒(T)}.

In this paper, we prove the following:

Theorem 1.

For any string T of length n, 𝖬𝖲⁒(𝖾,n)≀(8⁒𝖾+4)/𝖾 holds. For any string T of length n ending with a unique character $, 𝖬𝖲⁒(𝖾,n)≀(5⁒𝖾+4)/𝖾 holds.

3 Occurrences of maximal repeats crossing the edited position

To present an upper bound for the sensitivity of CDAWG size, it is essential to consider new occurrences of maximal repeats that contain or touch the edited position i. In this section, we introduce several new definitions regarding those new occurrences of maximal repeats.

Definition 2 (Crossing occurrences).

Let x=Tβ€²[j..k] be a non-empty substring of Tβ€² that touches or contains the edited position i. That is, if the edit operation is insertion and substitution, (1) k=iβˆ’1 (touching i from left), (2) j≀i≀k (containing i), or (3) j=i+1 (touching i from right). If the edit operation is deletion, (1) k=iβˆ’1 (touching i from left), (2) j≀iβˆ’1∧i≀k (containing i), or (3) j=i (touching i from right). These occurrences of a substring x in Tβ€² are said to be crossing occurrences for the edited position i. We will call these occurrences simply as crossing occurrences of x.

We denote the left most crossing occurrence Tβ€²[jβ€²..kβ€²] of x as xL. For xL, we consider the following substrings PxL and SxL of Tβ€² (see Figure 2 for illustration):

Figure 2: Illustration of xL in Tβ€² for the case where xL contains i, with insertion and substitution.

In the case that the edit operation is insertion or substitution, let

PxL = {Tβ€²[jβ€²..i]ifΒ xLΒ touchesΒ iΒ from left or containsΒ i,Ξ΅ifΒ xLΒ touchesΒ iΒ from right,
SxL = {Ξ΅ifΒ xLΒ touchesΒ iΒ from left,Tβ€²[i..kβ€²]ifΒ xLΒ containsΒ iΒ or touchesΒ iΒ from right.

In the case that the edit operation is deletion, let

PxL = {Tβ€²[jβ€²..iβˆ’1]ifΒ xLΒ touchesΒ iΒ from left or containsΒ i,Ξ΅ifΒ xLΒ touchesΒ iΒ from right,
SxL = {Ξ΅ifΒ xLΒ touchesΒ iΒ from left,Tβ€²[i..kβ€²]ifΒ xLΒ containsΒ iΒ or touchesΒ iΒ from right.

We define the rightmost crossing occurrence xR, together with PxR and SxR, analogously.

Definition 3.

We categorize strings x that have crossing occurrence(s) in the edited string in Tβ€² into the five following types, depending on the properties of x:

Type (i):

x has only one crossing occurrence of x in Tβ€².

Type (ii):
  1. 1.

    x has two or more crossing occurrences of x in Tβ€².

  2. 2.

    If all occurrences of x in Tβ€² are crossing occurrences of x in Tβ€², then xβˆ‰π–«π–Ύπ–Ώπ—π–¬β’(Tβ€²) and xβˆ‰π–±π—‚π—€π—π—π–¬β’(Tβ€²).

Type (iii):
  1. 1.

    x has two or more crossing occurrences of x in Tβ€².

  2. 2.

    If all occurrences of x in Tβ€² are crossing occurrences of x in Tβ€², then xβˆ‰π–«π–Ύπ–Ώπ—π–¬β’(Tβ€²) and xβˆˆπ–±π—‚π—€π—π—π–¬β’(Tβ€²).

Type (iv):
  1. 1.

    x has two or more crossing occurrences of x in Tβ€².

  2. 2.

    If all occurrences of x in Tβ€² are crossing occurrences of x in Tβ€², then xβˆˆπ–«π–Ύπ–Ώπ—π–¬β’(Tβ€²) and xβˆ‰π–±π—‚π—€π—π—π–¬β’(Tβ€²).

Type (v):
  1. 1.

    x has two or more crossing occurrences of x in Tβ€².

  2. 2.

    If all occurrences of x in Tβ€² are crossing occurrences of x in Tβ€², then xβˆˆπ–¬β’(Tβ€²).

Figure 3 illustrates the five types of a string x when xLβˆ‰π–―π—‹π–Ύπ–Ώπ—‚π—‘β’(Tβ€²) and xRβˆ‰π–²π—Žπ–Ώπ–Ώπ—‚π—‘β’(Tβ€²).

Figure 3: Illustration for the five types of a string x when xLβˆ‰π–―π—‹π–Ύπ–Ώπ—‚π—‘β’(Tβ€²) and xRβˆ‰π–²π—Žπ–Ώπ–Ώπ—‚π—‘β’(Tβ€²), where aβ‰ c and bβ‰ d for characters a,b,c,d∈Σ.

The reason why we only consider xL and xR is due to the periodicity for x. We remark that when x has multiple crossing occurrences which contain or touch the edited position i in Tβ€², then the characters immediately before all crossing occurrences of x in Tβ€² except for xL are the same and the characters immediately after all crossing occurrences of x in Tβ€² except for xR are the same. This is because when x has three or more crossing occurrences containing i in Tβ€², then all these crossing occurrences of x are periodic (c.f. [5, 21]). Therefore, to examine whether x is maximal in 𝖬⁒(Tβ€²) or not, we do not need to consider all crossing occurrences of x in Tβ€² other than xL and xR.

In Definitions 4 and 5 below, we introduce 𝖭 and 𝖰 which are respectively the sets of new maximal repeats and existing maximal repeats in Tβ€², such that 𝖭βˆͺ𝖰=𝖬⁒(Tβ€²)βˆ–{Tβ€²}. We then partition each of them into smaller subsets that are suitable for our needs.

Definition 4 (Partition of new maximal repeats).

Let 𝖭=(𝖬⁒(Tβ€²)βˆ–π–¬β’(T))βˆ–{Tβ€²} denote the set of new maximal repeats in Tβ€². We divide 𝖭 into the three following disjoint subsets 𝖭1=π–­βˆ©π–±π—‚π—€π—π—π–¬β’(T), 𝖭2=π–­βˆ©π–«π–Ύπ–Ώπ—π–¬β’(T), and 𝖭3=π–­βˆ–(𝖭1βˆͺ𝖭2). Further, we divide 𝖭3 into two disjoint subsets 𝖭3⁒B and 𝖭3⁒A as follows: 𝖭3⁒B is the set of strings xβˆˆπ–­3 such that (1) x is of Type (v), and (2) there is no other right-extension of x in Tβ€² than the right-extension(s) of the crossing occurrence(s) of x, and 𝖭3⁒A=𝖭3βˆ–π–­3⁒B.

We note that the following properties hold for 𝖭1,𝖭2 and 𝖭3 by definition:

  • β– 

    xβˆˆπ–­1β‡’xβˆ‰π–«π–Ύπ–Ώπ—π–¬β’(T) because xβˆ‰π–¬β’(T).

  • β– 

    xβˆˆπ–­2β‡’xβˆ‰π–±π—‚π—€π—π—π–¬β’(T) because xβˆ‰π–¬β’(T).

  • β– 

    xβˆˆπ–­3β‡’xβˆ‰π–±π—‚π—€π—π—π–¬β’(T)∧xβˆ‰π–«π–Ύπ–Ώπ—π–¬β’(T).

Definition 5.

Let 𝖰=(𝖬⁒(Tβ€²)βˆ©π–¬β’(T))βˆ–{Tβ€²} denote the set of existing maximal repeats in Tβ€². We divide 𝖰 into the two following subsets 𝖰1={xβˆˆπ–°βˆ£π–½T′⁒(x)>𝖽T⁒(x)} and 𝖰2={xβˆˆπ–°βˆ£π–½T′⁒(x)≀𝖽T⁒(x)}.

Namely, 𝖰1 (resp. 𝖰2) is the set of existing nodes of the CDAWG for which the number of out-edges increases (resp. does not increase).

Example 6.

Consider the string T=cabcabcdabca⁒𝐝⁒bcabcdabcabdcabcabcabdabcab and
the string Tβ€²=cabcabcdabca|bcabcdabcabdcabcabcabdabcab obtained by deleting the character T⁒[13]=𝐝 from T highlighted in bold. The edited position in Tβ€² is designated by a |. For instance, dabcabβˆˆπ–°1,bcabcβˆˆπ–°2,abcabcβˆˆπ–­1,abcabcabβˆˆπ–­3⁒A,cabcabcdabcabβˆˆπ–­3⁒B (also see Figure 4).

Figure 4: Illustration for Tβ€²=cabcabcdabca|bcabcdabcabdcabcabcabdabcab in Example 6 and the occurrences of abcabcβˆˆπ–­1 and cabcabcdabcabβˆˆπ–­3⁒B in Tβ€². The | symbol in Tβ€² exhibits the edit position. The solid line boxes exhibit the crossing occurrences of abcabc and cabcabcdabcab in Tβ€², and the dashed line boxes exhibit the non-crossing occurrences of them in Tβ€².

Recall that 𝖾=βˆ‘xβˆˆπ–¬β’(T)𝖽T⁒(x) denotes the number of edges in 𝖒𝖣𝖠𝖢𝖦⁒(T) before the edit. In the subsequent sections, we work on the three disjoint subsets 𝖭1βˆͺ𝖭3⁒A, 𝖭2βˆͺ𝖰, and 𝖭3⁒B of 𝖬⁒(Tβ€²), and show that βˆ‘xβˆˆπ–­1βˆͺ𝖭3⁒A𝖽T′⁒(x)≀3⁒𝖾+2 (Section 4), βˆ‘xβˆˆπ–­2βˆͺ𝖰𝖽T′⁒(x)≀3⁒𝖾+2 (Section 5), and βˆ‘xβˆˆπ–­3⁒B𝖽T′⁒(x)≀2⁒𝖾 (Section 6). All these immediately lead to Theorem 1 that upper bounds the number of edges in 𝖒𝖣𝖠𝖢𝖦⁒(Tβ€²) after the edit to 8⁒𝖾+4.

The tighter upper bound 5⁒𝖾+4 for strings ending with $ is shown in Section 7.

4 Upper bound for total out-degrees of nodes w.r.t. π—‘πŸβˆͺπ—‘πŸ‘β’π€

In this section, we show an upper bound for the total out-degrees of the nodes corresponding to strings in 𝖭1βˆͺ𝖭3⁒AβŠ†π–¬β’(Tβ€²). Recall that xβˆˆπ–­1βˆͺ𝖭3⁒A implies xβˆ‰π–«π–Ύπ–Ώπ—π–¬β’(T).

We first describe useful properties of strings xβˆˆπ–­1βˆͺ𝖭3⁒A.

Lemma 7.

Any xβˆˆπ–­1βˆͺ𝖭3⁒A occurs in T.

Proof.

In the case xβˆˆπ–­1, since xβˆˆπ–±π—‚π—€π—π—π–¬β’(T), x occurs in T.

Let us consider the case xβˆˆπ–­3⁒A that is of Type (i), (ii), (iii) or (iv). Since x is not of Type (v), if all occurrences of x in Tβ€² are crossing occurrences of x in Tβ€², then xβˆ‰π–¬β’(Tβ€²). Therefore, x occurs in T.

Let us consider the case xβˆˆπ–­3⁒A that is of Type (v). Due to the definition of 𝖭3⁒A, there exists a distinct right-extension of x in Tβ€² other than the right-extension(s) of the crossing occurrence(s) of x. Therefore, there is a non-crossing occurrence of x in Tβ€², which implies that x occurs in T (see also Figure 5). β—€

Figure 5: Illustration for Lemma 7 where i is the edited position and a,b,c differ from each other.
Lemma 8.

For any xβˆˆπ–­1βˆͺ𝖭3⁒A that is of Type (i), (ii) or (iii), there does not exist yβˆˆπ–­1βˆͺ𝖭3⁒A such that |y|>|x| and SxL=SyG, where G∈{L,R}.

Proof.

If xL is a prefix of Tβ€², then clearly there is no y satisfying |y|>|x| and SxL=SyG. In what follows, we consider the case that xL is not a prefix of Tβ€².

For a contrary, suppose that for xβˆˆπ–­1βˆͺ𝖭3⁒A that is of Type (i), (ii) or (iii), there exists yβˆˆπ–­1βˆͺ𝖭3⁒A such that |y|>|x| and SxL=SyG, where G∈{L,R}. See also Figure 6. Let a be the character immediately before xL. Since x is of Type (i), (ii) or (iii), every crossing occurrence of x in Tβ€² is immediately preceded by a. Because xβˆˆπ–¬β’(Tβ€²), it holds that xβˆˆπ–―π—‹π–Ύπ–Ώπ—‚π—‘β’(Tβ€²), or there is a distinct character bβˆˆΞ£βˆ–{a} such that b⁒x occurs in Tβ€². This implies that there is a non-crossing occurrence of x in Tβ€², which is as a prefix of T or is immediately preceded by b in T. By Lemma 7, y occurs in T, and thus a⁒x that is a suffix of y also occurs in T. Hence xβˆˆπ–«π–Ύπ–Ώπ—π–¬β’(T), however, this contradicts that xβˆ‰π–«π–Ύπ–Ώπ—π–¬β’(T). β—€

Figure 6: Illustration for Lemma 8: impossible occurrences of x and y with SxL=SyG.
Lemma 9.

For any xβˆˆπ–­1βˆͺ𝖭3⁒A that is of Type (iv) or (v), there do not exist y,zβˆˆπ–­1βˆͺ𝖭3⁒A with |y|>|x| and |z|>|x| satisfying SxL=SyG and SxR=SzF simultaneously, where G,F∈{L,R}.

Proof.

If xL is a prefix of Tβ€², then clearly there is no y satisfying |y|>|x| and SxL=SyG. In what follows, we consider the case that xL is not a prefix of Tβ€².

For a contrary, suppose that for xβˆˆπ–­1βˆͺ𝖭3⁒A that is of Type (iv) or (v), there exist y,zβˆˆπ–­1βˆͺ𝖭3⁒A with |y|>|x| and |z|>|x| such that SxL=SyG and SxR=SzF at the same time, where G,F∈{L,R}. Let the character immediately before xL and the character immediately before xR be a and c (aβ‰ c), respectively. By Lemma 7, y and z occur in T, and thus a⁒x that is a suffix of y and c⁒x that is a suffix of z both occur in T. Therefore, xβˆˆπ–«π–Ύπ–Ώπ—π–¬β’(T), however, this contradicts that xβˆ‰π–«π–Ύπ–Ώπ—π–¬β’(T). β—€

4.1 Correspondence between π—‘πŸβˆͺπ—‘πŸ‘β’π€ and 𝗠⁒(𝑻)

For any xβˆˆπ–­1βˆͺ𝖭3⁒A that is of Type (i), (ii) or (iii), we associate x with SxL. For any xβˆˆπ–­1βˆͺ𝖭3⁒A that is of Type (iv) or (v), if there does not exist yβˆˆπ–­1βˆͺ𝖭3⁒A such that |y|>|x| and SxL=SyG with G∈{L,R}, we associate x with SxL, and otherwise we associate x with SxR.

By Lemma 8 and Lemma 9, each xβˆˆπ–­1βˆͺ𝖭3⁒A can be associated to a distinct string SxG with G∈{L,R}. Note however that SxG may not be maximal in T. Thus we introduce a function U that bridges each xβˆˆπ–­1βˆͺ𝖭3⁒A to a distinct maximal substring in T.

Definition 10.

For any xβˆˆπ–­1βˆͺ𝖭3⁒A, let U⁒(x)=𝗅𝖾𝗑𝗉T⁒(SxG) (see Figure 7).

By Lemma 7, x occurs in T and thus its suffix SxG also occurs in T. Hence U⁒(x)=𝗅𝖾𝗑𝗉T⁒(SxG) is well defined.

Figure 7: Illustration for U⁒(x) (aβ‰ b).
Lemma 11.

For any xβˆˆπ–­1βˆͺ𝖭3⁒A, U⁒(x)βˆˆπ–¬β’(T).

Proof.

By Definition 10, U⁒(x)=𝗅𝖾𝗑𝗉T⁒(SxG)βˆˆπ–«π–Ύπ–Ώπ—π–¬β’(T). Therefore, it suffices for us to prove U⁒(x)βˆˆπ–±π—‚π—€π—π—π–¬β’(T). From now on, we consider the four following cases:

Case (a) π’™βˆˆπ—‘πŸ.

In this case, xβˆˆπ–±π—‚π—€π—π—π–¬β’(T), therefore SxG that is a suffix of x also satisfies SxGβˆˆπ–±π—‚π—€π—π—π–¬β’(T). Hence, U⁒(x)=𝗅𝖾𝗑𝗉T⁒(SxG)βˆˆπ–±π—‚π—€π—π—π–¬β’(T).

Case (b) π’™βˆˆπ—‘πŸ‘β’π€ and 𝒙 is of Type (𝐒), (𝐒𝐒) or (𝐒𝐯).

Let the character immediately after all crossing occurrences of x in Tβ€² be a. There exists x⁒b⁒(bβ‰ a) in Tβ€² or xβˆˆπ–²π—Žπ–Ώπ–Ώπ—‚π—‘β’(Tβ€²) because xβˆˆπ–¬β’(Tβ€²). Since the character immediately after all crossing occurrences of x in Tβ€² is a, then there exists x⁒b⁒(bβ‰ a) or xβˆˆπ–²π—Žπ–Ώπ–Ώπ—‚π—‘β’(T) in T. Hence, SxGβˆˆπ–±π—‚π—€π—π—π–¬β’(T) since the character immediately after SxG is a. Thus, U⁒(x)=𝗅𝖾𝗑𝗉T⁒(SxG)βˆˆπ–±π—‚π—€π—π—π–¬β’(T).

Case (c) π’™βˆˆπ—‘πŸ‘β’π€ and 𝒙 is of Type (𝐒𝐒𝐒).

Since x is of Type (iii), we associate x with SxL. Because x is of Type (iii) and SxL is a suffix of a SxR, SxGβˆˆπ–±π—‚π—€π—π—π–¬β’(T) holds. Thus, U⁒(x)=𝗅𝖾𝗑𝗉T⁒(SxG)βˆˆπ–±π—‚π—€π—π—π–¬β’(T).

Case (d) π’™βˆˆπ—‘πŸ‘β’π€ and 𝒙 is of Type (𝐯).

Let the character immediately after SxG be a. Since there exists a distinct right-extension of x in Tβ€² other than the right-extension(s) of the crossing occurrence(s) of x, there exists x⁒b (bβ‰ a) in T. Therefore, SxGβˆˆπ–±π—‚π—€π—π—π–¬β’(T). Thus, U⁒(x)=𝗅𝖾𝗑𝗉T⁒(SxG)βˆˆπ–±π—‚π—€π—π—π–¬β’(T).

Consequently, we have U⁒(x)βˆˆπ–¬β’(T). β—€

The next lemma states the uniqueness of U⁒(x).

Lemma 12.

For any x,yβˆˆπ–­1βˆͺ𝖭3⁒A with xβ‰ y, U⁒(x)β‰ U⁒(y).

Proof.

Suppose that there exist x,yβˆˆπ–­1βˆͺ𝖭3⁒A such that xβ‰ y and U⁒(x)=U⁒(y). Let x and y correspond to SxG and SyF, respectively, where G,F∈{L,R}. Let U⁒(x)=A⁒SxG,U⁒(y)=B⁒SyF⁒(A,Bβˆˆπ–²π—Žπ–»π—Œπ—π—‹β’(T)), and assume without loss of generality that |SxG|<|SyF| due to Lemma 8 and Lemma 9. Then |A|>|B| because U⁒(x)=U⁒(y). Since U⁒(y)=B⁒SyFβˆˆπ–¬β’(T) by Lemma 11, and since B⁒SxG is a prefix of B⁒SyF (see Figure 8), we have B⁒SxGβˆˆπ–«π–Ύπ–Ώπ—π–¬β’(T). This contradicts 𝗅𝖾𝗑𝗉T⁒(SxG)=A⁒SxG. β—€

Figure 8: Illustration for the proof of Lemma 12, where U⁒(x)=U⁒(y).

4.2 Upper bound w.r.t. π—‘πŸβˆͺπ—‘πŸ‘β’π€

Lemma 13.

βˆ‘xβˆˆπ–­1βˆͺ𝖭3⁒A𝖽T′⁒(x)≀3⁒𝖾+2.

Proof.

Let U⁒(x)=𝗅𝖾𝗑𝗉T⁒(SxG), where G∈{L,R}. Since SxG is a suffix of x, 𝖽T⁒(x)≀𝖽T⁒(U⁒(x)). Since there are at most two distinct characters immediately after the crossing occurrences of x, 𝖽T′⁒(x)≀𝖽T⁒(U⁒(x))+2. For U⁒(x)β‰ T, we have 𝖽T⁒(U⁒(x))β‰₯1. Thus 𝖽T′⁒(x)≀𝖽T⁒(U⁒(x))+2≀3⁒𝖽T⁒(U⁒(x)). For U⁒(x)=T, we have 𝖽T⁒(U⁒(x))=0. Thus 𝖽T′⁒(x)≀2. By using Lemma 12 and summing up these, we get βˆ‘xβˆˆπ–­1βˆͺ𝖭3⁒A𝖽T′⁒(x)β‰€βˆ‘xβˆˆπ–­1βˆͺ𝖭3⁒A3⁒𝖽T⁒(U⁒(x))+2≀3⁒𝖾+2. β—€

5 Upper bound for total out-degrees of nodes w.r.t. π—‘πŸβˆͺ𝗀

In this section, we show an upper bound for the total out-degrees of nodes corresponding to strings that are elements of 𝖭2βˆͺπ–°βŠ†π–¬β’(Tβ€²).

We first present properties of the strings in 𝖭2βˆͺ𝖰. In particular, we focus on the strings in 𝖭2βˆͺ𝖰1, as the strings in 𝖰2 are less important and can be handled in a trivial manner.

Lemma 14.

Any xβˆˆπ–­2βˆͺ𝖰1 occurs in T.

Proof.

Since xβˆˆπ–­2βˆͺ𝖰1, xβˆˆπ–«π–Ύπ–Ώπ—π–¬β’(T). Thus xβˆˆπ–­2βˆͺ𝖰1 occurs in T. β—€

Lemma 15.

For any xβˆˆπ–­2βˆͺ𝖰1 that is of Type (i), (ii) or (iv), there does not exist yβˆˆπ–­2βˆͺ𝖰1 such that |y|>|x| and PxG=PyF, where G,F∈{L,R}.

Proof.

The case that xβˆˆπ–­2 follows from a symmetrical argument to Lemma 8, in which y may belong to 𝖭2 or 𝖰1. Let us consider the case that xβˆˆπ–°1. Suppose that for xβˆˆπ–°1 which is of Type (i), (ii) or (iv), there is yβˆˆπ–­2βˆͺ𝖰1 such that |y|>|x| and PxG=PyF, where G,F∈{L,R}. If xR is a suffix of Tβ€², then there is no y such that |y|>|x| and PxG=PyF. From now on consider the case that xR is not a suffix of Tβ€². Let b be the character immediately after xG. Then, since x is of Type (i), (ii) or (iv), character b immediately follows every crossing occurrence of x in Tβ€². Note that x⁒b is a prefix of y. Due to Lemma 14, y occurs in T, implying x⁒b also occurs in T. Thus the number of right-extensions of x in Tβ€² is no more than the number of right-extensions of x in T. However, this contradicts xβˆˆπ–°1. β—€

Lemma 16.

For any xβˆˆπ–­2βˆͺ𝖰1 that is of Type (iii) or (v), there do not exist y,zβˆˆπ–­2βˆͺ𝖰1 with |y|>|x| and |z|>|x| satisfying PxL=PyG and PxR=PzF simultaneously, where G,F∈{L,R}.

Proof.

If xR is a suffix of Tβ€², then clearly there is no z satisfying |z|>|x| and PxR=SzG. In what follows, we consider the case that xR is not a suffix of Tβ€².

Suppose that for xβˆˆπ–­2βˆͺ𝖰1 which is of Type (iii) or (v), there exist y,zβˆˆπ–­2βˆͺ𝖰1 with |y|>|x|, |z|>|x| that satisfy PxL=PyG and PxR=PzF at the same time, where G,F∈{L,R}. Let b and d (bβ‰ d) be the character immediately after xL in Tβ€² and the character immediately after xR in Tβ€², respectively. By Lemma 14, y and z occur in T, and hence x⁒b that is a prefix of y and x⁒d that is a prefix of z also occur in T. Therefore, xβˆˆπ–±π—‚π—€π—π—π–¬β’(T). However, if xβˆˆπ–­2⁒(T), this contradicts xβˆ‰π–±π—‚π—€π—π—π–¬β’(T). Also, if xβˆˆπ–°1, the number of right-extensions of x in Tβ€² does not increase from the number of right-extensions of x in T. However, this contradicts xβˆˆπ–°1. β—€

5.1 Correspondence between π—‘πŸβˆͺπ—€πŸ and 𝗠⁒(𝑻)

For any xβˆˆπ–­2βˆͺ𝖰1 that is of Type (i), (ii) or (iv), then we associate x with both PxL and PxR. For any xβˆˆπ–­2βˆͺ𝖰1 that is of Type (iii) or (v),

  • β– 

    if there exists yβˆˆπ–­2βˆͺ𝖰1 with |y|>|x| such that PxR=PyG where G∈{L,R}, then we associate x with PxL (see Figure 9);

  • β– 

    if there exists yβˆˆπ–­2βˆͺ𝖰1 with |y|>|x| such that PxL=PyG where G∈{L,R}, then we associate x with PxR (see Figure 10);

  • β– 

    otherwise, we associate x with both PxL and PxR.

Figure 9: When there exists yβˆˆπ–­2βˆͺ𝖰1 with |y|>|x| such that PxR=PyG, where G∈{L,R}.
Figure 10: When there exists yβˆˆπ–­2βˆͺ𝖰1 with |y|>|x| such that PxL=PyG, where G∈{L,R}.

By Lemmas 15 and 16, each xβˆˆπ–­2βˆͺ𝖰1 corresponds to a distinct string PxG, where G∈{L,R}. Below, for each xβˆˆπ–­2βˆͺ𝖰1, we define H⁒(x) and I⁒(x) to which x corresponds:

Definition 17.

For each xβˆˆπ–­2βˆͺ𝖰1 associated to PxL, let H⁒(x)=𝗋𝖾𝗑𝗉T⁒(PxL). For each xβˆˆπ–­2βˆͺ𝖰1 associated to PxR, let I⁒(x)=𝗋𝖾𝗑𝗉T⁒(PxR). See Figure 11. When there is only one crossing occurrence of x (i.e. xL=xR), only H⁒(x) is defined as above and I⁒(x) is undefined.

H⁒(x) (resp. I⁒(x)) is undefined for any xβˆˆπ–­2βˆͺ𝖰1 that is not associated to PxL (resp. PxR).

By Lemma 14 every xβˆˆπ–­2βˆͺ𝖰1 occurs in T, and thus H⁒(x) and I⁒(x) are well defined when x is associated to PxL and PxR, respectively.

Figure 11: Illustration for H⁒(x) and I⁒(x) (aβ‰ b,cβ‰ d).
Lemma 18.

For any xβˆˆπ–­2βˆͺ𝖰1, H⁒(x)βˆˆπ–¬β’(T) if H⁒(x) is defined, and I⁒(x)βˆˆπ–¬β’(T) if I⁒(x) is defined.

Proof.

By Definition 17, H⁒(x),I⁒(x)βˆˆπ–±π—‚π—€π—π—π–¬β’(T). Therefore, it suffices for us to prove H⁒(x),I⁒(x)βˆˆπ–«π–Ύπ–Ώπ—π–¬β’(T). For any xβˆˆπ–­2βˆͺ𝖰1, xβˆˆπ–«π–Ύπ–Ώπ—π–¬β’(T). Since PxG⁒(G∈{L,R}) is a prefix of x, we have PxGβˆˆπ–«π–Ύπ–Ώπ—π–¬β’(T). Hence H⁒(x),I⁒(x)βˆˆπ–«π–Ύπ–Ώπ—π–¬β’(T) holds. β—€

Lemma 19.

For any x,yβˆˆπ–­1βˆͺ𝖰1 with xβ‰ y, let β„’ be a list of H⁒(x), I⁒(x), H⁒(y), I⁒(y) which are defined. Then the elements in β„’ differ from each other.

Proof.

By a symmetrical argument to Lemma 12. β—€

5.2 Upper bound w.r.t. π—‘πŸβˆͺ𝗀

Lemma 20.

βˆ‘xβˆˆπ–­2βˆͺ𝖰𝖽T′⁒(x)≀3⁒𝖾+2.

Proof.

Below, we consider all the four possible cases depending on whether xβˆˆπ–­2 or xβˆˆπ–°1, and whether H⁒(x),I⁒(x)β‰ T.

When π’™βˆˆπ—‘πŸ and 𝑯⁒(𝒙),𝑰⁒(𝒙)≠𝑻.

  • β– 

    First, we consider the case that x is associated with both H⁒(x) and I⁒(x). Since xβˆˆπ–­2, then xβˆ‰π–±π—‚π—€π—π—π–¬β’(T). Therefore, the number of characters that are immediately after x in T is at most one. Moreover, there are at most two distinct characters immediately after the crossing occurrences of x. Hence, there are at most three distinct characters immediately after x in Tβ€², namely we have

    𝖽T′⁒(x)≀3. (1)

    In addition, since H⁒(x),I⁒(x)β‰ T, it holds that 𝖽T⁒(H⁒(x)),𝖽T⁒(I⁒(x))β‰₯1. By Inequality 1, we get 𝖽T′⁒(x)≀3≀𝖽T⁒(H⁒(x))+𝖽T⁒(I⁒(x))+1≀2⁒𝖽T⁒(H⁒(x))+2⁒𝖽T⁒(I⁒(x)).

  • β– 

    Second, we consider the case that x is associated with only one of H⁒(x) or I⁒(x).

    • –

      Assume that we associate x with H⁒(x). Since xβˆˆπ–­2, then xβˆ‰π–±π—‚π—€π—π—π–¬β’(T). Therefore, the number of characters immediately after x in T is at most one. In this case, we do not associate x with I⁒(x), hence, x has only one crossing occurrence or there exists yβˆˆπ–­2βˆͺ𝖰1 such that |y|>|x| and PxR=PyG where G∈{L,R}. When x has only one crossing occurrence, there are at most one character immediately after the crossing occurrence of x. When there exists yβˆˆπ–­2βˆͺ𝖰1 such that |y|>|x| and PxR=PyG where G∈{L,R}, then such y occurs in T due to Lemma 14. Therefore, although there are at most two distinct characters immediately after the crossing occurrences of x, one of them is the character immediately after x in T as shown in Figure 12. Hence, we have

      𝖽T′⁒(x)≀2. (2)

      In addition, since H⁒(x)β‰ T, then 𝖽T⁒(H⁒(x))β‰₯1 holds. By Inequality 2, we get 𝖽T′⁒(x)≀2≀𝖽T⁒(H⁒(x))+1≀2⁒𝖽T⁒(H⁒(x)).

    • –

      Let us assume that we associate x with I⁒(x). In the same way as we associate x with H⁒(x), we get 𝖽T′⁒(x)≀2≀𝖽T⁒(I⁒(x))+1≀2⁒𝖽T⁒(I⁒(x)).

Figure 12: x⁒a occurs in T, where a is the character immediately after the crossing occurrence xR.

When π’™βˆˆπ—‘πŸ and 𝑯⁒(𝒙)=𝑻 or 𝑰⁒(𝒙)=𝑻.

  • β– 

    Let H⁒(x)=T. Now that H⁒(x) is defined, x is associated with H⁒(x).

    • –

      First, we consider the case that we associate x with both H⁒(x) and I⁒(x). In the same way as in Inequality 1, we get 𝖽T′⁒(x)≀3. In addition, since H⁒(x)=T and Lemma 19 holds, I⁒(x)β‰ T and thus 𝖽T⁒(I⁒(x))β‰₯1 holds. Hence, we have 𝖽T′⁒(x)≀3≀𝖽T⁒(I⁒(x))+2≀2⁒𝖽T⁒(H⁒(x))+2⁒𝖽T⁒(I⁒(x))+2.

    • –

      Second, we consider the case that we only associate x with H⁒(x). Since H⁒(x)=T, 𝖽T⁒(H⁒(x))=0 holds. In the same way as in Inequality 2, we get 𝖽T′⁒(x)≀2. Thus, we have 𝖽T′⁒(x)≀2≀2⁒𝖽T⁒(H⁒(x))+2.

  • β– 

    Let I⁒(x)=T. Now that I⁒(x) is defined, x is associated with I⁒(x). In the same way as in the case for H⁒(x)=T, we get 𝖽T′⁒(x)≀3≀𝖽T⁒(H⁒(x))+2≀2⁒𝖽T⁒(H⁒(x))+2⁒𝖽T⁒(I⁒(x))+2 in the case that we associate x with both H⁒(x) and I⁒(x), and we get 𝖽T′⁒(x)≀2≀2⁒𝖽T⁒(I⁒(x))+2 in the case that we only associate x with I⁒(x).

When π’™βˆˆπ—€πŸ and 𝑯⁒(𝒙),𝑰⁒(𝒙)≠𝑻.

Here, we analyze 𝖽T′⁒(x)βˆ’π–½T⁒(x) since xβˆˆπ–°1.

  • β– 

    First, we consider the case that we associate x with both H⁒(x) and I⁒(x). There are at most two distinct characters immediately after the crossing occurrences of x. Hence,

    𝖽T′⁒(x)βˆ’π–½T⁒(x)≀2. (3)

    In addition, since H⁒(x),I⁒(x)β‰ T, then 𝖽T⁒(H⁒(x)),𝖽T⁒(I⁒(x))β‰₯1 holds. By Inequality 3, we get 𝖽T′⁒(x)βˆ’π–½T⁒(x)≀2≀𝖽T⁒(H⁒(x))+𝖽T⁒(I⁒(x))≀𝖽T⁒(H⁒(x))+𝖽T⁒(I⁒(x)).

  • β– 

    Second, we consider the case that we associate x with only one of H⁒(x) or I⁒(x). Here, let us assume that we associate x with H⁒(x). In this case, we do not associate x with I⁒(x), hence, x has only one crossing occurrence or there exists yβˆˆπ–­2βˆͺ𝖰1 such that |y|>|x| and PxR=PyG where G∈{L,R}. When x has only one crossing occurrence, there are at most one character immediately after the crossing occurrence of x. When there exists yβˆˆπ–­2βˆͺ𝖰1 such that |y|>|x| and PxR=PyG where G∈{L,R}, then such y occurs in T due to Lemma 14. Therefore, although there are at most two distinct characters immediately after the crossing occurrences of x, one of them is the character immediately after x in T as shown in Figure 12. Hence, we have

    𝖽T′⁒(x)βˆ’π–½T⁒(x)≀1. (4)

    In addition, since H⁒(x)β‰ T, then 𝖽T⁒(H⁒(x))β‰₯1 holds. By Inequality 4, we get 𝖽T′⁒(x)βˆ’π–½T⁒(x)≀1≀𝖽T⁒(H⁒(x)). In the case that we associate x with I⁒(x), in the same way as we associate x with H⁒(x), we get 𝖽T′⁒(x)βˆ’π–½T⁒(x)≀1≀𝖽T⁒(I⁒(x)).

When π’™βˆˆπ—€πŸ and 𝑯⁒(𝒙)=𝑻 or 𝑰⁒(𝒙)=𝑻.

Here, we analyze 𝖽T′⁒(x)βˆ’π–½T⁒(x) since xβˆˆπ–°1.

  • β– 

    Let H⁒(x)=T. Since H⁒(x) is defined, x is associated with H⁒(x).

    • –

      First, let us consider the case that we associate x with both H⁒(x) and I⁒(x). In the same way as in Inequality 3, we get 𝖽T′⁒(x)βˆ’π–½T⁒(x)≀2. In addition, since H⁒(x)=T and Lemma 19 holds, I⁒(x)β‰ T and thus 𝖽T⁒(I⁒(x))β‰₯1 holds. Hence 𝖽T′⁒(x)βˆ’π–½T⁒(x)≀2≀𝖽T⁒(I⁒(x))+1≀𝖽T⁒(H⁒(x))+𝖽T⁒(I⁒(x))+1.

    • –

      Second, let us consider the case that we only associate x with H⁒(x). Since H⁒(x)=T, 𝖽T⁒(H⁒(x))=0 holds. In the same way as in Inequality 4, we get 𝖽T′⁒(x)βˆ’π–½T⁒(x)≀1. Thus, we have 𝖽T′⁒(x)βˆ’π–½T⁒(x)≀1≀𝖽T⁒(H⁒(x))+1.

  • β– 

    Let I⁒(x)=T. Since I⁒(x) is defined, x is associated with I⁒(x). In the same way as in the case for H⁒(x)=T, we get 𝖽T′⁒(x)βˆ’π–½T⁒(x)≀2≀𝖽T⁒(H⁒(x))+1≀𝖽T⁒(H⁒(x))+𝖽T⁒(I⁒(x))+1 in the case that we associate x with both H⁒(x) and I⁒(x), and we get 𝖽T′⁒(x)βˆ’π–½T⁒(x)≀1≀𝖽T⁒(I⁒(x))+1 in the case that we only associate x with I⁒(x).

Table 1: Upper bounds for each case of Lemma 20.
When H⁒(x)β‰ T∧I⁒(x)β‰ T When H⁒(x)=T∨I⁒(x)=T
𝖽T′⁒(x)βˆ’π–½T⁒(x)⁒(xβˆˆπ–°1) ≀𝖽T⁒(H⁒(x))+𝖽T⁒(I⁒(x)) ≀𝖽T⁒(H⁒(x))+𝖽T⁒(I⁒(x))+1
𝖽T′⁒(x)⁒(xβˆˆπ–­2) ≀2⁒(𝖽T⁒(H⁒(x))+𝖽T⁒(I⁒(x))) ≀2⁒(𝖽T⁒(H⁒(x))+𝖽T⁒(I⁒(x)))+2

Wrapping up.

Table 1 summarizes the bounds obtained above. For simplicity, let 𝖽T⁒(I⁒(x))=0 when I⁒(x) is undefined, and let 𝖽T⁒(H⁒(x))=0 when H⁒(x) is undefined. Note that this does not affect our upper bound analysis, since no maximal repeats in Tβ€² are associated to the undefined H⁒(x)’s and I⁒(x)’s. By Lemma 19, there is at most one string x such that H⁒(x)=T or I⁒(x)=T. Thus, by using Lemma 19 and summing up the values in Table 1, we obtain βˆ‘xβˆˆπ–­2𝖽T′⁒(x)+βˆ‘xβˆˆπ–°1(𝖽T′⁒(x)βˆ’π–½T⁒(x))≀2⁒𝖾+2. Also, since the number of out-edges of xβˆˆπ–°2 does not increase, we get βˆ‘xβˆˆπ–°2𝖽T′⁒(x)+βˆ‘xβˆˆπ–°1𝖽T⁒(x)β‰€βˆ‘xβˆˆπ–°2𝖽T⁒(x)+βˆ‘xβˆˆπ–°1𝖽T⁒(x)β‰€βˆ‘xβˆˆπ–°π–½T⁒(x)β‰€βˆ‘xβˆˆπ–¬β’(T)𝖽T⁒(x)=𝖾. By adding βˆ‘xβˆˆπ–­2𝖽T′⁒(x)+βˆ‘xβˆˆπ–°1(𝖽T′⁒(x)βˆ’π–½T⁒(x))≀2⁒𝖾+2, we get βˆ‘xβˆˆπ–­2βˆͺ𝖰𝖽T′⁒(x)≀3⁒𝖾+2. β—€

6 Upper bound for total out-degrees of nodes w.r.t. π—‘πŸ‘β’π

In this section, we show an upper bound for the total out-degrees of nodes corresponding to strings that are elements of 𝖭3⁒BβŠ†π–¬β’(Tβ€²). We first describe useful properties of strings xβˆˆπ–­3⁒B.

Definition 21.

For any xβˆˆπ–­3⁒B, let Jx be the string that is obtained by removing PxR and SxL from x, namely x=PxR⁒Jx⁒SxL.

Note that, by the definition of Type (v), each xβˆˆπ–­3⁒B has two or more crossing occurrences in Tβ€². Hence Jx always exists (possibly the empty string). See Figures 13 and 14.

Figure 13: Illustration for Jx in case of insertions and substitutions.
Figure 14: Illustration for Jx in case of deletions.
Lemma 22.

For any x,yβˆˆπ–­3⁒B with xβ‰ y, Jxβ‰ Jy.

Proof.

For a contrary, suppose that there exist x,yβˆˆπ–­3⁒B such that xβ‰ y and Jx=Jy. Since x is of Type (v), the characters immediately after xL and xR are different and let a,b (aβ‰ b) be these characters, respectively. If |SxL|<|SyL|, then both SxL⁒a and SxL⁒b must be prefixes of SyL (see Figures 15 and 16), which contradicts that aβ‰ b. The other case where |SxL|>|SyL| also leads to a contradiction. Hence |SxL|=|SyL|, which implies SxL=SyL. Also, PxR=PyR follows in a symmetric manner. These imply x=y, which is a contradiction. β—€

Figure 15: Illustration for Lemma 22 in case of insertions and substitutions, where Jx=Jy.
Figure 16: Illustration for Lemma 22 in case of deletions, where Jx=Jy.

6.1 Correspondence between π—‘πŸ‘β’π and 𝗠⁒(𝑻)

For any xβˆˆπ–­3⁒B, we associate x with Jx. For any xβˆˆπ–­3⁒B we define K⁒(x) to which x corresponds, by using Jx, as follows:

Definition 23.

For any xβˆˆπ–­3⁒B, let K⁒(x)=𝗅𝖾𝗑𝗉T⁒(𝗋𝖾𝗑𝗉T⁒(Jx))=𝗋𝖾𝗑𝗉T⁒(𝗅𝖾𝗑𝗉T⁒(Jx)) (see also Figure 17).

We note that K⁒(x) is well defined since Jx is a substring of T.

Figure 17: Illustration for Definition 23, where a≠b and c≠d.
Lemma 24.

For any x,yβˆˆπ–­3⁒B with xβ‰ y, K⁒(x)β‰ K⁒(y).

Proof.

Suppose that there exist x,yβˆˆπ–­3⁒B such that xβ‰ y and K⁒(x)=K⁒(y), and without loss of generality that |Jx|≀|Jy|. Then, Jx occurs at least twice in Jy. Therefore, K⁒(x)β‰ K⁒(y), however, this is a contradiction. β—€

6.2 Upper bound w.r.t. π—‘πŸ‘β’π

Lemma 25.

βˆ‘xβˆˆπ–­3⁒B𝖽T′⁒(x)≀2⁒𝖾.

Proof.

By the definition of 𝖭3⁒B, there is no other right-extension of x in Tβ€² than the right-extension(s) of the crossing occurrence(s) of x. Thus there are at most two distinct characters immediately after x in Tβ€². Since K⁒(x) occurs at least twice in T, 𝖽T⁒(K⁒(x))β‰₯1. Hence, we get 𝖽T′⁒(x)≀2≀2⁒𝖽T⁒(K⁒(x)). Therefore, we have βˆ‘xβˆˆπ–­3⁒B𝖽T′⁒(x)≀2⁒𝖾 by Lemma 24. β—€

7 Tighter upper bound for strings ending with $

In this section, we consider any string ending with a unique end-marker $, and present a tighter upper bound for the worst-case multiplicative sensitivity of 𝖾:

Lemma 26.

For any string T of length n ending with a unique character $, 𝖬𝖲⁒(𝖾,n)≀(5⁒𝖾+4)/𝖾 holds.

Proof.

We first examine the upper bound in Lemma 13. When T ends with a unique character $, the argument of Lemma 13 can be adapted as follows. Let xβˆˆπ–­1βˆͺ𝖭3⁒A, and let U⁒(x) be defined in the same way as in Lemma 13. Since every maximal repeat in the CDAWG of any string ending with $ has at least two outgoing edges, we have 𝖽T⁒(U⁒(x))β‰₯2. From the same reasoning as in Lemma 13, it follows that 𝖽T′⁒(x)≀𝖽T⁒(U⁒(x))+2, which can be tightened to 𝖽T′⁒(x)≀2⁒𝖽T⁒(U⁒(x)) when 𝖽T⁒(U⁒(x))β‰₯2.

By Lemma 12, the mapping x↦U⁒(x) is injective. Therefore,

βˆ‘xβˆˆπ–­1βˆͺ𝖭3⁒A𝖽T′⁒(x)≀2β’βˆ‘xβˆˆπ–­1βˆͺ𝖭3⁒A𝖽T⁒(U⁒(x))+2≀2⁒𝖾+2.

By applying similar arguments to the nodes considered in Lemma 20 and Lemma 25, we obtain upper bounds of 2⁒𝖾+2 and 𝖾, respectively.

Summing up these three bounds gives us

(2⁒𝖾+2)+(2⁒𝖾+2)+𝖾=5⁒𝖾+4.

Hence, the total upper bound is 5⁒𝖾+4, as claimed. β—€

8 Conclusions

This paper proved that the worst-case multiplicative sensitivity of CDAWGs is asymptotically at most 8. Our analysis is built on new combinatorial properties of maximal repeats and their right-extensions, that are incidental to an edit operation on the strings. The only known lower bound for the multiplicative sensitivity of CDAWGs is asymptotically 2 [9]. It is intriguing future work to close the gap between these upper bound and lower bound.

References

  • [1] Tooru Akagi, Mitsuru Funakoshi, and Shunsuke Inenaga. Sensitivity of string compressors and repetitiveness measures. Information and Computation, 291:104999, 2023. doi:10.1016/J.IC.2022.104999.
  • [2] Pawel Baturo, Marcin Piatkowski, and Wojciech Rytter. Usefulness of directed acyclic subword graphs in problems related to Standard Sturmian Words. Int. J. Found. Comput. Sci., 20(6):1005–1023, 2009. doi:10.1142/S0129054109007017.
  • [3] Djamal Belazzougui and Fabio Cunial. Fast label extraction in the CDAWG. In SPIRE 2017, pages 161–175, 2017. doi:10.1007/978-3-319-67428-5_14.
  • [4] Anselm Blumer, J. Blumer, David Haussler, Ross McConnell, and Andrzej Ehrenfeucht. Complete inverted files for efficient text retrieval and analysis. J. ACM, 34(3):578–595, 1987. doi:10.1145/28869.28873.
  • [5] Dany Breslauer and Zvi Galil. An optimal o⁒(log⁑log⁑n) time parallel string matching algorithm. SIAM J. Comput., 19(6):1051–1058, 1990. doi:10.1137/0219072.
  • [6] Moses Charikar, Eric Lehman, Ding Liu, Rina Panigrahy, Manoj Prabhakaran, Amit Sahai, and Abhi Shelat. The smallest grammar problem. IEEE Trans. Inf. Theory, 51(7):2554–2576, 2005. doi:10.1109/TIT.2005.850116.
  • [7] Alan M. Cleary and Jordan Dood. Constructing the CDAWG CFG using lcp-intervals. In DCC 2023, pages 178–187, 2023. doi:10.1109/DCC55655.2023.00026.
  • [8] Maxime Crochemore, F. Mignosi, and A. Restivo. Automata and forbidden words. Information Processing Letters, 67(3):111–117, 1998. doi:10.1016/S0020-0190(98)00104-5.
  • [9] Hiroto Fujimaru, Yuto Nakashima, and Shunsuke Inenaga. Tight bounds for the sensitivity of CDAWGs with left-end edits. Acta Informatica, 62(12), 2025. doi:10.1007/S00236-025-00478-Y.
  • [10] Sara Giuliani, Shunsuke Inenaga, Zsuzsanna LiptΓ‘k, Nicola Prezza, Marinella Sciortino, and Anna Toffanello. Novel results on the number of runs of the Burrows-Wheeler-transform. In SOFSEM, pages 249–262, 2021. doi:10.1007/978-3-030-67731-2_18.
  • [11] Sara Giuliani, Shunsuke Inenaga, Zsuzsanna LiptΓ‘k, Giuseppe Romana, Marinella Sciortino, and Cristian Urbina. Bit catastrophes for the Burrows-Wheeler transform. Theory of Computing Systems, 69(19), 2025. doi:10.1007/S00224-024-10212-9.
  • [12] Peaker Guo, Patrick Eades, Anthony Wirth, and Justin Zobel. Exploiting new properties of string net frequency for efficient computation. In CPM 2024, volume 296 of LIPIcs, pages 16:1–16:16, 2024. doi:10.4230/LIPIcs.CPM.2024.16.
  • [13] Lucian Ilie and William F Smyth. Minimum unique substrings and maximum repeats. Fundamenta Informaticae, 110(1-4):183–195, 2011. doi:10.3233/FI-2011-536.
  • [14] Shunsuke Inenaga. Linear-size suffix tries and linear-size CDAWGs simplified and improved. Acta Informatica, 61(4):445–468, 2024. doi:10.1007/S00236-024-00465-9.
  • [15] Shunsuke Inenaga, Hiromasa Hoshino, Ayumi Shinohara, Masayuki Takeda, Setsuo Arikawa, Giancarlo Mauri, and Giulio Pavesi. On-line construction of compact directed acyclic word graphs. Discrete Applied Mathematics, 146(2):156–179, 2005. doi:10.1016/J.DAM.2004.04.012.
  • [16] Shunsuke Inenaga, Takuya Mieno, Hiroki Arimura, Mitsuru Funakoshi, and Yuta Fujishige. Computing minimal absent words and extended bispecial factors with CDAWG space. In IWOCA 2024, volume 14764 of Lecture Notes in Computer Science, pages 327–340, 2024. doi:10.1007/978-3-031-63021-7_25.
  • [17] Tomasz Kociumaka, Gonzalo Navarro, and Nicola Prezza. Toward a definitive compressibility measure for repetitive sequences. IEEE Trans. Inf. Theory, 69(4):2074–2092, 2023. doi:10.1109/TIT.2022.3224382.
  • [18] Guillaume Lagarde and Sylvain Perifel. Lempel-Ziv: a β€œone-bit catastrophe” but not a tragedy. In SODA, pages 1478–1495, 2018. doi:10.1137/1.9781611975031.97.
  • [19] William Merrill, Noah A. Smith, and Yanai Elazar. Evaluating n-gram novelty of language models using Rusty-DAWG. In EMNLP 2024, pages 14459–14473, 2024. doi:10.18653/V1/2024.EMNLP-MAIN.800.
  • [20] Takuya Mieno and Shunsuke Inenaga. Space-efficient online computation of string net occurrences. In CPM 2025, LIPIcs, pages 23:1–23:13, 2025. doi:10.4230/LIPIcs.CPM.2025.23.
  • [21] Masamichi Miyazaki, Ayumi Shinohara, and Masayuki Takeda. An improved pattern matching algorithm for strings in terms of straight line programs. Journal of Discrete Algorithms, 1(1):187–204, 2000.
  • [22] Yuto Nakashima, Dominik KΓΆppl, Mitsuru Funakoshi, Shunsuke Inenaga, and Hideo Bannai. Edit and alphabet-ordering sensitivity of lex-parse. In MFCS 2024, volume 306 of LIPIcs, pages 75:1–75:15, 2024. doi:10.4230/LIPIcs.MFCS.2024.75.
  • [23] Gonzalo Navarro. Computing mems and relatives on repetitive text collections. ACM Trans. Algorithms, 21(1):12:1–12:33, 2025. doi:10.1145/3701561.
  • [24] Gonzalo Navarro, Carlos Ochoa, and Nicola Prezza. On the approximation ratio of ordered parsings. IEEE Trans. Inf. Theory, 67(2):1008–1026, 2021. doi:10.1109/TIT.2020.3042746.
  • [25] Jakub Radoszewski and Wojciech Rytter. On the structure of compacted subword graphs of Thue-Morse words and their applications. J. Discrete Algorithms, 11:15–24, 2012. doi:10.1016/J.JDA.2011.01.001.
  • [26] Wojciech Rytter. Application of Lempel-Ziv factorization to the approximation of grammar-based compression. Theor. Comput. Sci., 302(1-3):211–222, 2003. doi:10.1016/S0304-3975(02)00777-6.
  • [27] Wojciech Rytter. The structure of subword graphs and suffix trees of Fibonacci words. Theor. Comput. Sci., 363(2):211–223, 2006. doi:10.1016/J.TCS.2006.07.025.
  • [28] James A. Storer and Thomas G. Szymanski. Data compression via textual substitution. J. ACM, 29(4):928–951, 1982. doi:10.1145/322344.322346.
  • [29] Masayuki Takeda, Tetsuya Matsumoto, Tomoko Fukuda, and Ichiro Nanri. Discovering characteristic expressions from literary works: a new text analysis method beyond n-gram statistics and KWIC. In Discovery Science 2000, pages 112–126, 2000. doi:10.1007/3-540-44418-1_10.
  • [30] Peter Weiner. Linear pattern matching algorithms. In Proceedings of the 14th Annual Symposium on Switching and Automata Theory, pages 1–11, 1973. doi:10.1109/SWAT.1973.13.
  • [31] J. Ziv and A. Lempel. A universal algorithm for sequential data compression. IEEE Transactions on Information Theory, 23(3):337–343, 1977. doi:10.1109/TIT.1977.1055714.
  • [32] Jacob Ziv and Abraham Lempel. Compression of individual sequences via variable-rate coding. IEEE Trans. Inf. Theory, 24(5):530–536, 1978. doi:10.1109/TIT.1978.1055934.