Convex Hull. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day.

Slides:



Advertisements
Similar presentations
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.
Advertisements

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.
Advanced Algorithms Piyush Kumar (Lecture 12: Parallel Algorithms) Welcome to COT5405 Courtesy Baker 05.
Computing Convex Hulls CLRS 33.3
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.
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
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.
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,
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
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.
Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.
Advanced Algorithm Design and Analysis (Lecture 10) SW5 fall 2004 Simonas Šaltenis E1-215b
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.
1 Today’s Material Computational Geometry Problems –Closest Pair Problem –Convex Hull Jarvis’s March, Graham’s scan –Farthest Point Problem.
Algorithms and Data Structures Lecture 13. Agenda: Plane Geometry: algorithms on polygons - Verification if point belongs to a polygon - Convex hull.
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]
ADA: 16. CG Topics1 Objective o an examination of four important CG topics o just a taster of a very large research area Algorithm Design and Analysis.
Convex Hulls Computational Geometry, WS 2006/07 Lecture 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
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
5 - 1 § 5 The Divide-and-Conquer Strategy e.g. find the maximum of a set S of n numbers.
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 2 Chapter 2: Polygon Partitioning.
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
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.
5 -1 Chapter 5 The Divide-and-Conquer Strategy A simple example finding the maximum of a set S of n numbers.
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.
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.
CMPS 3120: Computational Geometry Spring 2013
Computational Geometry 2D Convex Hulls
A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R. Otherwise, it is called concave.
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.
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
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 Guo Qi, Chen Zhenghai, Wang Guanhua, Shen Shiqi, Himeshi De Silva.
MA/CSSE 473 Day 16 Answers to your questions Divide and Conquer
Convex Hull.
Algorithm design techniques Dr. M. Gavrilova
Convex Hull obstacle start end 11/21/2018 4:05 AM Convex Hull
Computational Geometry (35/33)
Convex Sets & Concave Sets
Convex Hull 1/1/ :28 AM Convex Hull obstacle start end.
CHAPTER 33 Computational Geometry
CMPS 3130/6130: Computational Geometry Spring 2017
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.
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
Computational Geometry
DIVIDE AND CONQUER.
Presentation transcript:

Convex Hull

University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day mammals, including reindeer, polar bears, giraffes and elephants. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day mammals, including reindeer, polar bears, giraffes and elephants. They discovered that the animals had almost exactly 21% more body mass than the minimum skeletal 'skin and bone' wrap volume, and applied this to a giant Brachiosaur skeleton in Berlin's Museum für Naturkunde. They discovered that the animals had almost exactly 21% more body mass than the minimum skeletal 'skin and bone' wrap volume, and applied this to a giant Brachiosaur skeleton in Berlin's Museum für Naturkunde. --ScienceDaily (June 5, 2012) --ScienceDaily (June 5, 2012)

Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R. Otherwise, it is called concave. A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R. Otherwise, it is called concave. Convex p q R 1 p q R 2 Concave

Convex Hull The convex hull CH(Q) of a set Q is the smallest convex region that contains Q. When Q is finite, its convex hull is the unique convex polygon whose vertices are from Q and that contains all points of Q. The convex hull CH(Q) of a set Q is the smallest convex region that contains Q. When Q is finite, its convex hull is the unique convex polygon whose vertices are from Q and that contains all points of Q. Rubber band

The Convex Hull Problem Input: a set P = {p 1, p 2, …, p n } of points. Output: a list of vertices of CH(P) in counterclockwise order. Example: CH(P)= { p 2, p 9, p 5, p 7, p 10, p 8 } 8 p p p p p p p p p p

Graham Scan – incremental approach – incremental approach (similar to selection sort/insertion sort) p 0 p p p p p p p p p p p

Graham Scan Steps: Sort the angles Sort the angles form a convex hull of 1 st three points, add them to a stack form a convex hull of 1 st three points, add them to a stack push/pop the rest of the point on the list based on we are make a right turn or left turn push/pop the rest of the point on the list based on we are make a right turn or left turn

Polar Angle p polar angle x y q r

Stack Initialization p p p p p p p p p p p p p p p S 0 1 2

p p p p p p p p pp p p p p p S 0 1 3

p p p p p p p p pp p p p p p S 0 1 4

p p p p p p p p pp p p p p p S p 5

p p p p p p p p pp p p p p p S p 6

p p p p p p p p pp p p p p p S p 6 p 7 p 8

p p p p p p p p pp p p p p p S p 6 p 7

p p p p p p p p pp p p p p p S p 6 p 9 p 10

p p p p p p p p pp p p p p p S p 6 p 9 p

Finish p p p p p p p p pp p p p p p S p 6 p 9 p

Running time The running time of Graham’s Scan is O(n lg n).

Jarvis march Gift wrapping Gift wrappingalgorithm How do we find the How do we find theangle? Complexity is O(hn) Complexity is O(hn)

Convex Hull - Divide and Conquer Algorithm: Algorithm: Find a point with a median x coordinate (time: O(n)) Find a point with a median x coordinate (time: O(n)) Compute the convex hull of each half (recursive execution) Compute the convex hull of each half (recursive execution) Combine the two convex hulls by finding common tangents. Combine the two convex hulls by finding common tangents.

Convex Hull - Divide and Conquer If n ≤ 3, compute the hull by brute force If n ≤ 3, compute the hull by brute force o.w. divide points into A, B, where x i <x j,  p i  A, p j  B. o.w. divide points into A, B, where x i <x j,  p i  A, p j  B. Recursively compute HA = Hull(A) and HB = Hull(B). Recursively compute HA = Hull(A) and HB = Hull(B). Merge the two hulls by computing the upper and lower tangents for HA and HB and discarding all the points lying between these two tangents. Merge the two hulls by computing the upper and lower tangents for HA and HB and discarding all the points lying between these two tangents.

Convex Hull - Combine Finding the Lower Tangent LowerTangent (HA ; HB ) : Let a be the rightmost point of HA. Let a be the rightmost point of HA. Let b be the leftmost point of HB. Let b be the leftmost point of HB. While ab is not a lower tangent for HA and HB do While ab is not a lower tangent for HA and HB do While ab is not a lower tangent to HA do a = a - 1 (move a clockwise). While ab is not a lower tangent to HA do a = a - 1 (move a clockwise). While ab is not a lower tangent to HB do b = b + 1 (move b counterclockwise). While ab is not a lower tangent to HB do b = b + 1 (move b counterclockwise). Return ab. Return ab.

Combine (a,b)=(right most, left most) (a,b)=(right most, left most) … a b

Complexity Complexity: O(nlogn) Complexity: O(nlogn)

Quick Hull Quick hull – based on the idea of quick sort Quick hull – based on the idea of quick sort S

Quick Hull Partition Partition l r L S (1) S (2)

Quick Hull l r

l r L L1L1 L2L2 S (1,1) S (1,2) eliminated h

Quick Hull L l r L1L1 L2L2 S (1,2,2) h S (1,2)

Quick Hull Complexity Complexity T(n) = O(n 2 ) worst case T(n) = O(n 2 ) worst case T(n) = O(nlogn) average and best case T(n) = O(nlogn) average and best case

Graphs