Two Topics in Adaptive Algorithms: Hulls and Strings Robert Fraser University of Waterloo.
-
date post
21-Dec-2015 -
Category
Documents
-
view
215 -
download
0
Transcript of Two Topics in Adaptive Algorithms: Hulls and Strings Robert Fraser University of Waterloo.
Two Topics in Adaptive Algorithms:
Hulls and Strings
Robert Fraser
University of Waterloo
2
What to expect
• Convex Hulls– Adaptive sorting, measures of difficulty– Techniques– Adaptivity of output sensitive
techniques
• String Matching– Online string matching– Boyer Moore Horspool technique– Adaptive string matching
Adaptive Sorting
• All kinds of techniques and measures (see Estivill-Castro & Wood, 89)
• I love Straight Merge Sort!
(Odd-even sms is pretty good too…)
3
Planar Convex Hulls
• Many techniques– Gift wrapping– Graham Scan– Output sensitive– Adaptive (Levcopolous et al., Barbay & Chen)– New adaptive techniques?
4
Adaptivity of CSY-hull
• Ω(n log h)
• Add a step CHECKHULL to give adaptivity
• Considering performance on a good instance however, you get CUPS
• Could also determine difficulty of interior points…
5
Adaptivity wrt Max!
6Max
Com
paris
ons
QuicksortLP-odd-even sms
LP sort
Odd-even sms
Straight mergesort
Adaptivity wrt Runs!
7Runs
Com
paris
ons
Quicksort
LP-odd-even sms
LP sort
Odd-even sms
Straight mergesort
Straight mergesortwith reverse!
Busiest slide ever?
8
New York GIS data
264346 points, 33 on hull
sm: 4346700
oesm: 4351874
lpoesm: 6056577
lp: 9408131
gs: 5792637
dis: 263950
max: 2074199
10
String Matching Techniques
• Naïve – standard sliding window – θ(n·m)
• Linear time – as discussed by KMP– O(n+m)
• Expected sublinear – We’ll look at the standard Boyer-Moore
Horspool, but there are many!– O(n log m/m +m) expected, O(n·m) worst case
Boyer Moore Horpsool
11
0 1 2 3 4 5 6 7 8 9 10
b b b c b a a c c a a
a c c a a
String Matching with More Jumps
• Try to maximize the jumps with Horspool-type searching
12
Extensions
• Uneven distribution of data
• 2D string matching
• Applications (bioinformatics)
• Works best on small alphabets with many repeats
13
14
Thanks
• Questions?
Supported by NSERC and the University of
Waterloo