Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 1 An overview of lecture 7 An optimal parallel algorithm for the 2D convex hull problem,

Slides:



Advertisements
Similar presentations
General algorithmic techniques: Balanced binary tree technique Doubling technique: List Ranking Problem Divide and concur Lecture 6.
Advertisements

Rahnuma Islam Nishat Debajyoti Mondal Md. Saidur Rahman Graph Drawing and Information Visualization Laboratory Department of Computer Science and Engineering.
CSE 4101/5101 Prof. Andy Mirzaian. References: Lecture Note 8 [LN8]LN8 [CLRS] chapter 33 Lecture Note 8 [LN8]LN8 [CLRS] chapter 33 Applications:  Proximity.
An Improved Algorithm for the Rectangle Enclosure Problem Anatoli Uchitel From an article By D.T. Lee and F.P. Preparata (March 8, 1981)
Comments We consider in this topic a large class of related problems that deal with proximity of points in the plane. We will: 1.Define some proximity.
Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 1 Merging two upper hulls Suppose, UH ( S 2 ) has s points given in an array according.
2/9/06CS 3343 Analysis of Algorithms1 Convex Hull  Given a set of pins on a pinboard  And a rubber band around them  How does the rubber band look when.
Lecture 3: Parallel Algorithm Design
algorithms and data structures
Brute-Force Triangulation
Advanced Algorithms Piyush Kumar (Lecture 12: Parallel Algorithms) Welcome to COT5405 Courtesy Baker 05.
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
The Divide-and-Conquer Strategy
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
CS4413 Divide-and-Conquer
The Divide-and-Conquer Strategy
Introduction to Algorithms Rabie A. Ramadan rabieramadan.org 6 Ack : Carola Wenk nad Dr. Thomas Ottmann tutorials.
Convex Hulls May Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
Computational Geometry
8/29/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Spring 2006 Convex Hulls Carola Wenk.
Advanced Topics in Algorithms and Data Structures Lecture pg 1 Recursion.
CS38 Introduction to Algorithms Lecture 7 April 22, 2014.
Advanced Topics in Algorithms and Data Structures Lecture 6.1 – pg 1 An overview of lecture 6 A parallel search algorithm A parallel merging algorithm.
Parallel Prefix Computation Advanced Algorithms & Data Structures Lecture Theme 14 Prof. Dr. Th. Ottmann Summer Semester 2006.
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
CS Section 600 CS Section 002 Dr. Angela Guercio Spring 2010.
Insertion sort, Merge sort COMP171 Fall Sorting I / Slide 2 Insertion sort 1) Initially p = 1 2) Let the first p elements be sorted. 3) Insert the.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Divide-and-Conquer1 7 2  9 4   2  2 79  4   72  29  94  4.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
Divide-and-Conquer1 7 2  9 4   2  2 79  4   72  29  94  4.
Advanced Topics in Algorithms and Data Structures 1 Lecture 4 : Accelerated Cascading and Parallel List Ranking We will first discuss a technique called.
Chapter 4: Divide and Conquer The Design and Analysis of Algorithms.
Accelerated Cascading Advanced Algorithms & Data Structures Lecture Theme 16 Prof. Dr. Th. Ottmann Summer Semester 2006.
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
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.
1 -1 Chapter 1 Introduction Why to study algorithms? Sorting problem: To sort a set of elements into increasing or decreasing order. 11, 7, 14,
Advanced Topics in Algorithms and Data Structures Page 1 An overview of lecture 3 A simple parallel algorithm for computing parallel prefix. A parallel.
External Memory Algorithms Kamesh Munagala. External Memory Model Aggrawal and Vitter, 1988.
The Complexity of Algorithms and the Lower Bounds of Problems
Advanced Topics in Algorithms and Data Structures Lecture 8.2 page 1 Some tools Our circuit C will consist of T ( n ) levels. For each time step of the.
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
Simulating a CRCW algorithm with an EREW algorithm Lecture 4 Efficient Parallel Algorithms COMP308.
Divide-and-Conquer 7 2  9 4   2   4   7
Computational Geometry (35/33) Line Segments and cross-product Segment intersection and Sweep Line Convex Hull and Graham’s Scan, Jarvis’s march Divide-and-Conquer.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 19: Searching and Sorting Algorithms.
5 -1 Chapter 5 The Divide-and-Conquer Strategy A simple example finding the maximum of a set S of n numbers.
Divide-and-Conquer1 7 2  9 4   2  2 79  4   72  29  94  4.
Complexity of algorithms Algorithms can be classified by the amount of time they need to complete compared to their input size. There is a wide variety:
Lecture 2 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
CSC 211 Data Structures Lecture 13
Searching and Sorting Recursion, Merge-sort, Divide & Conquer, Bucket sort, Radix sort Lecture 5.
Convex Hull. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day.
Lecture 7 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
1 Ch. 2: Getting Started. 2 About this lecture Study a few simple algorithms for sorting – Insertion Sort – Selection Sort (Exercise) – Merge Sort Show.
1 Ch.19 Divide and Conquer. 2 BIRD’S-EYE VIEW Divide and conquer algorithms Decompose a problem instance into several smaller independent instances May.
Lecture 2 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
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.
11 -1 Chapter 12 On-Line Algorithms On-Line Algorithms On-line algorithms are used to solve on-line problems. The disk scheduling problem The requests.
Common Intersection of Half-Planes in R 2 2 PROBLEM (Common Intersection of half- planes in R 2 ) Given n half-planes H 1, H 2,..., H n in R 2 compute.
PRAM and Parallel Computing
Lecture 3: Parallel Algorithm Design
CSCE350 Algorithms and Data Structure
Algorithm design techniques Dr. M. Gavrilova
Computational Geometry Capter:1-2.1
DIVIDE AND CONQUER.
Presentation transcript:

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 1 An overview of lecture 7 An optimal parallel algorithm for the 2D convex hull problem, Some applications of the 2D convex hull algorithm.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 2 The convex hull problem Input: A set S = ( p 1, p 2,…, p n ) of n points on the plane. Output: The convex hull CH ( S ) of these n points. The convex hull is the smallest convex polygon containing all the n points. Each vertex of CH ( S ) is called an extreme point and the convex hull is output as a list of the extreme points.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 3 The convex hull problem Let p max and p min be two points in the set S with the maximum and minimum x coordinates. Then p max and p min are convex hull vertices. The line segment divides the convex hull into two parts, upper hull and lower hull.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 4 The convex hull problem We use the notation x ( p ) and y ( p ) to denote the x and y coordinates of a point p. Given a line L specified by the equation y = ax + b, and a point q =( ,  ), We say, q is below L if  < a  + b. We also say, q is above L if  > a  + b.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 5 The convex hull problem Given the set S of n points, we can find p max and p min in O ( n ) time. We can find all the points above and below also in O ( n ) time. We can compute the convex hull of all the points above and call this as UH ( S ). Similarly, we can compute the convex hull of all the points below and call this as LH ( S ). At the end, we can stitch these two hulls together at the two points p max and p min.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 6 Sequential complexity The convex hull of n planar points can be constructed in  ( n log n ) time sequentially. The lower bound can be proved by showing that the convex hull problem is equivalent to sorting. We need to design an O ( n log n ) work algorithm to achieve optimality.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 7 Computing the upper hull We will discuss an algorithm for computing the upper hull of the set S. The algorithm for computing the lower hull is exactly the same. A line L is tangent to a convex polygon P if all the vertices of P are on the same side of L.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 8 A divide-and-conquer algorithm We discuss a divide-and-conquer algorithm for computing the upper hull. There are two phases, top-down and bottom-up. First, we sort the points according to x - coordinates.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 9 A divide-and-conquer algorithm In the top-down phase, we divide the point set recursively into two parts and compute the convex hull when the size of each subproblem is small. In the bottom-up phase, we merge these hulls pairwise to get the upper hull. The strategy is exactly similar to the sequential algorithm for merge sort.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 10 A divide-and-conquer algorithm

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 11 Merging two upper hulls The main problem in combining two upper hulls to form a single upper hull is to compute a common tangent to the two hulls. To achieve O ( n log n ) work, we need to complete the merging of all the upper hulls at a level of the tree in O (1) time.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 12 Merging two upper hulls We consider two upper hulls UH ( S 1 ) and UH ( S 2 ). Our aim is to find a common tangent to these two upper hulls. We first find a tangent to UH ( S 2 ) from a point r i on UH ( S 1 ).

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 13 Merging two upper hulls Suppose the line is the tangent to UH ( S 2 ) from r i. Suppose q l is another vertex of UH ( S 2 ). Given the line r i q l, we first try to locate.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 14 Merging two upper hulls In O (1) time, we can say whether is above or below the line. If the neighboring vertices q l -1 and q l +1 of q l are on either side of, then is above q l.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 15 Parallel search algorithm For each of the p + 1 parts of the array, a processor checks whether y < x l, where x l is the last element of the part. If y x l, the subarray to the left of x l can be rejected. In each iteration we identify only one subarray for further search.

Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 16 Complexity of parallel searching We need to analyze what is the complexity of reducing the size of the array to p. At the first iteration, we are reducing the size of the array from n to n / p. Suppose, the size reduces to p after k iterations. Hence,, which implies n = p k +1.. We need the CREW PRAM model.