Reachability on Suffix Tree Graphs Yasuto Higa Hideo
Reachability on Suffix Tree Graphs Yasuto Higa, Hideo Bannai, Shunsuke Inenaga, and Masayuki Takeda Department of Informatics, Kyushu University
Suffix Tree (P. Weiner : 1973) 1. A suffix trie is a kind of index structure. 2. The suffix trie of text T is a trie representing the set of suffixes of T. 3. A suffix tree is a compacted suffix trie where the nodes of out degree 1 are removed. Space ( n : length of T ) Suffix trie : O(n 2) Suffix tree : O(n)
Suffix Tree T=ababbabbba$ a ab b $ b v a b b a a b b b a a $ $ b a $ a b b a $ u abbba$ a b b b a $ $ $ a b $ b b b a $ Important property Reachable Prefix on suffix tree
Suffix Links T=ababbabbba$ a b $ b b a $ b a b v b a a b $ b b b a a $ $ a abb b b u a b b b a $ $ babb $ a b $ b b b a $
Suffix Links. Tree T=ababbabbba$ a b $ b b a $ a b b a a b b b a a $ $ a b b a $ a b b b a $ $ $ a b $ b b b a $
Suffix Link Tree T=ababbabbba$ v u Important property Reachable on suffix link tree Suffix
Suffix Tree Graph = Suffix Tree + Suffix Link Tree a b $ b b a $ a b b a a b b b a a $ $ a b b a $ a b b b a $ $ $ a b $ b b b a $
Substring inclusion problem a ab b $ b T=ababbabbba$ a b $ Substring inclusion problem u b b of b a Input : Two nodes u, v $ a suffix tree. a b babb $ b a b Output : whether or notv the string of u a a $ b abb substring of that ofa v. ba b b $ b b b a a $ $ is bba v b b b a $
Reachability on Suffix Tree Graph a ab b $ b u T=ababbabbba$ b a $ b Substring inclusion problem a b b a a b Reachability $ b b b a a $ $ b b $ babb $ a b $ v problem a on b Suffix Tree Graph b b b a $ bba a v b b b a $
Naïve solutions to substring inclusion problem String Graph reachability matching query preprocessing no preprocessing - O(n) precomputing all possible queries O(n 3) O(1) no preprocessing - O(n) precomputing transitivity closure O(n 2) O(1) Efficient algorithm for the case where • text T is fixed and • a lot of substring inclusion queries are performed.
Interval labeling • R. Agrawal, et al. (1989) • An algorithm for reachability on DAGs. ? (1, 5) (1, 6) u (15, 16) v (15, 15) (18, 18) • Query processing time is proportional to the number of interval labels of the node u. • The total number of interval labels is O(n 2) in the worst case for general DAGs.
Agrawal labeling algorithm on Suffix Tree Graph Input : Suffix Tree Graph Output : labeled Suffix Tree Graph 1 2 3 4 5 6 foreach node v in post order on suffix link tree do v. special: =[minimum post order number of subtree of v, post order number of v]; v. labels: ={ v. special }; endfch foreach node v in post order on suffix tree do v. labels: =merge v. labels and { labels of children of v}; Remove 8 endfch 7 if s. t. ;
Answering reachability query by interval labels (1, 20) (1, 10) (12, 14) (15, 16) (1, 6) (18, 18) 14 (15, 16) b (18, 18) 18 (1, 6) (15, 16) a b 16 b a a b $ (1, 6) b b b 6 b b a a $ (1, 3) $ 3 1 a $ (1, 11) 11 (1, 9) (12, 13) (15, 19) b 19 b a $ b (1, 1) 20 10 (1, 10) 13 b b (1, 5) 15 (15, 15) a b $ b 5 b a $ 2 (1, 2) (1, 9) (12, 13) (15, 15) $ $ 9 (1, 9) 17 a a b 12 (1, 8) (1, 7) (1, 8) (12, 12) $ 8 7 (1, 5) (1, 8) (12, 12) (15, 17) b b b a $ 4 (1, 4)
Time complexity Query time • Each node has at most n labels, because the number of suffix link tree leaves is at most n. • The labels of each node can be sorted during preprocessing without increasing time complexity. • Therefore, query time is O(log n). (binary search)
Time complexity Preprocessing time • Preprocessing time is proportional to the total number of interval labels. (Lemma) • Therefore, we have only to count the total number of interval labels.
The expected total number of interval labels Theorem The expected total number of interval labels is O(n log n) for random strings. • The total number of interval labels is at most O(n・(height of the tree)). (Lemma) • The expected height of the suffix tree of a random string is O(log n). A. Apostolico et al. (1992)
Worst case Lower bound: The following sequence of strings Xi gives a (the? ) lower bound on the total number of labels. X 1 = ab 1 ab 2 ab 1 a$ (length 11) X 2 = ab 2 ab 3 ab 2 ab 1 ab 2 a$ (length 20) X 3 = ab 3 ab 4 ab 3 ab 1 ab 3 ab 2 ab 3 a$ (length 32) … (length )
Structure of Xi = abia 1 X 1 = ab 1 ab 2 ab 1 a$ 2 i-1 … k i-2 … X 2 = ab 2 ab 3 ab 2 ab 1 ab 2 a$ i-k … + X 3 = ab 3 ab 4 ab 3 ab 1 ab 3 ab 2 ab 3 a$ X 4 = ab 4 ab 5 ab 4 ab 1 ab 4 ab 3 ab 4 ab 2 ab 4 a$ X 5 = ab 5 ab 6 ab 5 ab 1 ab 5 ab 4 ab 5 ab 2 ab 5 ab 3 ab 5 a$ … X 6 = ab 6 ab 7 ab 6 ab 1 ab 6 ab 5 ab 6 ab 2 ab 6 ab 4 ab 6 ab 3 ab 6 a$ i/2 … i/2 =i
The number of interval labels of each node on the suffix tree of bi bk a b b …b b b b… b b a b b …b b b b… b b a b b …b $ b b … … bk b a b b …b b b b… b b a b … … b bi bi bk b : leaf node : internal node
The number of interval labels of each node on the suffix tree of bi bk a b b …b b b b… b b a b b …b b b b… b b a b b …b $ b b … … bk b a b b …b b b b… b b a b … … b bi bi bk b : leaf node : internal node
The number of interval labels of each node on the suffix tree of bi bk a b b …b b b b… b b a b b …b b b b… b b a b b …b $ b b … … bk b a b b …b b b b… b b a b … … b bi bi bk b : leaf node : internal node
The number of interval labels of each node on the suffix tree of … … … … … …
The number of interval labels of each node on the suffix tree of decreasing zone constant zone 1 … 3 … … … k+1 … … i+1 … 4 3 4 3 … 2 2 … … … 2 2 2 … … … 4 3 … … i+1 … 4 3 … i+1 2 … … i+1 … 4 3 … … k … i+1 2 … … i+2 … i+1 i+1 k-1 increasing zone … 4 3 Root and each leaf has one interval label.
# Xi : the total number of labels for Xi increasing zone decreasing zone Where therefore constant zone root & leaves
Theorem 2 the total number of interval labels is in the worst case.
Upper bound A trivial upper bound is O(n 2). …but is this bound tight?
Computational Experiments n : the length of strings Un : the maximum total number of labels for n 2 n 3 4 5 6 7 8 9 10 11 12 13 14 U exhaustively 3 6 9 enumerated 12 15 18 22 26 30 of 34 length 39 44 n 49 We all strings consisting of a and b, and ending with $. For each n, 17 19 20 22 23 24 25 26 27 28 29 30 31 the 18 number of 21 labels in the worst case was recorded. n 64 69 74 79 85 F(n) = Un 91 97 103 109 115 121 127 133 139 145 15 16 54 59 32 33 151 158 F(n) = #Xi (for all i)
Summary of worst case bounds For all Un = F(n) = #Xi The exact upper bound on the total number of interval labels for The inductively determined function for Un. A lower bound on the total number of interval labels Conjecture : The upper bound is The complexity of the algorithm is
Conclusion • We considered the Substring inclusion problem and showed that it can be reduced to the Reachability problem on Suffix Tree Graphs. • We showed bounds for Agrawal’s interval labeling algorithm when applied to Suffix Tree Graphs. no preprocessing query processing - O(n) expected O(log n) our results for Xi precomputing transitivity closure O(n 2) O(1)
Future work The upper bound is
optimal pattern form a pattern set • If pattern A is a substring of pattern B, the set B is the substring of the set A. – “set A” is the set of strings that include pattern A – “set B” is the set of strings that include pattern B. Set A Pattern B text Pattern A Set B
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 a b $ b b a $ a b b a a b b b a a $ $ a b b a $ a b b b a $ $ $ a b $ b b b a $
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 20 a b 18 14 11 19 b a 17 $ b a b 16 b a a b $ b b b 6 b b a a $ $ 3 13 a 1. Assign a numberbto each nodes b 12 $ anumbering in post order b $ $ 10 9 15 a b b b a $ 2 1 b $ b a $ 5 8 7 b b b a $ 4
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 20 14 11 19 18 17 13 1. Assign a number to each nodes 12 in post order numbering 10 16 9 15 8 7 6 5 4 3 2 1
Suffix Tree with Graph Suffix Links a a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 b $ b b a $ a b b a a b b b a a $ $ a b b a $ a b b b a $ $ $ a b $ b b b a $
Suffix Tree Graph a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 20 a b 18 14 11 19 b a 17 $ b a b 16 b a a b $ b b b 6 b b a a $ $ 3 13 a 1. assign a numberb to each nodes b 12 $ a in post b $ order $ 10 9 15 a b b b a $ 2 1 b $ b a $ 5 8 7 b b b a $ 4
Suffix Tree Graph a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 20 a b 18 14 11 19 b a 17 $ b a b 16 b a a b $ b b b 6 b b a a $ $ 3 13 a 1. Assign a numberbto each nodes b 12 $ aorder in post b $ $ 10 9 15 a b b b a $ 2 1 b $ b a $ 5 8 7 b b b a $ 4
Suffix Tree Graph a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 a b $ b b a $ a b b a a b b b a a $ $ a b b a $ a b b b a $ $ $ a b $ b b b a $
Suffix Tree Graph a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 20 a b 18 14 11 19 b a 17 $ b a b 16 b a a b $ b b b 6 b b a a $ $ 3 13 b b 10 $ $ 9 15 a b b b a $ 2 1 b $ b a $ 5 a b $ 8 7 a 12 b b b a $ 4
Suffix Tree Graph a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 20 a b 18 14 11 19 b a 17 $ b a b 16 b a a b $ b b b 6 b b a a $ $ 3 13 b b 10 $ $ 9 15 a b b b a $ 2 1 b $ b a $ 5 a b $ 8 7 a 12 b b b a $ 4
Suffix Tree with Suffix Links 20 a b 15 11 16 b a 14 $ b a b 13 b a a b $ b b b 6 b b a a $ $ 3 18 b b 10 $ $ 9 12 a b b b a $ 2 1 b $ 19 a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 b a $ 5 a b $ 8 7 a 17 b b b a $ 4
Suffix Tree with Suffix Links 20 a b 15 11 16 b a 14 $ b a b 13 b a a b $ b b b 6 b b a a $ $ 3 18 b b 10 $ $ 9 12 a b b b a $ 2 1 b $ 19 a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 b a $ 5 a b $ 8 7 a 17 b b b a $ 4
$ 9 (1, 3) 3 2 $ 8 (1, 7) $ 5 (1, 8) 7 b 12 (1, 2) 17 a 6 (1, 6) $ a b b b a (1, 9) b (10, 11) b b 18 13 b a b b b 10 11 a $ a (1, 10) b a $ $ (1, 11) b a $ 1 20 (10, 11) a $ (1, 1) $ (10, 11) 16 b (10, 11) 14 (10, 11) a b b a 15 (10, 11) b a b b b a $ 1 2 3 4 5 6 7 8 9 1011 (10, 11) (10, 11) 19 (10, 11) b Agrawal (1, 5) 4 (1, 4)
Motivation
FAQ • What is the Suffix Tree Graph? I’m going to answer these questions.
Outline 1. 2. 3. 4. 5. 6. 7. distinguish the sets of strings Main More skillful pattern discussion Substring and Suffix Tree Problem establishment Suffix Tree Graph (ST-Graph) How to use ST-Graph Background The complexity of the algorithm
Outline 1. 2. 3. 4. 5. 6. 7. 8. Technical term Pattern discovery problem (background) Motivation Problem establishment Suffix Tree Graph Labeling algorithm Complexity of the algorithm Future works
Technical term (1/2) • Substring * For any string s ∈ ∑ • Suffix Tree s = uvw u ; prefix substring v ; substring w ; suffix prefix suffix
Technical term (2/2) • Substring • Suffix 6 Tree no$ $ $ n o o 3 4 1 nno$ $ 例:nonno$ 5 2
Pattern Discovery problem Find a pattern string that occurs in all strings of A and in no strings of B. A B AKEBONO MUSASHIMARU WAKANOHANA TAKANOHANA CONTRIBUTIONS OF AI CONTRIBUTIONS OF UN BEYOND MESSY LEARNING TRADITIONAL APPROACHES BASED ON LOCAL SEARCH ALGORITHMS GENETIC ALGORITHMS BOOLEAN CLASSIFICATION PROBABILISTIC RULE SYMBOLIC TRANSFORMATION NUMERIC TRANSFORMATION BACON SANDWICH PLAIN OMELETTE PUBLICATION OF DISSERTATION TOY EXAMPLES
Pattern Discovery problem • More skillful pattern
Motivation • To build a pruning algorithm of pattern discovery algorithm
Problem establishment • Input : • Output :
Theory of graphs • No algorithm calculates reachability on Suffix Tree Graph in theory of graphs • So we have to build new algorithm • Our strategy is to label on nodes
Labeling algorithm
Suffix Tree Graph (1, 3) (1, 6) 6 3 no$ (1, 4) (7, 7) Preprocessing (9, 9) $ $ n o 例:nonno$ 4 time is (1, 4) (1, 1) proportional to the number of labels. o nno$ 1 (1, 4) (7, 7) So time complexity nno$ is (1, 5) (7, 8) $ 5 2 Naive algorithm (1, 2) (1, 5)
bi bi bk $ b bk a b … b b b … b b a b … b b b … b b a b … b b a b … … b bi b b b … … bk
bi bi bk bk a b … b b b … b b a b … b b b … b b a b … b b b … b b a $ b b … … bk b a … b … … b bi
bi bi bk bk a b b …b b b b… b b a b b …b b b b… b b a b b …b b b b… b b a b b b …b b b b… b b a $ b b … … bk b a … b … … b bi b
Summary of the background ○(正例) ×(負例)
Problem establishment
Suffix Tree Graph (ST-Graph)
How to use ST-Graph
Labeling algorithm
The complexity of the algorithm
Suffix Tree with Suffix Links a a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 b $ b b a $ a b b a a b b b a a $ $ a b b a $ a b b b a $ $ $ a b $ b b b a $
Suffix Tree with Graph Suffix Links a a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 b $ b b a $ a b b a a b b b a a $ $ a b b a $ a b b b a $ $ $ a b $ b b b a $
Suffix Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 a b $ b a $ a b b a a b b b a a $ $ b ba a b b Every nodes have $ a a substring. b $ ba abb $ babb b a $ b a b b b a $
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 a b $ b b a $ a b b a a b b b a a $ $ b a babb b a $ b b a b b b a $ $ babb $ a b $ b b b a $
Suffix Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 a b $ b a $ a b b a a b b b a a $ $ b ba a Every nodes haveb a substring. b $ a For example… b $ ba babb $ b b a $ a b b b a $ ba babbba$ b b b a $
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11
bi $b a b … b b b b … b b b a b … b b a b b … b b a a b a … b b b b b b b … b b a a … b … … bk b b b a a … b b … b bi b … bk … b b b … b bk … b bi b
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 (1, 20) 20 (1, 10) (12, 14) (15, 16) (18, 18) (1, 6) 14 (15, 16) b (18, 18) 18 a (1, 6) (15, 16) b 16 b a a b $ (1, 6) b b b 6 b b a a $ (1, 3) $ 3 1 (1, 9) (12, 13) (15, 19) b 19 b a $ b (1, 1) a $ (1, 11) 11 10 (1, 10) 13 b b 15 (1, 5) (15, 15) a b $ b 5 b a $ 2 (1, 2) (1, 9) (12, 13) (15, 15) $ $ 9 (1, 9) 17 a a b $ 12 8 (1, 8) 7 (1, 7) (1, 5) (1, 8) (12, 12) (15, 17) (1, 8) (12, 12) b b b a $ 4 (1, 4)
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 (1, 20) 20 (1, 10) (15, 16) (18, 18) (12, 14) (1, 6) 14 (15, 16) b (18, 18) 18 a (1, 6) (15, 16) b 16 b a a b $ (1, 6) b b b 6 b b a a $ (1, 3) $ 3 1 (1, 9) (12, 13) (15, 19) b 19 b a $ b (1, 1) a $ (1, 11) 11 10 (1, 10) 13 b b 15 (1, 5) (15, 15) a b $ b 5 b a $ 2 (1, 2) (1, 9) (15, 15) (12, 13) $ $ 9 (1, 9) 17 a a b $ 12 8 (1, 8) 7 (1, 7) (1, 5) (1, 8) (12, 12) (15, 17) (1, 8) (12, 12) b b b a $ 4 (1, 4)
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 20 14 11 19 18 17 13 1. Assign a number to each nodes 12 in post order numbering 10 16 9 15 8 7 6 5 4 3 2 1
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 (1, 20) 20 (12, 14) (18, 18) (1, 11) 14 (15, 19) 11 19 18 10 (15, 16) (1, 10) 13 16 (1, 6) (12, 13) 15 (15, 15) 8 (1, 8) 7 (1, 7) 5 (1, 3) 3 1 (15, 17) 12 (12, 12) 9 (1, 9) 6 (1, 1) 17 2 (1, 2) (1, 5) 4 (1, 4)
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 (1, 20) 20 (1, 10) (15, 16) (18, 18) (12, 14) (1, 6) 14 (15, 16) b (18, 18) 18 a (1, 6) (15, 16) b 16 b a a b $ (1, 6) b b b 6 b b a a $ (1, 3) $ 3 1 (1, 9) (12, 13) (15, 19) b 19 b a $ b (1, 1) a $ (1, 11) 11 10 (1, 10) 13 b b 15 (1, 5) (15, 15) a b $ b 5 b a $ 2 (1, 2) (1, 9) (15, 15) (12, 13) $ $ 9 (1, 9) 17 a a b $ 12 8 (1, 8) 7 (1, 7) (1, 5) (1, 8) (12, 12) (15, 17) (1, 8) (12, 12) b b b a $ 4 (1, 4)
bi bi bk a b b …b b b b… b b a b b …b b b b… b b a b b …b b b b… b b a b b b …b b b b… b b a $ b b b … … bk … b … a bi bk a Suffix Tree of Xi
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 (1, 20) 20 (12, 14) (18, 18) (1, 11) 14 (15, 19) 11 19 18 (1, 10) (15, 16) 13 (12, 13) 16 (15, 15) (1, 8) 7 (1, 7) 6 5 (1, 3) 3 1 (15, 17) 10 Assign an interval label to each 12 node. 2. (12, 12) 9 3. One is the number of the node, the other (1, 9)number in 8 the subtree. 15 4. is the minimum (1, 6) (1, 1) 17 2 (1, 2) (1, 5) 4 (1, 4)
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 (1, 20) 20 (12, 14) (18, 18) (1, 11) 14 (15, 19) 11 19 18 (1, 10) (15, 16) 13 (12, 13) 16 (15, 15) (1, 8) 7 (1, 7) 6 5 (1, 3) 3 1 (15, 17) 10 Assign an interval label to each 12 node. 2. (12, 12) 9 3. One is the number of the node, the other (1, 9)number in 8 the subtree. 15 4. is the minimum (1, 6) (1, 1) 17 2 (1, 2) (1, 5) 4 (1, 4)
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 (1, 20) 20 (12, 14) (18, 18) (1, 11) 14 (15, 19) 11 19 18 10 (15, 16) (1, 10) 13 16 (1, 6) (12, 13) 15 (15, 15) 8 (1, 8) 7 (1, 7) 5 (1, 3) 3 1 (15, 17) 12 (12, 12) 9 (1, 9) 6 (1, 1) 17 2 (1, 2) (1, 5) 4 (1, 4)
Suffix Link Tree a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 (1, 20) 20 (1, 10) (12, 14) (15, 16) (18, 18) (1, 6) 14 (15, 16) b (18, 18) 18 a (1, 6) (15, 16) b 16 b a a b $ (1, 6) b b b 6 b b a a $ (1, 3) $ 3 1 (1, 9) (12, 13) (15, 19) b 19 b a $ b (1, 1) a $ (1, 11) 11 10 (1, 10) 13 b b 15 (1, 5) (15, 15) a b $ b 5 b a $ 2 (1, 2) (1, 9) (12, 13) (15, 15) $ $ 9 (1, 9) 17 a a b $ 12 8 (1, 8) 7 (1, 7) (1, 5) (1, 8) (12, 12) (15, 17) (1, 8) (12, 12) b b b a $ 4 (1, 4)
Suffix Link Tree (1, 20) (1, 10) (15, 16) (18, 18) (1, 6) (12, 14) 14 (15, 16) b (18, 18) 18 (1, 6) (15, 16) a b 16 b a a b $ (1, 6) b b b 6 b b a a $ (1, 3) $ 3 1 20 a $ (1, 11) 11 (1, 9) (12, 13) (15, 19) b 19 b a $ b (1, 1) a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 10 (1, 10) 13 b b (1, 5) 15 (15, 15) a b $ b 5 b a $ 2 (1, 2) (1, 9) (15, 15) (12, 13) $ $ 9 (1, 9) 17 a a b $ 12 8 (1, 8) 7 (1, 7) (1, 5) (1, 8) (12, 12) (15, 17) (1, 8) (12, 12) b b b a $ 4 (1, 4)
bi bi bk bk a b b …b b b b… b b a b b …b b b b… b b a b b …b b b b… b b a b b b …b b b b… b b a $ b b … … bk b … … b bi b a Suffix Tree of Xi
General case a b b b a $ 1 2 3 4 5 6 7 8 9 10 11 a b $ b b a $ a b b a a b b b a a $ $ b a b b b a $ $ a b $ b b graph is a DAG. This a The name is $ $ a b $ b b b a $ “Suffix Tree Graph” This graph is a DAG.
General case T=ababbabbba $ a b $ b b a $ a b b a a b b b a a $ $ a b b a $ a b b b a $ $ $ a b $ b b b a $
- Slides: 91