Dictionary Matching and Indexing with Edits and Don’t Cares
description
Transcript of Dictionary Matching and Indexing with Edits and Don’t Cares
![Page 1: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/1.jpg)
Dictionary Matching and Indexing with Edits and Don’t
Cares
Richard ColeNYU
Lee-Ad GottliebNYU
Moshe LewensteinBar-Ilan
![Page 2: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/2.jpg)
Pattern Matching
Various problems of the following flavor:
Preprocess a text t,or a collection of strings d1,…,dx,
so that given a query string p, all matches with the text can be found quickly.
IndexingDictionary queries
Dictionary matchingAll-to-all matching
![Page 3: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/3.jpg)
Pattern Matching
Dictionary queries.
Bate Beat Boat Boot
Beta
![Page 4: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/4.jpg)
Pattern Matching
Dictionary matching.
Bate Beat Boat Boot
The fish beat my boot.
![Page 5: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/5.jpg)
Pattern Matching
Text indexing.
abracadabra
ra ra
![Page 6: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/6.jpg)
Pattern Matching
All-to-all matching.
Bate Beat Boat Boot
bat boots be
![Page 7: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/7.jpg)
Previous Work
a
t
e o
o
t
Bate BeatBoat Boot
aa
e
t
b
t
Beta
Dictionary Queries
![Page 8: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/8.jpg)
Previous Work
a
t
e o
o
t
Bate BeatBoat Boot
aa
e
t
b
t
Beta
Dictionary Queries
![Page 9: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/9.jpg)
Suffix Treeg o
o
g
Oogogoogogogoggogogg
g
oogo
g
o
g
o
g
Text Indexing
![Page 10: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/10.jpg)
Suffix Treeg o
o
g
Oogogoogogogoggogogg
g
oogo
g
o
g
o
g
Text Indexing
![Page 11: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/11.jpg)
Suffix Treeg o
o
g
Oogogoogogogoggogogg
g
oogo
g
o
g
o
g
Text Indexing
![Page 12: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/12.jpg)
Suffix Treeg o
o
g
Oogogoogogogoggogogg
g
oogo
g
o
g
o
g
Text Indexing
![Page 13: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/13.jpg)
Approximate Matches
Wildcards (don’t cares)BoatBo*t
SubstitutionsBoatBoot
Edits – insertions and deletionsBoatB_at
![Page 14: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/14.jpg)
Previous Work – Best Results
Indexing and Dictionary Matching (edits) Buchsbaum, Goodrich, Westbrook.
k=1 p log log n + occ query timen log n space
Dictionary Queries (substitutions) Brodal, Gasieniec.
k=1 p + occ query timen space
![Page 15: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/15.jpg)
Previous Work – Basic Intuition
abracadabra Build a suffix tree for
abracadab abracada abracad abraca abrac abra abr ab a
abracadabra And for
a ar arb arba arbad arbada arbadac arbadaca arbadacar
abrac*dabra
![Page 16: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/16.jpg)
New Results
Indexing, Dictionary Queries, Dictionary Matches Substitutions
k < log n p + [(c1log n)k log log n] / k! + occ query timen(c2log n)k / k! space
Editsk < log n p + [(c3log n)k log log n] / k!
+ 3kocc query timen(c4log n)k / k! space
Wildcards in patternk < log n p + 2klog log n / k! + occ query time
n + (k+log n)k / k! space
![Page 17: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/17.jpg)
Dictionary Wildcard Queries
Three data structures for dictionary wildcard queries
Naïve: O(n) space kp query time
Less-naïve: O(n1+k) p
New data structure: O(n logkn) 2kp
![Page 18: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/18.jpg)
Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
![Page 19: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/19.jpg)
Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
![Page 20: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/20.jpg)
Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
![Page 21: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/21.jpg)
Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
![Page 22: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/22.jpg)
Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
![Page 23: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/23.jpg)
Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
![Page 24: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/24.jpg)
Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
Query time:k p
![Page 25: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/25.jpg)
Less-Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
![Page 26: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/26.jpg)
Less-Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
i
n
a
y
*
tr t
![Page 27: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/27.jpg)
Less-Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
i
n
a
y
*
tr t
Query string:*it
![Page 28: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/28.jpg)
Less-Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
i
n
a
y
*
tr t
![Page 29: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/29.jpg)
Less-Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
i
n
a
y
*
tr t
![Page 30: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/30.jpg)
Less-Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
i
n
a
y
*
tr t
Query time:p
![Page 31: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/31.jpg)
Less-Naïve Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
*
*
*
Space:O(n1+k)
*
![Page 32: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/32.jpg)
New Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
![Page 33: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/33.jpg)
New Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
i
n
a
y
*
t
![Page 34: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/34.jpg)
New Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
i
n
a
y
*
t
![Page 35: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/35.jpg)
New Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
i
n
a
y
*
t
![Page 36: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/36.jpg)
New Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
i
n
a
y
*
t
![Page 37: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/37.jpg)
New Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
i
n
a
y
*
t
![Page 38: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/38.jpg)
New Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
i
n
a
y
*
t
![Page 39: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/39.jpg)
New Approach
f
a
rt
i
t
p
i
n
a
y
s
i
t
Query string:*it
i
n
a
y
*
t
Query time:2kp
![Page 40: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/40.jpg)
Space Analysis
Create a wildcard subtree at each node in the original trie. heaviest child is not in the wildcard tree.
Look at any leaf of the trie How many of its ancestors were not the heaviest child?
log2n So it appears in at most log n wildcard trees.
Space: n log n n logkn
![Page 41: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/41.jpg)
Edit Distance
Wildcards is (algorithmically) the simplest type of approximate search.
What issues come up when dealing with substitutions, insertions and deletions?
![Page 42: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/42.jpg)
Substitution Search
a
a
a
b
b
b
a
a
Query string:aab
![Page 43: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/43.jpg)
Substitution Search
a
a
a
b
b
b
a
a
Query string:aab
![Page 44: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/44.jpg)
Substitution Search
a
a
a
b
b
b
a
a
Query string:aab
![Page 45: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/45.jpg)
Substitution Search
a
a
a
b
b
b
a
a
Query string:aab
![Page 46: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/46.jpg)
Substitution Search
a
a
a
b
b
b
a
a
Query string:aab
![Page 47: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/47.jpg)
Substitution Search
a
a
a
b
b
b
a
a
Query string:aab
![Page 48: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/48.jpg)
Substitution Search
a
a
a
b
b
b
a
a
Query string:aab
![Page 49: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/49.jpg)
Substitution Search
a
a
a
b
b
b
a
a
Query string:aab
![Page 50: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/50.jpg)
Substitution Tree
a
a
a
b
b
b
a
a
Query string:aab
![Page 51: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/51.jpg)
Substitution Tree
a
a
a
b
b
b
a
a a
a
a
Query string:aab
![Page 52: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/52.jpg)
Deletion Tree
a
a
a
b
b
c
a
a
Deletion tree
![Page 53: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/53.jpg)
Deletion Tree
a
a
a
b
b
c
a
a
c
bDeletion tree!
![Page 54: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/54.jpg)
Insertion Tree
a
a
a
b
b
c
a
a
Insertion tree
![Page 55: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/55.jpg)
Insertion Tree
a
a
a
b
b
c
a
a
a
c
b
Insertion tree!
![Page 56: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/56.jpg)
Grouping
a
a
a
b
b
b
a
a a
a
a
Query string:aab
![Page 57: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/57.jpg)
Grouping
a
a
a
b
b
b
a
a a
a
a
Query string:aab
b
a
![Page 58: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/58.jpg)
Grouping
a
a
a
b
b
b
a
a a
a
a
Query string:aab
b
a
a
![Page 59: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/59.jpg)
Grouping
a
a
a
b
b
b
a
a a
a
a
Query string:aab
bGrouping!
![Page 60: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/60.jpg)
Analysis
Can’t merge along all possible paths of original trie – too expensive.
Merge along centroid paths. Centroid paths always follow the heaviest child.
Any path from root to leaf traverses at most log n centroid paths.
![Page 61: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/61.jpg)
Analysis
![Page 62: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/62.jpg)
Analysis
![Page 63: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/63.jpg)
Analysis
![Page 64: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/64.jpg)
Analysis
![Page 65: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/65.jpg)
Grouping
![Page 66: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/66.jpg)
Grouping
![Page 67: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/67.jpg)
Grouping
![Page 68: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/68.jpg)
Grouping
![Page 69: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/69.jpg)
Grouping
![Page 70: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/70.jpg)
Grouping
Suppose a search reached up to the 7th edge with no
substitutions.
![Page 71: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/71.jpg)
Grouping
Suppose a search reached up to the 7th edge with no
substitutions.
![Page 72: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/72.jpg)
Grouping
Suppose a search reached up to the 7th edge with no
substitutions.
![Page 73: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/73.jpg)
Grouping
…then we searchonly three
substitution trees.
Space increase:log n factor
Suppose a search reached up to the 7th edge with no
substitutions.
![Page 74: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/74.jpg)
Analysis w1
w2
w3
w4
log n searches
log n searches
log n searches
Total number of searches:log n * log n = log2 n
![Page 75: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/75.jpg)
Analysis
For k=1 For each centroid path traversed, log n substitution
subtree searches. A path to a leaf traverses at most log n centroid
paths. log2n searches log n searches using balanced
grouping.
More generally logkn searches Using a Y-fast trie, each search takes log log n time
logkn log log n
![Page 76: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/76.jpg)
More Rigorous Analysis
Balanced SearchTree
![Page 77: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/77.jpg)
More Rigorous Analysis
Weight Balanced Search Tree
![Page 78: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/78.jpg)
More Rigorous Analysis
Weight Balanced Search Tree
![Page 79: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/79.jpg)
More Rigorous Analysis
Weight Balanced Search Tree
![Page 80: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/80.jpg)
More Rigorous Analysis
Weight Balanced Search Tree
![Page 81: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/81.jpg)
More Rigorous Analysis
Weight Balanced Search Tree
O(log(W/w)) levels
![Page 82: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/82.jpg)
More Rigorous Analysis
For a segment of a centroid path whose top has weight W and bottom has weight w we do about log (W/w) searches
![Page 83: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/83.jpg)
Analysis w1
w2
w3
w4
log(w1/w2) searches
log(w2/w3) searches
log(w3/w4) searches
Total number of searches:log(w1/w2) + log(w2/w3) log(w3/w4) =log(w1/w4)
![Page 84: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/84.jpg)
More Rigorous Analysis
Time for one match: logkn log log n / k!
Space: n(c log n)k / k! for some constant c
![Page 85: Dictionary Matching and Indexing with Edits and Don’t Cares](https://reader036.fdocuments.net/reader036/viewer/2022062810/56815ac9550346895dc89a0c/html5/thumbnails/85.jpg)
Open Problem
Dynamic search structure. Requires a less strict notion of “centroid path”?