Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.

Slides:



Advertisements
Similar presentations
Computational Geometry - Part II Mohammed Nadeem Ahmed Raghavendra Kyatham.
Advertisements

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.
CS Divide and Conquer/Recurrence Relations1 Divide and Conquer.
Lecture 3: Parallel Algorithm Design
Jarvis March Graham Scan Chan’s Algorithm
1/13/15CMPS 3130/6130: Computational Geometry1 CMPS 3130/6130: Computational Geometry Spring 2015 Convex Hulls Carola Wenk.
algorithms and data structures
Convex Hull obstacle start end Convex Hull Convex Hull
CS16: Introduction to Data Structures & Algorithms
C o m p u t i n g C O N V E X H U L L S by Kok Lim Low 10 Nov 1998 COMP Presentation.
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
Ruslana Mys Delaunay Triangulation Delaunay Triangulation (DT)  Introduction  Delaunay-Voronoi based method  Algorithms to compute the convex hull 
Theory of Algorithms: Divide and Conquer
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.
Classes of Polygons Planar polygons Non-planar polygons Simple
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,
1 Convex Hull in Two Dimensions Jyun-Ming Chen Refs: deBerg et al. (Chap. 1) O’Rourke (Chap. 3)
Computational Geometry
8/29/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Spring 2006 Convex Hulls Carola Wenk.
Polygons and the convex hull Prof. Noah Snavely CS1114
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.
Feb Polygon Triangulation Shmuel Wimer Bar Ilan Univ., School of Engineering.
1 Today’s Material Computational Geometry Problems –Closest Pair Problem –Convex Hull Jarvis’s March, Graham’s scan –Farthest Point Problem.
5/17/2015 1:32 AMConvex Hull1 obstacle start end.
What does that mean? To get the taste we will just look only at some sample problems... [Adapted from S.Suri]
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.
Computational Geometry Overview from Cormen, et al. Chapter 33
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04.
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
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.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 2 Chapter 2: Polygon Partitioning.
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
Computational Geometry Convex Hulls Robust Geometric Primitives Degeneracy and Stability Nick Pilkington.
Convex Hull. What is the Convex Hull? Imagine a set of points on a board with a nail hammered into each point. Now stretch a rubber band over all the.
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.
Theory of Algorithms: Divide and Conquer James Gain and Edwin Blake {jgain | Department of Computer Science University of Cape Town.
C o m p u t i n g C O N V E X H U L L S. Presentation Outline 2D Convex Hulls –Definitions and Properties –Approaches: Brute Force Gift Wrapping QuickHull.
Convex Hull of a 2D Simple Polyline Presenter: Yung-Hsing Peng Date:
Fundamental Data Structures and Algorithms Klaus Sutner April 27, 2004 Computational Geometry.
Fundamental Data Structures and Algorithms Margaret Reid-Miller 27 April 2004 Computational Geometry.
Convex Hull. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day.
Computational Geometry 2D Convex Hulls
COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin.
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.
Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms.
CS6234 Advanced Algorithms - Convex hull. Terminologies – ◦ Convex hull of a set Q of points is the smallest convex polygon P for which each point in.
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.
Convex hulls in 3D Maciej Kot. Finding convex hull Given a set of points, find a convex hull that contains all of them and is minimal.
Convex Hulls Guo Qi, Chen Zhenghai, Wang Guanhua, Shen Shiqi, Himeshi De Silva.
Polygon Triangulation
Lesson 10.6 – Secants, Tangents, and Angle Measure
Convex Hull.
CSCE350 Algorithms and Data Structure
Algorithm design techniques Dr. M. Gavrilova
Convex Hull obstacle start end 11/21/2018 4:05 AM Convex Hull
Computational Geometry (35/33)
Polygon Triangulation
Geometry.
Convex Sets & Concave Sets
CHAPTER 33 Computational Geometry
CMPS 3130/6130: Computational Geometry Spring 2017
Divide-and-Conquer The most-well known algorithm design strategy:
CMPS 3120: Computational Geometry Spring 2013
Convex Hull obstacle start end 4/30/2019 5:21 PM Convex Hull
Introduction to Algorithms
Computational Geometry Algorithms
Geometry.
Presentation transcript:

Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute ForceO(n 4 )[Anon, the dark ages] Gift WrappingO(nh)[Chand & Kapur, 1970] Graham ScanO(n log n)[Graham, 1972] Jarvis MarchO(nh)[Jarvis, 1973] QuickHullO(nh)[Eddy, 1977], [Bykat, 1978] Divide-and-ConquerO(n log n)[Preparata & Hong, 1977] Monotone ChainO(n log n)[Andrew, 1979] IncrementalO(n log n)[Kallay, 1984] Marriage-before-ConquestO(n log h)[Kirkpatrick & Seidel, 1986]

What is a convex hull ● For a given series of points, the convex hull is the smallest convex set which contains the points. ● It is like a string that wraps around the points. It only touches the outermost points

● Find all lines through two points with all points on one side of the line ● Find all lines through the points (n 2 ) (line AB) ● For AB, find all line segments CD (n 2 ) such that the line AB does not intersect the line segment CD Brute Force Algorithm

Some basic math functions ● Starting with Descartes and Fermat, we know that the area of a parallelogram can be computed by taking the magnitude of the cross product of 2 edge vectors ● The area of a triangle will be half that of a parallelogram v w v w

Computing the area of a triangle ● Area = 1212 v x w v w V0V0 V2V2 V1V1 ● For a triangle defined in 3D space, this produces the following matrix x1x2x3x1x2x3 y1y2y3y1y2y3 z1z2z3z1z2z3

● For a triangle defined in 2D space, this produces the following matrix 1 x1x2x3x1x2x3 y1y2y3y1y2y3 1 1 Computing the area of a triangle ● To solve this matrix, we take the cross product of its components v w x 1,y 1 x 3,y 3 x 2,y 2 Area = ((x 2 y 1 – x 1 y 2 ) + (x 3 y 2 – x 2 y 3 ) + (x 1 y 3 – x 3 y 1 )) / 2

● There is an interesting side effect by using this method to compute the area of a triangle ● The area calculation is signed ● If the area is positive, then that means the points V 1, V 2, V 3 were defined in a counter-clockwise direction (around the triangle) ● If the area is negative, then that means the points V 1, V 2, V 3 were defined in a clockwise direction (around the triangle) ● Website demonstration Determining the order of the points

● The algorithm is as follows ● Start at an extreme point (min or max, x or y component) ● Scan through all of the points and find the point that gives you the next most counter-clockwise point. ● By calculating the area of triangles formed by these points, we can determine the ordering of points and, as a result, compute the next point (in a counter-clockwise direction) on the convex hull. ● O (nh) ● n – number of points ● h – number of points in hull ● Has best performance when convex hull is a triangle ● Has worst performance when all points lie on the hull Gift Wrap Algorithm

● The algorithm is as follows ● Identify a pivot point (min or max, x or y component) ● Sort the points in order of increasing angle with the pivot. ● Connect the sorted points (star shaped polygon) ● March around hull. ● Add edges when a left turn is made ● Remove edges when a right turn is made ● O (n log n) ● n – number of points ● Performs better than Gift wrap algorithm when there are more points on the hull ● Sorting time can have an impact on this algorithm Graham's Scan

● Similar to quick sort. Recursive and divides points. ● The algorithm is as follows ● Identify 2 points on the hull (called a chord AB) ● Left most and right most or highest and lowest ● Create “partition” ● Find the farthest point from AB (Called C) ● All points within this triangle (ABC) cannot be on the convex hull. ● Place in set called S0 ● Place points outside AC in S1 and outside BC in S2 ● Recuse on partitions AC with S1 and on parition BC with S2 ● O (nh) ● Creating S0 can remove a large number of points. S0 must be large. ● Works very well on random data. Quick Hull

● Similar to merge sort ● The algorithm is as follows: ● Sort the points ● Recursively group points until brute force hull computation is O(1) ● Merge Adjacent hulls together ● To merge hulls: ● Choose rightmost point of left hull and leftmost point of right hull ● Traverse points on left hull in counter-clockwise direction and on rightmost hull in clockwise direction. ● Find vector which is the upper tangent of both hulls ● Repeat (in reverse) for lower tangent ● Because the merge is O(n) the total time is O(n log n) ● This algorithm can be used in conjunction with other algorithms to provide optimal performance. Divide and Conquer