Algorithm 1. (Convex Hull) - Pseudo code - Input. A set of points in the plane. Output. A list containing the vertices of Conv ( P). 1. Sort the points.

Slides:



Advertisements
Similar presentations
Polygon Triangulation
Advertisements

Relations Relations on a Set. Properties of Relations.
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
1/13/15CMPS 3130/6130: Computational Geometry1 CMPS 3130/6130: Computational Geometry Spring 2015 Convex Hulls Carola Wenk.
Brute-Force Triangulation
Computing Convex Hulls CLRS 33.3
Convex Hull obstacle start end Convex Hull Convex Hull
CS16: Introduction to Data Structures & Algorithms
One of the most important problems is Computational Geometry is to find an efficient way to decide, given a subdivision of E n and a point P, in which.
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.
The Divide-and-Conquer Strategy
Ruslana Mys Delaunay Triangulation Delaunay Triangulation (DT)  Introduction  Delaunay-Voronoi based method  Algorithms to compute the convex hull 
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,
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.
5/17/2015 1:32 AMConvex Hull1 obstacle start end.
2. Voronoi Diagram 2.1 Definiton Given a finite set S of points in the plane , each point X of  defines a subset S X of S consisting of the points of.
Convex Hulls Computational Geometry, WS 2006/07 Lecture 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
3. Delaunay triangulation
6/2/ :35 AMIncremental Convex Hull1 q w u e zt.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
Half-Space Intersections
1.4 Exercises (cont.) Definiton: A set S of points is said to be affinely (convex) independent if no point of S is an affine combination of the others.
5 - 1 § 5 The Divide-and-Conquer Strategy e.g. find the maximum of a set S of n numbers.
Algorithm3. (3-dim) Assumptions Points are ordered in a sequence increasingly with respect to the x coordinate. Points having the same x coordinate are.
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
Lecture 6 Divide and Conquer for Nearest Neighbor Problem Shang-Hua Teng.
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
Approximation Algorithms
Brute-Force Triangulation
Induction and recursion
Geometric Algorithms1 segment intersection orientation point inclusion simple closed path.
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
A brief and sketchy intro to 3D Convex Hulls Rodrigo Silveira GEOC 2010/11 - Q2.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
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.
Graphing Techniques: Transformations
UNC Chapel Hill M. C. Lin Linear Programming Reading: Chapter 4 of the Textbook Driving Applications –Casting/Metal Molding –Collision Detection Randomized.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
Line Arrangement Chapter 6. Line Arrangement Problem: Given a set L of n lines in the plane, compute their arrangement which is a planar subdivision.
5 -1 Chapter 5 The Divide-and-Conquer Strategy A simple example finding the maximum of a set S of n numbers.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
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 9COMPSCI.220.FS.T Lower Bound for Sorting Complexity Each algorithm that sorts by comparing only pairs of elements must use at least 
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin.
Lecture # 6 1 Advance Analysis of Algorithms. Divide-and-Conquer Divide the problem into a number of subproblems Similar sub-problems of smaller size.
Convex Hulls Guo Qi, Chen Zhenghai, Wang Guanhua, Shen Shiqi, Himeshi De Silva.
Polygon Triangulation
Computational Geometry
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Lecture 3: Parallel Algorithm Design
Introduction to Polygons
Convex Hull.
Algorithm design techniques Dr. M. Gavrilova
Merge Sort Merge sort is a recursive algorithm for sorting that decomposes the large problem.
Divide and Conquer Mergesort Quicksort Binary Search Selection
Convex Hull obstacle start end 11/21/2018 4:05 AM Convex Hull
Computational Geometry Capter:1-2.1
I. The Problem of Molding
Convex Hull 1/1/ :28 AM Convex Hull obstacle start end.
CMPS 3130/6130: Computational Geometry Spring 2017
Computational Geometry
CMPS 3120: Computational Geometry Spring 2013
Convex Hull obstacle start end 4/30/2019 5:21 PM Convex Hull
Presentation transcript:

Algorithm 1. (Convex Hull) - Pseudo code - Input. A set of points in the plane. Output. A list containing the vertices of Conv ( P). 1. Sort the points by (x,y)-coordinate, resulting in a sequence p 1,p 2, …,p n. 2. Put the points p 1 and p 2 in the list L upper with p 1 in the first position. 3. For i  3 to n 4. do Append p i to L upper 5. while L upper contains more than two points and the last three points in L upper do not make a right turn 6. do delete the middle of the last three points from L upper the same in the opposite direction: p n to p 1: Make L lower 12. Remove the first and the last point from L upper. 13. Append L upper and L lower to make L. 14. return L.

Algorithm 1, Step 5: pipi pipi X X X pipi X X X pipi

Left – Right decision Degeneracy O, O,  The complexity of Algorithm 1 is O(nlogn) Exercise 8= Implementation of Algorithm 1 XPiXPi YPiYPi X P i-2 Y P i-2 X P i-1 Y P i > = < 0 XPiXPi X P i-2 X P i-1 = - XPiXPi - Y P i-2 - YPiYPi YPiYPi Y P i-1 - Algorithm 1 (cont.)

Algorithm2. (2-dim) Assumption. The points are ordered in a sequence increasingly with respect to the x coordinate. The vertices having the same x coordinate are ordered with respect to the y coordinate middle ones omitted. The algorithm is incremental (inductive), at the step k+1 the (k+1) st point A k+1, as well as the convex hull of the previous points, are used to produce the convex hull C k of the first k+1-points. (Exercise 9 = Implementation of algorithm 2)

Storing data. -Edges (oriented): origin and the pointer to the “next” edge. -Vertices: a point A and the edge AB originated at A. Algorithm2. (2-dim) Step k Find the the two vertices of C k which divide the “visible” and the “invisible” part of C k with respect to (“from”) the point A k+1.

B0B0 B1B1 BrBr B -s A k+1 [A k+1 B m-1, A k+1 B m ] = B m-1x - A k+1x B m-1y - A k+1y B m x - A k+1x B m y - A k+1y Algorithm2. (2-dim), Step k+1(cont.)

Denote B 0 =A k (A k is the vertex prior to A k+1 ). The vertices B m are obtained recursively so that B m-1 B m is the oriented edge of C k and that the 2X2 determinant [A k+1 B m-1, A k+1 B m ] is not positive. In another words, the vertices B m are in the visible part of C k. Let B r be the last one in the sequence having negative determinant, i.e. such that the determinant corresponding to B r and the next vertex of C k is not negative. Hence, the vertex B r is one of the two vertices we are looking for. Similarly, starting with B 0 we can inductively obtain a sequence of the vertices B m-1 with negative indices having the same property. Let B -s be the last vertex in this sequence. Algorithm2. (2-dim), Step k+1(cont.)

2. Vertices B -s + 1,…, B r - 1 are deleted together with the corresponding edges. Vertex A k+1 is added together with the edges B -s A k+1 and A k+1 B r. B r B -s A k+1 B r+1 Algorithm2. (2-dim), Step k+1(cont.) B -s A k+1 B r+1 B r

3. If there is the vertex B -s -1 i.e if B -s -1, B -s and A k+1 are collinear, the middle point B -s is omitted and the edges B -s -1 B -s and B -s A k+1 are substituted with B -s -1 A k+1.The same procedure is performed with the vertex B r.. Algorithm2. (2-dim), Step k+1(cont.)