User Tools

Site Tools


lecture_notes:04-22-2011

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
lecture_notes:04-22-2011 [2011/06/08 17:07]
eyliaw [Suffix array]
lecture_notes:04-22-2011 [2011/06/10 00:22]
eyliaw [Searching]
Line 11: Line 11:
    ​GOOGOL    ​GOOGOL
 Append end character: Append end character:
-   ​GOOGOL$+   X = GOOGOL$
 Cyclic transformation:​ Cyclic transformation:​
-   GOOGOL$ +   GOOGOL$ 
-   OOGOL$G +   OOGOL$G 
-   OGOL$GO +   OGOL$GO 
-   GOL$GOO +   GOL$GOO 
-   OL$GOOG +   OL$GOOG 
-   L$GOOGO +   L$GOOGO 
-   $GOOGOL+   $GOOGOL
 Sort: Sort:
-   $GOOGOL +   $GOOGOL 
-   GOL$GOO +   GOL$GOO 
-   GOOGOL$ +   GOOGOL$ 
-   L$GOOGO +   L$GOOGO 
-   OGOL$GO +   OGOL$GO 
-   OL$GOOG +   OL$GOOG 
-   OOGOL$G +   OOGOL$G 
-   + 
 +   S(i) = [6,​3,​0,​5,​2,​4,​1] 
 +The Burrows Wheeler transform takes the last character of the sorted cyclic strings: 
 +   B(i) = LO$OOGG 
 +===== Searching ===== 
 +We can use the FM-index to find the upper and lower bounds of a substring. 
 + 
 +C_X(a) is the number of characters lexicographically before a in X. 
 +   G 0 
 +   L 2 
 +   O 3 
 +O_X(a,i) is the number of occurrences of a in B_X[0,i]. 
 +^ i ^ B_X[0,i] ^ O_X(G,i) ^ O_X(L,i) ^ O_X(O,i) ^ 
 +| 1 | L        | 0        | 1        | 0        |  
 +| 2 | LO       | 0        | 1        | 1        |  
 +| 3 | LO$      | 0        | 1        | 1        |  
 +| 4 | LO$O     | 0        | 1        | 2        |  
 +| 5 | LO$OO    | 0        | 1        | 3        |  
 +| 6 | LO$OOG ​  | 1        | 1        | 3        |  
 +| 7 | LO$OOGG ​ | 2        | 1        | 3        |  
 + 
 +There are then two recursive formulas to find the start and end positions of a substring. 
 +   End R_(aW) = C(a) + O(a,R_(W) - 1) + 1 or 1 if W is the empty string 
 +   Start R-(aW) = C(a) + O(a,R-(W)) or (n - 1) if W is the empty string 
 +Where a is the first character and W is the word.
lecture_notes/04-22-2011.txt · Last modified: 2015/08/09 23:06 by 212.129.31.47