In computer science, a suffix automaton is an efficient data structure for representing the substring index of a given string which allows the storage, processing, and retrieval of compressed information about all its substrings. The suffix automaton of a string S is the smallest directed acyclic graph with a dedicated initial vertex and a set of "final" vertices, such that paths from the initial vertex to final vertices represent the suffixes of the string. In terms of automata theory, a suffix automaton is the minimal partial deterministic finite automaton that recognizes the set of suffixes of a given string S=s1s2…sn. The state graph of a suffix automaton is called a directed acyclic word graph (DAWG), a term that is also sometimes used for any deterministic acyclic finite state automaton. Suffix automata were introduced in 1983 by a group of scientists from the University of Denver and the University of Colorado Boulder. They suggested a linear time online algorithm for its construction and showed that the suffix automaton of a string S having length at least two characters has at most 2|S|−1 states and at most 3|S|−4 transitions. Further works have shown a close connection between suffix automata and suffix trees, and have outlined several generalizations of suffix automata, such as compacted suffix automaton obtained by compression of nodes with a single outgoing arc. Suffix automata provide efficient solutions to problems such as substring search and computation of the largest common substring of two and more strings.
History
The concept of suffix automaton was introduced in 1983 by a group of scientists from University of Denver and University of Colorado Boulder consisting of Anselm Blumer, Janet Blumer, Andrzej Ehrenfeucht, David Haussler and Ross McConnell, although similar concepts had earlier been studied alongside suffix trees in the works of Peter Weiner, Vaughan Pratt and Anatol Slissenko. In their initial work, Blumer et al. showed a suffix automaton built for the string S of length greater than 1 has at most 2|S|−1 states and at most 3|S|−4 transitions, and suggested a linear algorithm for automaton construction. In 1983, Mu-Tian Chen and Joel Seiferas independently showed that Weiner's 1973 suffix-tree construction algorithm while building a suffix tree of the string S constructs a suffix automaton of the reversed string SR as an auxiliary structure. In 1987, Blumer et al. applied the compressing technique used in suffix trees to a suffix automaton and invented the compacted suffix automaton, which is also called the compacted directed acyclic word graph (CDAWG). In 1997, Maxime Crochemore and Renaud Vérin developed a linear algorithm for direct CDAWG construction. In 2001, Shunsuke Inenaga et al. developed an algorithm for construction of CDAWG for a set of words given by a trie.
Definitions Usually when speaking about suffix automata and related concepts, some notions from formal language theory and automata theory are used, in particular:
"Alphabet" is a finite set Σ that is used to construct words. Its elements are called "characters"; "Word" is a finite sequence of characters ω=ω1ω2…ωn. "Length" of the word ω is denoted as |ω|=n; "Formal language" is a set of words over given alphabet; "Language of all words" is denoted as Σ∗(where the "*" character stands for Kleene star), "empty word" (the word of zero length) is denoted by the character ε; "Concatenation of words" α=α1α2…αn and β=β1β2…βm is denoted as α⋅β or αβ and corresponds to the word obtained by writing β to the right of α, that is, αβ=α1α2…αnβ1β2…βm; "Concatenation of languages" A and B is denoted as A⋅B or AB and corresponds to the set of pairwise concatenations AB={αβ:α∈A,β∈B}; If the word ω∈Σ∗ may be represented as ω=αγβ, where α,β,γ∈Σ∗, then words α, β and γ are called "prefix", "suffix" and "subword" (substring) of the word ω correspondingly; If T=T1…Tn and TlTl+1…Tr=S (with 1≤l≤r≤n) then S is said to "occur" in T as a subword. Here l and r are called left and right positions of occurrence of S in T correspondingly.
Automaton structure Formally, deterministic finite automaton is determined by 5-tuple 𝒜=(Σ,Q,q0,F,δ), where:
Σ is an "alphabet" that is used to construct words, Q is a set of automaton "states", q0∈Q is an "initial" state of automaton, F⊂Q is a set of "final" states of automaton, δ:Q×Σ↦Q is a partial "transition" function of automaton, such that δ(q,σ) for q∈Q and σ∈Σ is either undefined or defines a transition from q over character σ. Most commonly, deterministic finite automaton is represented as a directed graph ("diagram") such that:
Set of graph vertices corresponds to the state of states Q, Graph has a specific marked vertex corresponding to initial state q0, Graph has several marked vertices corresponding to the set of final states F, Set of graph arcs corresponds to the set of transitions δ, Specifically, every transition δ(q1,σ)=q2 is represented by an arc from q1 to q2 marked with the character σ. This transition also may be denoted as q1σ⟶q2. In terms of its diagram, the automaton recognizes the word ω=ω1ω2…ωm only if there is a path from the initial vertex q0 to some final vertex q∈F such that concatenation of characters on this path forms ω. The set of words recognized by an automaton forms a language that is set to be recognized by the automaton. In these terms, the language recognized by a suffix automaton of S is the language of its (possibly empty) suffixes.
Automaton states
"Right context" of the word ω with respect to language L is a set [ω]R={α:ωα∈L} that is a set of words α such that their concatenation with ω forms a word from L. Right contexts induce a natural equivalence relation [α]R=[β]R on the set of all words. If language L is recognized by some deterministic finite automaton, there exists unique up to isomorphism automaton that recognizes the same language and has the minimum possible number of states. Such an automaton is called a minimal automaton for the given language L. Myhill–Nerode theorem allows it to define it explicitly in terms of right contexts:
… excerpt ends here. Continue reading the full article.





