recuperació de la informació · 2009-11-13 · exact string matching: one pattern (text on-line)...
TRANSCRIPT
![Page 1: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/1.jpg)
Recuperació de la informació
•Modern Information Retrieval (1999)
Ricardo-Baeza Yates and Berthier Ribeiro-Neto
•Flexible Pattern Matching in Strings (2002)
Gonzalo Navarro and Mathieu Raffinot
•http://www-igm.univ-mlv.fr/~lecroq/string/index.html
Algorismes de:
Cerca de patrons (exacta i aproximada)
(String matching i Pattern matching)
Indexació de textos:
Suffix trees, Suffix arrays
![Page 2: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/2.jpg)
String Matching
String matching: definition of the problem (text,pattern)
depends on what we have: text or patterns• Exact matching:
• Approximate matching:
• 1 pattern ---> The algorithm depends on |p| and | |
• k patterns ---> The algorithm depends on k, |p| and | |
• The text ----> Data structure for the text (suffix tree, ...)
• The patterns ---> Data structures for the patterns
• Dynamic programming
• Sequence alignment (pairwise and multiple)
• Extensions
• Regular Expressions
• Probabilistic search:
• Sequence assembly: hash algorithm
Hidden Markov Models
![Page 3: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/3.jpg)
Exact string matching: one pattern (text on-line)
Experimental efficiency (Navarro & Raffinot)
2 4 8 16 32 64 128 256
64
32
16
8
4
2
| |
Long. pattern
Horspool
BNDMBOM
BNDM : Backward Nondeterministic Dawg Matching
BOM : Backward Oracle Matching
w
![Page 4: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/4.jpg)
Multiple string matching
5 10 15 20 25 30 35 40 45
8
4
2
| |Wu-Manber
SBOMlmin
(5 strings)
5 10 15 20 25 30 35 40 45
8
4
2
Wu-Manber
SBOM
(10 strings)
Ad AC
5 10 15 20 25 30 35 40 45
8
4
2
Wu-Manber
SBOM (1000 strings)
Ad AC
5 10 15 20 25 30 35 40 45
8
4
2
Wu-Manber
SBOM
(100 strings)
Ad AC
![Page 5: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/5.jpg)
Trie
Construct the trie of
GTATGTA,GTAT,TAATA,GTGTA
![Page 6: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/6.jpg)
Trie
Construct the trie of
GTATGTA,GTAT,TAATA,GTGTA
G
G
AT
TT A
![Page 7: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/7.jpg)
Trie
Construct the trie of
GTATGTA,GTAT,TAATA,GTGTA
G
G
AT
TT A
![Page 8: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/8.jpg)
Trie
Construct the trie of
GTATGTA,GTAT,TAATA,GTGTA
A
G
G
AT
TT
T A
A
AA T
![Page 9: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/9.jpg)
Trie
Construct the trie of
GTATGTA,GTAT,TAATA,GTGTA
T A
G
G
AT
TT
T
G
A
A
AA T
Which is the cost?
![Page 10: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/10.jpg)
Set Horspool algorithm
Text :
Patterns:
By suffixes
• Which is the next position of the window?
• How the comparison is made?
a
Trie of all inverse patterns
We shift until a is aligned with the first a in the trie not longer than lmin, or lmin
![Page 11: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/11.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
G
G
AT
TT
T
G
A
A
AA T
1. Construct the trie of GTATGTA,
GTAT, TAATA i GTGTA
2. Determine lmin=
![Page 12: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/12.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
G
G
AT
TT
T
G
A
A
AA T
1. Construct the trie of GTATGTA,
GTAT, TAATA i GTGTA
2. Determine lmin=4A 1
C 4 (lmin)
G
T
3. Determine the shift table
![Page 13: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/13.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
G
G
AT
TT
T
G
A
A
AA T
1. Construct the trie of GTATGTA,
GTAT, TAATA i GTGTA
2. Determine lmin=4A 1
C 4 (lmin)
G 2
T
3. Determine the shift table
![Page 14: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/14.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
4. Find the patterns
T A
G
G
AT
TT
T
G
A
A
AA T
1. Construct the trie of GTATGTA,
GTAT, TAATA i GTGTA
2. Determine lmin=4A 1
C 4 (lmin)
G 2
T 1
3. Determine the shift table
![Page 15: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/15.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACA…
A 1
C 4 (lmin)
G 2
T 1
![Page 16: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/16.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACA…
A 1
C 4 (lmin)
G 2
T 1
![Page 17: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/17.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACA…
A 1
C 4 (lmin)
G 2
T 1
![Page 18: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/18.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACA…
A 1
C 4 (lmin)
G 2
T 1
![Page 19: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/19.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACA…
A 1
C 4 (lmin)
G 2
T 1
![Page 20: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/20.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACA…
A 1
C 4 (lmin)
G 2
T 1
![Page 21: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/21.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACA…
A 1
C 4 (lmin)
G 2
T 1
…
![Page 22: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/22.jpg)
Set Horspool algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACA…
A 1
C 4 (lmin)
G 2
T 1
Is the expected length of the shifts related with the
number of patterns?
…
As more patterns we search for,
shorter shifts we do!
![Page 23: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/23.jpg)
AA 1
AC 3 (LMIN-L+1)
AG
AT
CA
CC
CG
…
2 símbols
Set Horspool algorithm Wu-Manber algorithm
How the length of shifts can be increased?
By reading blocks of symbols instead of only one!
Given ATGTATG,TATG,ATAAT,ATGTG
A 1
C 4 (lmin)
G 2
T 1
1 símbol
![Page 24: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/24.jpg)
AA 1
AC 3 (LMIN-L+1)
AG
AT
CA
CC
CG
…
2 símbols
Set Horspool algorithm Wu-Manber algorithm
How the length of shifts can be increased?
By reading blocks of symbols instead of only one!
Given ATGTATG,TATG,ATAAT,ATGTG
A 1
C 4 (lmin)
G 2
T 1
1 símbol
3
![Page 25: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/25.jpg)
AA 1
AC 3 (LMIN-L+1)
AG
AT
CA
CC
CG
…
2 símbols
Set Horspool algorithm Wu-Manber algorithm
How the length of shifts can be increased?
By reading blocks of symbols instead of only one!
Given ATGTATG,TATG,ATAAT,ATGTG
A 1
C 4 (lmin)
G 2
T 1
1 símbol
31
![Page 26: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/26.jpg)
AA 1
AC 3 (LMIN-L+1)
AG
AT 1
CA
CC
CG
…
2 símbols
Set Horspool algorithm Wu-Manber algorithm
How the length of shifts can be increased?
By reading blocks of symbols instead of only one!
Given ATGTATG,TATG,ATAAT,ATGTG
A 1
C 4 (lmin)
G 2
T 1
1 símbol
3
3
3
3
![Page 27: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/27.jpg)
AA 1
AC 3 (LMIN-L+1)
AG 3
AT 1
CA 3
CC 3
CG 3
…
2 símbols
Set Horspool algorithm Wu-Manber algorithm
How the length of shifts can be increased?
By reading blocks of symbols instead of only one!
Given ATGTATG,TATG,ATAAT,ATGTG
AA 1
AT 1
GT 1
TA 2
TG 2
A 1
C 4 (lmin)
G 2
T 1
1 símbol
![Page 28: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/28.jpg)
Wu-Manber algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACATAATA
AA 1
AT 1
GT 1
TA 2
TG 2
![Page 29: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/29.jpg)
Wu-Manber algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACATAATA
AA 1
AT 1
GT 1
TA 2
TG 2
![Page 30: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/30.jpg)
Wu-Manber algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACATAATA
AA 1
AT 1
GT 1
TA 2
TG 2
![Page 31: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/31.jpg)
Wu-Manber algorithm
Search for ATGTATG,TATG,ATAAT,ATGTG
T A
A
G
G
AT
TT
T
G
A
A
AA T
text: ACATGCTATGTGACATAATA
…
AA 1
AT 1
GT 1
TA 2
TG 2
log|Σ| 2*lmin*k
But given k patterns,
how many symbols
we should take ?
![Page 32: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/32.jpg)
Multiple string matching
5 10 15 20 25 30 35 40 45
8
4
2
| |Wu-Manber
SBOMlmin
(5 strings)
5 10 15 20 25 30 35 40 45
8
4
2
Wu-Manber
SBOM
(10 strings)
Ad AC
5 10 15 20 25 30 35 40 45
8
4
2
Wu-Manber
SBOM (1000 strings)
Ad AC
5 10 15 20 25 30 35 40 45
8
4
2
Wu-Manber
SBOM
(100 strings)
Ad AC
![Page 33: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/33.jpg)
BOM algorithm (Backward Oracle Matching)
• Which is the next position of the window?
• How the comparison is made?
Text :
Pattern : Automata: Factor Oracle
Check if the suffix is a factor of any pattern
The position determined by the last character of the text
with a transition in the automata
![Page 34: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/34.jpg)
Factor Oracle of k strings
How can we build the Factor Oracle of
GTATGTA, GTAA, TAATA i GTGTA ?
T A
A
GG AT TT
T
A
G
A
1,4
32
A
![Page 35: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/35.jpg)
Factor Oracle of k strings
Given the Factor Oracle of GTATGTA
G T
![Page 36: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/36.jpg)
Factor Oracle of k strings
Given the Factor Oracle of GTATGTA
G AT
T
![Page 37: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/37.jpg)
Factor Oracle of k strings
Given the Factor Oracle of GTATGTA
G AT T
T
A
![Page 38: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/38.jpg)
Factor Oracle of k strings
Given the Factor Oracle of GTATGTA
GG AT T
T
A
![Page 39: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/39.jpg)
Factor Oracle of k strings
Given the Factor Oracle of GTATGTA
GG AT T
T
A
G
T
![Page 40: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/40.jpg)
Factor Oracle of k strings
Given the Factor Oracle of GTATGTA
GG AT TT
T
A
G
… we insert GTAA
A
1
![Page 41: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/41.jpg)
Factor Oracle of k strings
…inserting GTAA
GG AT TT
T
A
G
A
1
A
2
![Page 42: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/42.jpg)
Factor Oracle of k strings
Given the AFO of GTATGTA and GTAA
A
GG AT TT
T
A
G
A
… we insert TAATA
1
2
![Page 43: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/43.jpg)
Factor Oracle of k strings
… inserting TAATA
T
A
GG AT TT
T
A
G
A
A1
2
A
3
![Page 44: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/44.jpg)
Factor Oracle of k strings
Given the AFO of GTATGTA, GTAA and TAATA
T A
A
GG AT TT
T
A
G
A
1
32
A
…we insert GTGTA
![Page 45: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/45.jpg)
Factor Oracle of k strings
…inserting GTGTA
T A
A
GG AT TT
T
A
G
A
1
32
A
![Page 46: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/46.jpg)
Factor Oracle of k strings
This is the Automata Factor Oracle of
GTATGTA, GTAA, TAATA and GTGTA
T A
A
GG AT TT
T
A
G
A
1,4
32
A
![Page 47: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/47.jpg)
SBOM algorithm
• Which is the next position of the window?
• How the comparison is made?
Text :
Pattern : Automata: Factor Oracle (Inverse patterns of length lmin)
Check if the suffix is a factor of any pattern
The position determined by the last character of the text
with a transition in the automata
![Page 48: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/48.jpg)
SBOM algorithm: example
… the we build the Automata Factor Oracle of
GTATG, GTAAT, TAATA and GTGTA
of length lmin=5
We search for the patterns
ATGTATG, TAATG,TAATAAT i AATGTG
GG AT TT
TA
G A
T A
A1 4
2 3
A
![Page 49: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/49.jpg)
SBOM algorithm: example
Search for ATGTATG, TAATG,TAATAAT i AATGTG
GG AT TT
TA
G A
T A
A1 4
2 3
text: ACATGCTAGCTATAATAATGTATG
A
![Page 50: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/50.jpg)
SBOM algorithm: example
Search for ATGTATG, TAATG,TAATAAT i AATGTG
GG AT TT
TA
G A
T A
A1 4
2 3
text: ACATGCTAGCTATAATAATGTATG
A
![Page 51: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/51.jpg)
SBOM algorithm: example
Search for ATGTATG, TAATG,TAATAAT i AATGTG
GG AT TT
TA
G A
T A
A1 4
2 3
text: ACATGCTAGCTATAATAATGTATG
A
![Page 52: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/52.jpg)
SBOM algorithm: example
Search for ATGTATG, TAATG,TAATAAT i AATGTG
GG AT TT
TA
G A
T A
A1 4
2 3
text: ACATGCTAGCTATAATAATGTATG
A
![Page 53: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/53.jpg)
SBOM algorithm: example
Search for ATGTATG, TAATG,TAATAAT i AATGTG
GG AT TT
TA
G A
T A
A1 4
2 3
text: ACATGCTAGCTATAATAATGTATG
A
![Page 54: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/54.jpg)
SBOM algorithm: example
Search for ATGTATG, TAATG,TAATAAT i AATGTG
GG AT TT
TA
G A
T A
A1 4
2 3
text: ACATGCTAGCTATAATAATGTATG
A
![Page 55: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/55.jpg)
SBOM algorithm: example
Search for ATGTATG, TAATG,TAATAAT i AATGTG
GG AT TT
TA
G A
T A
A1 4
2 3
text: ACATGCTAGCTATAATAATGTATG
A
![Page 56: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/56.jpg)
SBOM algorithm: example
Search for ATGTATG, TAATG,TAATAAT i AATGTG
GG AT TT
TA
G A
T A
A1 4
2 3
text: ACATGCTAGCTATAATAATGT…
A
![Page 57: Recuperació de la informació · 2009-11-13 · Exact string matching: one pattern (text on-line) Experimental efficiency (Navarro & Raffinot) 2 4 8 16 32 64 128 256 64 32 16 8 4](https://reader033.vdocuments.us/reader033/viewer/2022050519/5fa29c704f8dd1423879653c/html5/thumbnails/57.jpg)
Multiple string matching
5 10 15 20 25 30 35 40 45
8
4
2
| |Wu-Manber
SBOMlmin
(5 strings)
5 10 15 20 25 30 35 40 45
8
4
2
Wu-Manber
SBOM
(10 strings)
Ad AC
5 10 15 20 25 30 35 40 45
8
4
2
Wu-Manber
SBOM (1000 strings)
Ad AC
5 10 15 20 25 30 35 40 45
8
4
2
Wu-Manber
SBOM
(100 strings)
Ad AC