Two Topics in Adaptive Algorithms: Hulls and Strings Robert Fraser University of Waterloo.

Slides:



Advertisements
Similar presentations
String Searching Algorithm
Advertisements

Chan’s algorithm CS504 Presentation.
Planar Convex Hull 2013 / 5 / 9 Group 4 Sungheon Park Jeongho Son CS504 Presentation [CS504 Presentation]
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
1 Divide-and-Conquer The most-well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances.
Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances.
CS4413 Divide-and-Conquer
Theory of Algorithms: Divide and Conquer
Andrew's Monotone Chain Convex Hull Algorithm. Andrew's Monotone Chain Scan A left-to-right variant of Graham's scan Discovered by Andrew in 1979 Using.
1 Convex Hull in Two Dimensions Jyun-Ming Chen Refs: deBerg et al. (Chap. 1) O’Rourke (Chap. 3)
Design and Analysis of Algorithms – Chapter 51 Divide and Conquer (III)* Dr. Ying Lu RAIK 283: Data Structures & Algorithms *slides referred.
Informal Definition : Let S is set of nails sticking out from a board. the convex hull can be visualized as the shape formed by a tight rubber band that.
Exact String Search Lecture 7: September 22, 2005 Algorithms in Biosequence Analysis Nathan Edwards - Fall, 2005.
Boyer Moore Algorithm String Matching Problem Algorithm 3 cases Searching Timing.
MergeSort (Example) - 1. MergeSort (Example) - 2.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Sorting and Searching. Searching List of numbers (5, 9, 2, 6, 3, 4, 8) Find 3 and tell me where it was.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
Chapter 4: Divide and Conquer The Design and Analysis of Algorithms.
Wednesday, 11/25/02, Slide #1 CS 106 Intro to CS 1 Wednesday, 11/25/02  QUESTIONS??  Today:  More on sorting. Advanced sorting algorithms.  Complexity:
Boyer-Moore string search algorithm Book by Dan Gusfield: Algorithms on Strings, Trees and Sequences (1997) Original: Robert S. Boyer, J Strother Moore.
© 2004 Goodrich, Tamassia Sorting Lower Bound1. © 2004 Goodrich, Tamassia Sorting Lower Bound2 Comparison-Based Sorting (§ 10.3) Many sorting algorithms.
Computational Geometry Overview from Cormen, et al. Chapter 33
5 - 1 § 5 The Divide-and-Conquer Strategy e.g. find the maximum of a set S of n numbers.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
CSC 2300 Data Structures & Algorithms March 20, 2007 Chapter 7. Sorting.
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
The Complexity of Algorithms and the Lower Bounds of Problems
Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances.
Sorting Lower Bound1. 2 Comparison-Based Sorting (§ 4.4) Many sorting algorithms are comparison based. They sort by making comparisons between pairs of.
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
String Matching. Problem is to find if a pattern P[1..m] occurs within text T[1..n] Simple solution: Naïve String Matching –Match each position in the.
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Advanced Algorithm Design and Analysis (Lecture 3) SW5 fall 2004 Simonas Šaltenis E1-215b
MA/CSSE 473 Day 24 Student questions Quadratic probing proof
Towards Robust Indexing for Ranked Queries Dong Xin, Chen Chen, Jiawei Han Department of Computer Science University of Illinois at Urbana-Champaign VLDB.
Chapter 2.8 Search Algorithms. Array Search –An array contains a certain number of records –Each record is identified by a certain key –One searches the.
Fundamental Data Structures and Algorithms Klaus Sutner April 27, 2004 Computational Geometry.
Strings and Pattern Matching Algorithms Pattern P[0..m-1] Text T[0..n-1] Brute Force Pattern Matching Algorithm BruteForceMatch(T,P): Input: Strings T.
Book: Algorithms on strings, trees and sequences by Dan Gusfield Presented by: Amir Anter and Vladimir Zoubritsky.
Searching and Sorting Recursion, Merge-sort, Divide & Conquer, Bucket sort, Radix sort Lecture 5.
Chapter 8 Sorting and Searching Goals: 1.Java implementation of sorting algorithms 2.Selection and Insertion Sorts 3.Recursive Sorts: Mergesort and Quicksort.
Sorting.
1 String Matching Algorithms Topics  Basics of Strings  Brute-force String Matcher  Rabin-Karp String Matching Algorithm  KMP Algorithm.
Convex Hull 2012/10/23. Convex vs. Concave A polygon P is convex if for every pair of points x and y in P, the line xy is also in P; otherwise, it is.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last time Several convex hull algorithms. Lower bound of O(n log n) –O(n log h) for output sensitive.
Design and Analysis of Algorithms – Chapter 71 Space-Time Tradeoffs: String Matching Algorithms* Dr. Ying Lu RAIK 283: Data Structures.
1/39 COMP170 Tutorial 13: Pattern Matching T: P:.
String Searching 2 of 2. String search Simple search –Slide the window by 1 t = t +1; KMP –Slide the window faster t = t + s – M[s] –Never recheck the.
What is the runtime of the best possible (comparison based) sorting algorithm? 1.O(log n) 2.O(n) 3.O(n log n) 4.O(n 2 ) 5.None of the above.
Andrew's Monotone Chain Convex Hull Algorithm
Sorting by Tammy Bailey
13 Text Processing Hongfei Yan June 1, 2016.
CSCE 411 Design and Analysis of Algorithms
CSCE 411 Design and Analysis of Algorithms
Chapter 7 Space and Time Tradeoffs
Pattern Matching 12/8/ :21 PM Pattern Matching Pattern Matching
8/04/2009 Many thanks to David Sun for some of the included slides!
Pattern Matching 1/14/2019 8:30 AM Pattern Matching Pattern Matching.
Pattern Matching 2/15/2019 6:17 PM Pattern Matching Pattern Matching.
Convex Hulls Given a set of points (x1,y1),(x2,y2),…,(xn,yn), the convex hull is the smallest convex polygon containing all the points.
CSC 380: Design and Analysis of Algorithms
CSC 380: Design and Analysis of Algorithms
Pattern Matching Pattern Matching 5/1/2019 3:53 PM Spring 2007
Pattern Matching 4/27/2019 1:16 AM Pattern Matching Pattern Matching
CSC 380: Design and Analysis of Algorithms
Algorithm Course Algorithms Lecture 3 Sorting Algorithm-1
Presentation transcript:

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! 6 Max Comparisons Quicksort LP-odd-even sms LP sort Odd-even sms Straight mergesort

Adaptivity wrt Runs! 7 Runs Comparisons Quicksort LP-odd-even sms LP sort Odd-even sms Straight mergesort with reverse!

Busiest slide ever? 8

New York GIS data points, 33 on hull sm: oesm: lpoesm: lp: gs: dis: max:

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 bbbcbaaccaa accaa

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