Computational Geometry 2D Convex Hulls

Size: px
Start display at page:

Download "Computational Geometry 2D Convex Hulls"

Transcription

1 Computational Geometry 2D Convex Hulls Joseph S. B. Mitchell Stony Brook University Chapter 2: Devadoss-O Rourke

2 Convexity p p Set X is convex if p,q X pq X q q convex non-convex Point p X is an extreme point if there exists a line (hyperplane) through p such that all other points of X lie strictly to one side Extreme points in red q r p 2

3 Convex Hull 3

4 Convex Hull, Extreme Points 4

5 Convex Hull: Equivalent Def Convex combination of points: 5

6 Convex Hull: Equivalent Defs 6

7 Equivalent Definitions of Convex Hull, CH(X) {all convex combinations of d+1 points of X } [Caratheodory s Thm] (in any dimension d) T X H X T, T convex H, Hhalfspace Set-theoretic smallest convex set containing X. In 2D: min-area (or min-perimeter) enclosing convex body containing X In 2D: abc a, b, c X Devadoss-O Rourke Def 7

8 Convex Hull in 2D Fact: If X=S is a finite set of points in 2D, then CH(X) is a convex polygon whose vertices (extreme points) are points of S. 8

9 Fundamental Algorithmic Problem: 2D Convex Hulls Input: n points S = (p 1, p 2,, p n ) p 7 p 2 p 4 More generally: CH(polygons) p 8 p 3 p 5 p 1 p 6 p 9 Output: (9,6,4,2,7,8,5) Output: A boundary representation, e.g., ordered list of vertices (extreme points), of the convex hull, CH(S), of S (convex polygon) 9

10 Convex Hull Problem in 2D 10

11 Computational Complexity Function T(n) is O(f(n)) if there exists a constant C such that, for sufficiently large n, T(n) < C f(n) 11

12 Comparing O(n), O(n log n), O(n 2 ) n n log n n² ³ Function T(n) is O(f(n)) if there exists a constant C such that, for sufficiently large n, T(n) < C f(n) Interactive Processing n log n algorithms n² algorithms n = 1000 yes? n = ? no 12

13 2D Convex Hull Algorithms O(n 4 ) simple, brute force (but finite!) O(n 3 ) still simple, brute force O(n 2 ) incremental algorithm [DO] Section 2.2 O(nh) simple, output-sensitive h = output size (# vertices) O(n log n) worst-case optimal (as fcn of n) O(n log h) ultimate time bound (as fcn of n,h) Randomized, expected O(n log n) 13

14 Lower Bound Lower bound: (n log n) [DO] Section 2.5 From SORTING: y= x 2 (x i,x i 2 ) Note: Even if the output of CH is not required to be an ordered list of vertices (e.g., just the # of vertices), (n log n) holds x i As function of n and h: (n log h) holds 14

15 [DO] Section 2.5 Lower Bound computing the ordered convex hull of n points in the plane. 15

16 [DO] Section 2.5 Lower Bound computing the ordered convex hull of n points in the plane. An even stronger statement is true: 16

17 Primitive Computation Left tests: sign of a cross product (determinant), which determines the orientation of 3 points Time O(1) ( constant ) Left( a, b, c ) = TRUE ab ac > 0 a c b c is left of ab 17

18 SuperStupidCH: O(n 4 ) Fact: If s pqr, then s is not a vertex of CH(S) q p q p r p,q O(n 3 ) s p,q,r: If s pqr then mark s as NON-vertex s p r O(n) Output: Vertices of CH(S) Can sort (O(n log n ) to get ordered 18

19 StupidCH: O(n 3 ) Fact: If all points of S lie strictly to one side of the line pq or lie in between p and q, then pq is an edge of CH(S). p q p O(n 2 ) r p,q: If r red then mark pq as NON-edge (ccw) Output: Edges of CH(S) O(n) Can sort (O(n log n ) to get ordered 19 Caution!! Numerical errors require care to avoid crash/infinite loop! q r p Applet by Snoeyink

20 Incremental Algorithm [DO] Section

21 Incremental Algorithm Sort points by x-coordinate O(n log n) Build CH(X), adding pts left to right 21

22 Incremental Algorithm 22

23 Incremental Algorithm 23

24 O(nh) : Gift-Wrapping Idea: Use one edge to help find the next edge. Jarvis March r O(n) per step h steps q Total: O(nh) Output: Vertices of CH(S) Demo applet of Jarvis march p Key observation: Output-sensitive! 24

25 [DO] Section 2.4 Gift-Wrapping 25

26 [DO] Section 2.4 Gift-Wrapping 26

27 O(n log n) : Graham Scan Idea: Sorting helps! Start with v lowest (min-y), a known vertex O(n) Sort S by angle about v lowest Graham scan: O(n log n) O(n) Maintain a stack representing (left-turning) CH so far If p i is left of last edge of stack, then PUSH Else, POP stack until it is left, charging work to popped points Demo applet v lowest CH so far 28

28 [DO] Section 2.4 Graham Scan Red points form right turn, so are discarded 29

29 [DO] Section 2.4 Graham Scan 30

30 Sorted points: Graham Scan [O Rourke, Chapter 3] 31

31 [O Rourke, Chapter 3] 32

32 [O Rourke, Chapter 3] Stack History 33

33 O(n log n) : Divide and Conquer Split S into S left and S right, sizes n/2 Recursively compute CH(S left ), CH(S right ) Merge the two hulls by finding upper/lower bridges in O(n), by wobbly stick Time O(n) Time 2T(n/2) Time O(n) S left S right Time: T(n) 2T(n/2) + O(n) T(n) = O(n log n) Demo applet 34

34 Divide and Conquer [DO] Section

35 Divide and Conquer [DO] Section

36 Divide and Conquer [DO] Section

37 QuickHull QuickHull(a,b,S) to compute upperhull(s) If S=, return () Else return (QuickHull(a,c,A), c, QuickHull(c,b,B)) c c = point furthest from ab Discard points in abc Worst-case: O(n 2 ) Avg: O(n) Works well in higher dimensions too! Qhull website a B A S Qhull, Brad Barber (used within MATLAB) b 38

38 QuickHull Applet (programmed by Jeff So) Applet (by Lambert) When is it bad? (see hw2) If no points are discarded (in abc), at each iteration, and The balance may be very lop-sided (between sets A and B; in fact, one set could be empty, at every iteration!) 39

39 QuickHull [David Mount lecture notes, Lecture 3] 40

40 O(n log n) : Incremental Construction Add points in the order given: v 1,v 2,,v n Maintain current Q i = CH(v 1,v 2,,v i ) Add v i+1 : If v i+1 Q i, do nothing Else insert v i+1 by finding tangencies, updating the hull Point location test: O(log n) AMS 545 / CSE 555 Binary search: O(log n) Worst-case cost of insertion: O(log n) But, uses complex data structures 41

41 O(n log n) : Randomized Incremental Add points in random order Keep current Q i = CH(v 1,v 2,,v i ) AMS 545 / CSE 555 Add v i+1 : If v i+1 Q i, do nothing Else insert v i+1 by finding tangencies, updating the hull Expected cost of insertion: O(log n) 42

42 Each uninserted v j Q i (j>i+1) points to the bucket (cone) containing it; each cone points to the list of uninserted v j Q i within it (with its conflict edge) Add v i+1 Q i : Start from conflict edge e, and walk cw/ccw to establish new tangencies from v i+1, charging walk AMS to deleted vertices 545 / CSE 555 Rebucket points in affected cones (update lists for each bucket) Total work: O(n) + rebucketing work e E(rebucket cost for v j at step i) = O(1) P(rebucket) O(1) (2/i ) = O(1/i ) v i+1 v j E(total rebucket cost for v j ) = O(1/i ) = O(log n) Total expected work = O(n log n) Backwards Analysis: v j was just rebucketed iff the last point inserted was one of the 2 endpoints of the (current) 43 conflict edge, e, for v j

43 Output-Sensitive: O(n log h) The ultimate convex hull (in 2D) Marriage before Conquest : O(n log h) Lower bound (n log h) AMS [Kirkpatrick 545 & Seidel 86] / CSE 555 So, O(n log h) is BEST Simpler [Chan 95] 2 Ideas: h = output size POSSIBLE, as function of n and h!! Break point set S into groups of appropriate size m (ideally, m = h) Search for the right value of m ( =h, which we do not know in advance) by repeated squaring 44

44 Chan s Algorithm Break S into n/m groups, each of size m Find CH of each group (using, e.g., Graham scan): O(m log m) per group, so total O((n/m) m log m) = O(n log m) AMS 545 / CSE 555 At each gift-wrap step, when pivoting around vertex v Gift-wrap the n/m hulls to get overall CH: find the tangency point (binary search, O(log m)) to each group CH pick the smallest angle among the n/m tangencies: O( h (n/m) log m) Hope: m=h Try m = 4, 16, 256, 65536, = O( h (n/h) log h) = O(n log h) = O(n log h) O(n ( log (2 21 ) + log (2 22 ) + log (2 23 ) + log (2 2 log (log (h)) ) = O(n ( log (log (h)) )) = O(n (2 log h)) = O(n log h) v v 45

45 CH of Simple Chains/Polygons Input: ordered list of points that form a simple chain/cycle Importance of simplicity (noncrossing, Jordan curve) as a means of sorting (vs. sorting in x, y) Melkman s Algorithm: O(n) (vs. O(n log n) or O(n log h)) 1 2 n 46

46 Melkman s Algorithm Keep hull in DEQUE: < v b,v b+1,,v t-1,v t =v b > While Left(v b,v b+1,v i ) and Left(v t-1,v t,v i ) i i+1 Remove v b+1, v b+2, and v t-1, v t-2, v t until convexity restored v v t-1 b v t-1 New v b =v t = v i v t v i v i v b+1 v b Claim: Simplicity assures that the only way for the chain to exit the current hull is via pockets v b v b+1 or v t-1 v t. Time: O(n), since O(1) per insertion v b+1 Simplicity helps! 47

47 Melkman s Algorithm 48

48 Melkman s Algorithm 49

49 Melkman s Algorithm 50

50 Expected Size of CH 51

51 Expected Size, h, of CH Claim: For n points uniform in a square, the expected number of maximal points is O(log n) Corollary: E(h) = O(log n) (since CH vertices are subset of maximal points) Thus, Gift-Wrap/Jarvis runs in expected O(n log n), if points are uniform in a box, etc. 52

52 CH, Polytopes in Higher Dimensions 53

53 CH, Polytopes in Higher Dimensions Representing the structure of a simplex or polytope: Incidence Graph Later: for planar subdivisions (e.g., boundary of 3-dim polyhedra), we have various data structures: winged-edge, doubly-connected edge list (DCEL), quad-edge, etc. [David Mount lecture notes, Lecture 5] 54

54 Convex Hull in 3D 55

55 Convex Hull in 3D 56

56 CH in Higher Dimensions 3D: Divide and conquer: T(n) 2T(n/2) + O(n) O(n log n) merge Output-sensitive: O(n log h) [Chan] Higher dimensions: (d 4) applet h= O(n) O(n d/2 ), which is worst-case OPT, since point sets exist with h= (n d/2 ) Output-sensitive: O((n+h) log d-2 h), for d=4,5 Qhull website 57

57 Convex Hull in 3D 58

58 Convex Hull in 3D 59

59 More Demos Various 2D and 3D algorithms in an applet Applets of algorithms in O Rourke s book Applets from Jack Snoeyink 60

60 Review: Convex Hull Algorithms O(n 4 ), O(n 3 ), naïve O(n 2 ) incremental algorithm O(nh) simple, output-sensitive O(n log n) Graham scan, divide-and-conquer, incremental (with fancy data structures); worst-case optimal (as fcn of n) O(n log h) ultimate time bound (as fcn of n,h) Randomized, expected O(n log n) (simple) 3D: Divide and conquer: O(n log n) Output-sensitive: O(n log h) [Chan] Higher dimensions: (d 4) O(n d/2 ), which is worst-case OPT, Output-sensitive: O((n+h) log d-2 h), for d=4,5 61

Computational Geometry 2D Convex Hulls. Joseph S. B. Mitchell Stony Brook University

Computational Geometry 2D Convex Hulls. Joseph S. B. Mitchell Stony Brook University Computational Geometry 2D Convex Hulls Joseph S. B. Mitchell Stony Brook University Comparing O(n), O(n log n), O(n 2 ) n n log n n² 2 10 10³ 10 2 10 10 4 2 20 10 6 2 20 10 6 20 2 20 2 10 7 2 40 10 12

More information

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Spring, 2010

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Spring, 2010 UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Lecture 3 O Rourke Chapter 3: 2D Convex Hulls Thursday, 2/18/10 Chapter 3 2D Convex Hulls

More information

Convex Hull Algorithms

Convex Hull Algorithms Convex Hull Algorithms Design and Analysis of Algorithms prof. F. Malucelli Villa Andrea e Ceriani Simone Outline Problem Definition Basic Concepts Bruteforce Algorithm Graham Scan Algorithm Divide and

More information

Last time. Today: Convex Hull Brute Force Inside(q,abc) Intersect(ab,cd) Orient(a,b,c).

Last time. Today: Convex Hull Brute Force Inside(q,abc) Intersect(ab,cd) Orient(a,b,c). Last time Convex Hull Brute Force Inside(q,abc) Intersect(ab,cd) Orient(a,b,c). Today: More efficient convex hull algorithms and absolute bounds. Two (of many) algorithms. One (of one) interesting reduction.

More information

Computational Geometry Overview from Cormen, et al.

Computational Geometry Overview from Cormen, et al. UMass Lowell Computer Science 91.503 Graduate Algorithms Prof. Karen Daniels Spring, 2014 Computational Geometry Overview from Cormen, et al. Chapter 33 (with additional material from other sources) 1

More information

Planar convex hulls (I) Computational Geometry [csci 3250] Laura Toma Bowdoin College

Planar convex hulls (I) Computational Geometry [csci 3250] Laura Toma Bowdoin College Planar convex hulls (I) Computational Geometry [csci 3250] Laura Toma Bowdoin College Convex Hull Given a set P of points in 2D, their convex hull is the smallest convex polygon that contains all points

More information

Computational geometry

Computational geometry Computational geometry Inge Li Gørtz CLRS Chapter 33.0, 33.1, 33.3. Computational Geometry Geometric problems (this course Euclidean plane). Does a set of line segments intersect, dividing plane into regions,

More information

Computational Geometry. Algorithm Design (10) Computational Geometry. Convex Hull. Areas in Computational Geometry

Computational Geometry. Algorithm Design (10) Computational Geometry. Convex Hull. Areas in Computational Geometry Computational Geometry Algorithm Design (10) Computational Geometry Graduate School of Engineering Takashi Chikayama Algorithms formulated as geometry problems Broad application areas Computer Graphics,

More information

3D convex hulls. Computational Geometry [csci 3250] Laura Toma Bowdoin College

3D convex hulls. Computational Geometry [csci 3250] Laura Toma Bowdoin College 3D convex hulls Computational Geometry [csci 3250] Laura Toma Bowdoin College Convex Hulls The problem: Given a set P of points, compute their convex hull 2D 3D 2D 3D polygon polyhedron Polyhedron region

More information

3D convex hulls. Computational Geometry [csci 3250] Laura Toma Bowdoin College

3D convex hulls. Computational Geometry [csci 3250] Laura Toma Bowdoin College 3D convex hulls Computational Geometry [csci 3250] Laura Toma Bowdoin College Convex Hull in 3D The problem: Given a set P of points in 3D, compute their convex hull convex polyhedron 2D 3D polygon

More information

CSE 5311 Notes 13: Computational Geometry

CSE 5311 Notes 13: Computational Geometry CSE 5311 Notes 13: Computational Geometry (Last updated 4/17/17 4:39 PM) SMALLEST ENCLOSING DISK See section 4.7 of de Berg ( http://dx.doi.org.ezproxy.uta.edu/10.1007/978-3-540-77974-2 ) Algorithm MINIDISC(P)

More information

CS 532: 3D Computer Vision 14 th Set of Notes

CS 532: 3D Computer Vision 14 th Set of Notes 1 CS 532: 3D Computer Vision 14 th Set of Notes Instructor: Philippos Mordohai Webpage: www.cs.stevens.edu/~mordohai E-mail: Philippos.Mordohai@stevens.edu Office: Lieb 215 Lecture Outline Triangulating

More information

Figure 2.1: An example of a convex set and a nonconvex one.

Figure 2.1: An example of a convex set and a nonconvex one. Convex Hulls 2.1 Definitions 2 Convexity is the key to understanding and simplifying geometry, and the convex hull plays a role in geometry akin to the sorted order for a collection of numbers. So what

More information

Prof. Gill Barequet. Center for Graphics and Geometric Computing, Technion. Dept. of Computer Science The Technion Haifa, Israel

Prof. Gill Barequet. Center for Graphics and Geometric Computing, Technion. Dept. of Computer Science The Technion Haifa, Israel Computational Geometry (CS 236719) http://www.cs.tufts.edu/~barequet/teaching/cg Chapter 1 Introduction 1 Copyright 2002-2009 2009 Prof. Gill Barequet Center for Graphics and Geometric Computing Dept.

More information

AMS 345/CSE 355 Computational Geometry

AMS 345/CSE 355 Computational Geometry AMS 345/CSE 355 Computational Geometry Lecture: Polygons, Guarding Joe Mitchell Do You Like Puzzles? Come to the new Stony Brook Puzzle Society Meets: Friday 1:05-2:30 pm at CSE 2120 Organizer: Pramod

More information

Lecture 3: Art Gallery Problems and Polygon Triangulation

Lecture 3: Art Gallery Problems and Polygon Triangulation EECS 396/496: Computational Geometry Fall 2017 Lecture 3: Art Gallery Problems and Polygon Triangulation Lecturer: Huck Bennett In this lecture, we study the problem of guarding an art gallery (specified

More information

An Introduction to Computational Geometry: Arrangements and Duality

An Introduction to Computational Geometry: Arrangements and Duality An Introduction to Computational Geometry: Arrangements and Duality Joseph S. B. Mitchell Stony Brook University Some images from [O Rourke, Computational Geometry in C, 2 nd Edition, Chapter 6] Arrangement

More information

CS 410/584, Algorithm Design & Analysis, Lecture Notes 8

CS 410/584, Algorithm Design & Analysis, Lecture Notes 8 CS 410/584,, Computational Geometry Algorithms for manipulation of geometric objects We will concentrate on 2-D geometry Numerically robust try to avoid division Round-off error Divide-by-0 checks Techniques

More information

Voronoi diagram and Delaunay triangulation

Voronoi diagram and Delaunay triangulation Voronoi diagram and Delaunay triangulation Ioannis Emiris & Vissarion Fisikopoulos Dept. of Informatics & Telecommunications, University of Athens Computational Geometry, spring 2015 Outline 1 Voronoi

More information

Week 7 Convex Hulls in 3D

Week 7 Convex Hulls in 3D 1 Week 7 Convex Hulls in 3D 2 Polyhedra A polyhedron is the natural generalization of a 2D polygon to 3D 3 Closed Polyhedral Surface A closed polyhedral surface is a finite set of interior disjoint polygons

More information

1/60. Geometric Algorithms. Lecture 1: Introduction. Convex Hulls

1/60. Geometric Algorithms. Lecture 1: Introduction. Convex Hulls 1/60 Geometric Algorithms Lecture 1: Introduction Convex Hulls Geometric algorithms scope 2/60 Geometry algorithms (practice): Study of geometric problems that arise in various applications and how algorithms

More information

CS 410/584, Algorithm Design & Analysis, Lecture Notes 8!

CS 410/584, Algorithm Design & Analysis, Lecture Notes 8! CS 410/584, Algorithm Design & Analysis, Computational Geometry! Algorithms for manipulation of geometric objects We will concentrate on 2-D geometry Numerically robust try to avoid division Round-off

More information

A Minimalist s Implementation of the 3-d Divide-and-Conquer Convex Hull Algorithm

A Minimalist s Implementation of the 3-d Divide-and-Conquer Convex Hull Algorithm A Minimalist s Implementation of the 3-d Divide-and-Conquer Convex Hull Algorithm Timothy M. Chan Presented by Dana K. Jansens Carleton University Simple Polygons Polygon = A consecutive set of vertices

More information

2D Geometry. Pierre Alliez Inria Sophia Antipolis

2D Geometry. Pierre Alliez Inria Sophia Antipolis 2D Geometry Pierre Alliez Inria Sophia Antipolis Outline Sample problems Polygons Graphs Convex hull Voronoi diagram Delaunay triangulation Sample Problems Line Segment Intersection Theorem: Segments (p

More information

Cross products. p 2 p. p p1 p2. p 1. Line segments The convex combination of two distinct points p1 ( x1, such that for some real number with 0 1,

Cross products. p 2 p. p p1 p2. p 1. Line segments The convex combination of two distinct points p1 ( x1, such that for some real number with 0 1, CHAPTER 33 Comutational Geometry Is the branch of comuter science that studies algorithms for solving geometric roblems. Has alications in many fields, including comuter grahics robotics, VLSI design comuter

More information

Computational Geometry Lecture Duality of Points and Lines

Computational Geometry Lecture Duality of Points and Lines Computational Geometry Lecture Duality of Points and Lines INSTITUTE FOR THEORETICAL INFORMATICS FACULTY OF INFORMATICS 11.1.2016 Duality Transforms We have seen duality for planar graphs and duality of

More information

CMSC 754 Computational Geometry 1

CMSC 754 Computational Geometry 1 CMSC 754 Computational Geometry 1 David M. Mount Department of Computer Science University of Maryland Fall 2005 1 Copyright, David M. Mount, 2005, Dept. of Computer Science, University of Maryland, College

More information

Computational Geometry

Computational Geometry Lecture 1: Introduction and convex hulls Geometry: points, lines,... Geometric objects Geometric relations Combinatorial complexity Computational geometry Plane (two-dimensional), R 2 Space (three-dimensional),

More information

Computational Geometry

Computational Geometry Computational Geometry Range queries Convex hulls Lower bounds Planar subdivision search Line segment intersection Convex polygons Voronoi diagrams Minimum spanning trees Nearest neighbors Triangulations

More information

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension Antoine Vigneron King Abdullah University of Science and Technology November 7, 2012 Antoine Vigneron (KAUST) CS 372 Lecture

More information

VORONOI DIAGRAM PETR FELKEL. FEL CTU PRAGUE Based on [Berg] and [Mount]

VORONOI DIAGRAM PETR FELKEL. FEL CTU PRAGUE   Based on [Berg] and [Mount] VORONOI DIAGRAM PETR FELKEL FEL CTU PRAGUE felkel@fel.cvut.cz https://cw.felk.cvut.cz/doku.php/courses/a4m39vg/start Based on [Berg] and [Mount] Version from 9.11.2017 Talk overview Definition and examples

More information

High-Dimensional Computational Geometry. Jingbo Shang University of Illinois at Urbana-Champaign Mar 5, 2018

High-Dimensional Computational Geometry. Jingbo Shang University of Illinois at Urbana-Champaign Mar 5, 2018 High-Dimensional Computational Geometry Jingbo Shang University of Illinois at Urbana-Champaign Mar 5, 2018 Outline 3-D vector geometry High-D hyperplane intersections Convex hull & its extension to 3

More information

Geometric Algorithms in Three Dimensions Tutorial. FSP Seminar, Strobl,

Geometric Algorithms in Three Dimensions Tutorial. FSP Seminar, Strobl, Geometric Algorithms in Three Dimensions Tutorial FSP Seminar, Strobl, 22.06.2006 Why Algorithms in Three and Higher Dimensions Which algorithms (convex hulls, triangulations etc.) can be generalized to

More information

Computational Geometry. Geometry Cross Product Convex Hull Problem Sweep Line Algorithm

Computational Geometry. Geometry Cross Product Convex Hull Problem Sweep Line Algorithm GEOMETRY COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming Challenges books. Computational

More information

Linear Programming in Small Dimensions

Linear Programming in Small Dimensions Linear Programming in Small Dimensions Lekcija 7 sergio.cabello@fmf.uni-lj.si FMF Univerza v Ljubljani Edited from slides by Antoine Vigneron Outline linear programming, motivation and definition one dimensional

More information

Line segment intersection. Family of intersection problems

Line segment intersection. Family of intersection problems CG Lecture 2 Line segment intersection Intersecting two line segments Line sweep algorithm Convex polygon intersection Boolean operations on polygons Subdivision overlay algorithm 1 Family of intersection

More information

COMP331/557. Chapter 2: The Geometry of Linear Programming. (Bertsimas & Tsitsiklis, Chapter 2)

COMP331/557. Chapter 2: The Geometry of Linear Programming. (Bertsimas & Tsitsiklis, Chapter 2) COMP331/557 Chapter 2: The Geometry of Linear Programming (Bertsimas & Tsitsiklis, Chapter 2) 49 Polyhedra and Polytopes Definition 2.1. Let A 2 R m n and b 2 R m. a set {x 2 R n A x b} is called polyhedron

More information

CMSC 754 Computational Geometry 1

CMSC 754 Computational Geometry 1 CMSC 754 Computational Geometry 1 David M. Mount Department of Computer Science University of Maryland Spring 2007 1 Copyright, David M. Mount, 2007, Dept. of Computer Science, University of Maryland,

More information

Computational Geometry

Computational Geometry Motivation Motivation Polygons and visibility Visibility in polygons Triangulation Proof of the Art gallery theorem Two points in a simple polygon can see each other if their connecting line segment is

More information

Convex Hulls in Three Dimensions. Polyhedra

Convex Hulls in Three Dimensions. Polyhedra Convex Hulls in Three Dimensions Polyhedra Polyhedron 1.A polyhedron is the generalization of a 2- D polygon to 3-D A finite number of flat polygonal faces The boundary or surface of a polyhedron - Zero-dimensional

More information

COMPUTATIONAL GEOMETRY

COMPUTATIONAL GEOMETRY Thursday, September 20, 2007 (Ming C. Lin) Review on Computational Geometry & Collision Detection for Convex Polytopes COMPUTATIONAL GEOMETRY (Refer to O'Rourke's and Dutch textbook ) 1. Extreme Points

More information

CS6100: Topics in Design and Analysis of Algorithms

CS6100: Topics in Design and Analysis of Algorithms CS6100: Topics in Design and Analysis of Algorithms Guarding and Triangulating Polygons John Augustine CS6100 (Even 2012): Guarding and Triangulating Polygons The Art Gallery Problem A simple polygon is

More information

Flavor of Computational Geometry. Convex Hull in 2D. Shireen Y. Elhabian Aly A. Farag University of Louisville

Flavor of Computational Geometry. Convex Hull in 2D. Shireen Y. Elhabian Aly A. Farag University of Louisville Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag University of Louisville February 2010 Agenda Introduction Definitions of Convexity and Convex Hulls Naïve Algorithms

More information

Orthogonal Range Search and its Relatives

Orthogonal Range Search and its Relatives Orthogonal Range Search and its Relatives Coordinate-wise dominance and minima Definition: dominates Say that point (x,y) dominates (x', y') if x

More information

Instance-Optimal Geometric Algorithms

Instance-Optimal Geometric Algorithms Instance-Optimal Geometric Algorithms Timothy Chan School of CS U. Waterloo joint work with Peyman Afshani (MADALGO, Aarhus U) Jérémy Barbay (U. Chile) Theme Beyond worst-case analysis Adaptive algorithms

More information

Sieving Interior Collinear Points for Convex Hull Algorithms

Sieving Interior Collinear Points for Convex Hull Algorithms 90 Int'l Conf. Foundations of Computer Science FCS'15 Sieving Interior Collinear Points for Convex Hull Algorithms Dr. Michael Scherger Department of Computer Science Texas Christian University Fort Worth,

More information

! Linear programming"! Duality "! Smallest enclosing disk"

! Linear programming! Duality ! Smallest enclosing disk ! Linear programming"! Duality "! Smallest enclosing disk" 14. 24.! Define:" " i types of foods (1!i!d).! " j types of vitamins (1!j!n)." " x i the amount of food of type i." " a ji the amount of vitamin

More information

The convex hull of a set Q of points is the smallest convex polygon P for which each point in Q is either on the boundary of P or in its interior.

The convex hull of a set Q of points is the smallest convex polygon P for which each point in Q is either on the boundary of P or in its interior. CS 312, Winter 2007 Project #1: Convex Hull Due Dates: See class schedule Overview: In this project, you will implement a divide and conquer algorithm for finding the convex hull of a set of points and

More information

GEOMETRIC SEARCHING PART 1: POINT LOCATION

GEOMETRIC SEARCHING PART 1: POINT LOCATION GEOMETRIC SEARCHING PART 1: POINT LOCATION PETR FELKEL FEL CTU PRAGUE felkel@fel.cvut.cz https://cw.felk.cvut.cz/doku.php/courses/a4m39vg/start Based on [Berg] and [Mount] Version from 3.10.2014 Geometric

More information

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Fall, 2012

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Fall, 2012 UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Fall, 2012 O Rourke Chapter 7 Search & Intersection Chapter 7 Search & Intersection Segment-Segment Intersection

More information

Lecture 7: Computational Geometry

Lecture 7: Computational Geometry Lecture 7: Computational Geometry CS 491 CAP Uttam Thakore Friday, October 7 th, 2016 Credit for many of the slides on solving geometry problems goes to the Stanford CS 97SI course lecture on computational

More information

Computational Geometry Lecture Delaunay Triangulation

Computational Geometry Lecture Delaunay Triangulation Computational Geometry Lecture Delaunay Triangulation INSTITUTE FOR THEORETICAL INFORMATICS FACULTY OF INFORMATICS 7.12.2015 1 Modelling a Terrain Sample points p = (x p, y p, z p ) Projection π(p) = (p

More information

Chapter 4. Divide-and-Conquer. Copyright 2007 Pearson Addison-Wesley. All rights reserved.

Chapter 4. Divide-and-Conquer. Copyright 2007 Pearson Addison-Wesley. All rights reserved. Chapter 4 Divide-and-Conquer Copyright 2007 Pearson Addison-Wesley. All rights reserved. Divide-and-Conquer The most-well known algorithm design strategy: 2. Divide instance of problem into two or more

More information

Solutions to problem set 1

Solutions to problem set 1 Massachusetts Institute of Technology Handout 5 6.838: Geometric Computation October 4, 2001 Professors Piotr Indyk and Seth Teller Solutions to problem set 1 (mostly taken from the solution set of Jan

More information

Divide-and-Conquer. The most-well known algorithm design strategy: smaller instances. combining these solutions

Divide-and-Conquer. The most-well known algorithm design strategy: smaller instances. combining these solutions 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 recursively 3. Obtain solution to original

More information

Voronoi Diagrams and Delaunay Triangulation slides by Andy Mirzaian (a subset of the original slides are used here)

Voronoi Diagrams and Delaunay Triangulation slides by Andy Mirzaian (a subset of the original slides are used here) Voronoi Diagrams and Delaunay Triangulation slides by Andy Mirzaian (a subset of the original slides are used here) Voronoi Diagram & Delaunay Triangualtion Algorithms Divide-&-Conquer Plane Sweep Lifting

More information

Graduate Algorithms CS F-19 Computational Geometry

Graduate Algorithms CS F-19 Computational Geometry Graduate Algorithms CS673-016F-19 Comutational Geometry David Galles Deartment of Comuter Science University of San Francisco 19-0: Cross Products Given any two oints 1 = (x 1,y 1 ) and = (x,y ) Cross

More information

Computational Geometry

Computational Geometry Computational Geometry 600.658 Convexity A set S is convex if for any two points p, q S the line segment pq S. S p S q Not convex Convex? Convexity A set S is convex if it is the intersection of (possibly

More information

COMP Data Structures

COMP Data Structures COMP 2140 - Data Structures Shahin Kamali Topic 5 - Sorting University of Manitoba Based on notes by S. Durocher. COMP 2140 - Data Structures 1 / 55 Overview Review: Insertion Sort Merge Sort Quicksort

More information

Computational Geometry

Computational Geometry Casting a polyhedron CAD/CAM systems CAD/CAM systems allow you to design objects and test how they can be constructed Many objects are constructed used a mold Casting Casting A general question: Given

More information

Line Arrangements. Applications

Line Arrangements. Applications Computational Geometry Chapter 9 Line Arrangements 1 Line Arrangements Applications On the Agenda 2 1 Complexity of a Line Arrangement Given a set L of n lines in the plane, their arrangement A(L) is the

More information

Voronoi diagrams Delaunay Triangulations. Pierre Alliez Inria

Voronoi diagrams Delaunay Triangulations. Pierre Alliez Inria Voronoi diagrams Delaunay Triangulations Pierre Alliez Inria Voronoi Diagram Voronoi Diagram Voronoi Diagram The collection of the non-empty Voronoi regions and their faces, together with their incidence

More information

Chapter 2. Convex Hull. 2.1 Convexity. The following terminology should be familiar from linear algebra. Consider P R d. courses.

Chapter 2. Convex Hull. 2.1 Convexity. The following terminology should be familiar from linear algebra. Consider P R d. courses. Chapter 2 Convex Hull 2.1 Convexity Consider P R d. courses. The following terminology should be familiar from linear algebra Linear hull. lin(p) := { q } q = λi p i 8 i : p i 2 P, λ i 2 R (smallest linear

More information

1. Meshes. D7013E Lecture 14

1. Meshes. D7013E Lecture 14 D7013E Lecture 14 Quadtrees Mesh Generation 1. Meshes Input: Components in the form of disjoint polygonal objects Integer coordinates, 0, 45, 90, or 135 angles Output: A triangular mesh Conforming: A triangle

More information

CPSC / Sonny Chan - University of Calgary. Collision Detection II

CPSC / Sonny Chan - University of Calgary. Collision Detection II CPSC 599.86 / 601.86 Sonny Chan - University of Calgary Collision Detection II Outline Broad phase collision detection: - Problem definition and motivation - Bounding volume hierarchies - Spatial partitioning

More information

Motion Planning. O Rourke, Chapter 8

Motion Planning. O Rourke, Chapter 8 O Rourke, Chapter 8 Outline Translating a polygon Moving a ladder Shortest Path (Point-to-Point) Goal: Given disjoint polygons in the plane, and given positions s and t, find the shortest path from s to

More information

CSC Design and Analysis of Algorithms. Lecture 5. Decrease and Conquer Algorithm Design Technique. Decrease-and-Conquer

CSC Design and Analysis of Algorithms. Lecture 5. Decrease and Conquer Algorithm Design Technique. Decrease-and-Conquer CSC 8301- Design and Analysis of Algorithms Lecture 5 Decrease and Conquer Algorithm Design Technique Decrease-and-Conquer This algorithm design technique is based on exploiting a relationship between

More information

Convex Hull of the Union of Convex Objects in the Plane: an Adaptive Analysis

Convex Hull of the Union of Convex Objects in the Plane: an Adaptive Analysis CCCG 2008, Montréal, Québec, August 13 15, 2008 Convex Hull of the Union of Convex Objects in the Plane: an Adaptive Analysis Jérémy Barbay Eric Y. Chen Abstract We prove a tight asymptotic bound of Θ(δ

More information

COS 226 Lecture 15: Geometric algorithms. Warning: intuition may mislead (continued)

COS 226 Lecture 15: Geometric algorithms. Warning: intuition may mislead (continued) CS 226 ecture 15: eometric algorithms Warning: intuition may mislead (continued) Important applications involve geometry models of physical world computer graphics mathematical models x: Find intersections

More information

Cross products Line segments The convex combination of two distinct points p

Cross products Line segments The convex combination of two distinct points p CHAPTER Comutational Geometry Is the branch of comuter science that studies algorithms for solving geometric roblems. Has alications in many fields, including comuter grahics robotics, VLSI design comuter

More information

K-structure, Separating Chain, Gap Tree, and Layered DAG

K-structure, Separating Chain, Gap Tree, and Layered DAG K-structure, Separating Chain, Gap Tree, and Layered DAG Presented by Dave Tahmoush Overview Improvement on Gap Tree and K-structure Faster point location Encompasses Separating Chain Better storage Designed

More information

CSE 546, Fall, 2016 Homework 1

CSE 546, Fall, 2016 Homework 1 CSE 546, Fall, 2016 Homework 1 Due at the beginning of class Thursday, Sept. 15 at 2:30pm. Accepted without penalty until Friday, noon, in my mailbox in the Dept. office, third floor of Jolley. Notes about

More information

Simple Procedure for Minimum Zone Evaluation of Straightness and Flatness

Simple Procedure for Minimum Zone Evaluation of Straightness and Flatness 5 th Slovakian-Hungarian Joint Symposium on Applied Machine Intelligence and Informatics January 25-26, 2007 Poprad, Slovakia Simple Procedure for Minimum Zone Evaluation of Straightness and Flatness Gyula

More information

Computational Geometry

Computational Geometry Lecture 12: Lecture 12: Motivation: Terrains by interpolation To build a model of the terrain surface, we can start with a number of sample points where we know the height. Lecture 12: Motivation: Terrains

More information

Voronoi Diagrams, Delaunay Triangulations and Polytopes

Voronoi Diagrams, Delaunay Triangulations and Polytopes Voronoi Diagrams, Delaunay Triangulations and Polytopes Jean-Daniel Boissonnat MPRI, Lecture 2 Computational Geometry Learning Voronoi, Delaunay & Polytopes MPRI, Lecture 2 1 / 43 Voronoi diagrams in nature

More information

CSC Design and Analysis of Algorithms

CSC Design and Analysis of Algorithms CSC 8301- Design and Analysis of Algorithms Lecture 6 Divide and Conquer Algorithm Design Technique Divide-and-Conquer The most-well known algorithm design strategy: 1. Divide a problem instance into two

More information

Copyright 2009, Artur Czumaj 1

Copyright 2009, Artur Czumaj 1 CS 244 Algorithm Design Instructor: Artur Czumaj Lecture 2 Sorting You already know sorting algorithms Now you will see more We will want to understand generic techniques used for sorting! Lectures: Monday

More information

CSE 417 Network Flows (pt 4) Min Cost Flows

CSE 417 Network Flows (pt 4) Min Cost Flows CSE 417 Network Flows (pt 4) Min Cost Flows Reminders > HW6 is due Monday Review of last three lectures > Defined the maximum flow problem find the feasible flow of maximum value flow is feasible if it

More information

Ice-Creams and Wedge Graphs

Ice-Creams and Wedge Graphs Ice-Creams and Wedge Graphs Eyal Ackerman Tsachik Gelander Rom Pinchasi Abstract What is the minimum angle α > such that given any set of α-directional antennas (that is, antennas each of which can communicate

More information

Triangulation and Convex Hull. 8th November 2018

Triangulation and Convex Hull. 8th November 2018 Triangulation and Convex Hull 8th November 2018 Agenda 1. Triangulation. No book, the slides are the curriculum 2. Finding the convex hull. Textbook, 8.6.2 2 Triangulation and terrain models Here we have

More information

CSC Design and Analysis of Algorithms. Lecture 6. Divide and Conquer Algorithm Design Technique. Divide-and-Conquer

CSC Design and Analysis of Algorithms. Lecture 6. Divide and Conquer Algorithm Design Technique. Divide-and-Conquer CSC 8301- Design and Analysis of Algorithms Lecture 6 Divide and Conquer Algorithm Design Technique Divide-and-Conquer The most-well known algorithm design strategy: 1. Divide a problem instance into two

More information

Guy Blelloch. Gary L. Miller. Dafna Talmor. Carnegie-Mellon University

Guy Blelloch. Gary L. Miller. Dafna Talmor. Carnegie-Mellon University Developing a Practical Projection{Based Parallel Delaunay Algorithm Guy Blelloch Gary L. Miller Dafna Talmor -Mellon University Delaunay Triangulation Given a set of points P 2 IR 2 nd their Delaunay triangulation.

More information

CSCE 411 Design and Analysis of Algorithms

CSCE 411 Design and Analysis of Algorithms CSCE 411 Design and Analysis of Algorithms Set 3: Divide and Conquer Slides by Prof. Jennifer Welch Spring 2014 CSCE 411, Spring 2014: Set 3 1 General Idea of Divide & Conquer 1. Take your problem and

More information

INSTITUTE OF AERONAUTICAL ENGINEERING

INSTITUTE OF AERONAUTICAL ENGINEERING INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad - 500 043 COMPUTER SCIENCE AND ENGINEERING TUTORIAL QUESTION BANK Course Name Course Code Class Branch DATA STRUCTURES ACS002 B. Tech

More information

Computational Geometry TOPICS Preliminaries Point in a Polygon Polygon Construction Convex Hulls

Computational Geometry TOPICS Preliminaries Point in a Polygon Polygon Construction Convex Hulls Computational Geometry TOPICS Preliminaries Point in a Polygon Polygon Construction Convex Hulls CSE5311 Kumar 1 Geometric Algorithms Geometric Algorithms find applications in such areas as Computer Graphics

More information

CS 372: Computational Geometry Lecture 3 Line Segment Intersection

CS 372: Computational Geometry Lecture 3 Line Segment Intersection CS 372: Computational Geometry Lecture 3 Line Segment Intersection Antoine Vigneron King Abdullah University of Science and Technology September 9, 2012 Antoine Vigneron (KAUST) CS 372 Lecture 3 September

More information

Notes in Computational Geometry Voronoi Diagrams

Notes in Computational Geometry Voronoi Diagrams Notes in Computational Geometry Voronoi Diagrams Prof. Sandeep Sen and Prof. Amit Kumar Indian Institute of Technology, Delhi Voronoi Diagrams In this lecture, we study Voronoi Diagrams, also known as

More information

Polygon decomposition. Motivation: Art gallery problem

Polygon decomposition. Motivation: Art gallery problem CG Lecture 3 Polygon decomposition 1. Polygon triangulation Triangulation theory Monotone polygon triangulation 2. Polygon decomposition into monotone pieces 3. Trapezoidal decomposition 4. Convex decomposition

More information

Linear Programming- Manufacturing with

Linear Programming- Manufacturing with - 1395-2 1 / 36 Casting process 2 / 36 The of Casting top facet ordinary facet Every ordinary facet f has a corresponding facet in the mold, which we denote by ˆf. castable object top facet 3 / 36 The

More information

Lecture 2: Divide and Conquer

Lecture 2: Divide and Conquer Lecture 2: Divide and Conquer Paradigm Convex Hull Median finding Paradigm Given a problem of size n divide it into subproblems of size n, a 1, b >1. Solve each b subproblem recursively. Combine solutions

More information

Advanced Algorithm Homework 4 Results and Solutions

Advanced Algorithm Homework 4 Results and Solutions Advanced Algorithm Homework 4 Results and Solutions ID 1 2 3 4 5 Av Ex 2554 6288 9919 10 6 10 10 9.5 8.9 10-1 4208 10 10 9 8.5 10 9.5 9 0996 10 10 10 10 10 10 10 8239 10 10 10 10 10 10 10 7388 8 8.5 9

More information

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Divide and Conquer

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Divide and Conquer Computer Science 385 Analysis of Algorithms Siena College Spring 2011 Topic Notes: Divide and Conquer Divide and-conquer is a very common and very powerful algorithm design technique. The general idea:

More information

Notes and Answers to Homework Exam 1, Geometric Algorithms, 2017

Notes and Answers to Homework Exam 1, Geometric Algorithms, 2017 Notes and Answers to Homework Exam 1, Geometric Algorithms, 2017 Below are some notes and sketches of correct answers for the first homework exam. We have also included the most common mistakes that were

More information

Simple Sorting Algorithms

Simple Sorting Algorithms Simple Sorting Algorithms Outline We are going to look at three simple sorting techniques: Bubble Sort, Selection Sort, and Insertion Sort We are going to develop the notion of a loop invariant We will

More information

Computational Geometry. HKU ACM ICPC Training 2010

Computational Geometry. HKU ACM ICPC Training 2010 Computational Geometry HKU ACM ICPC Training 2010 1 What is Computational Geometry? Deals with geometrical structures Points, lines, line segments, vectors, planes, etc. A relatively boring class of problems

More information

Geometric Algorithms. 1. Objects

Geometric Algorithms. 1. Objects Geometric Algorithms 1. Definitions 2. Line-Segment properties 3. Inner Points of polygons 4. Simple polygons 5. Convex hulls 6. Closest pair of points 7. Diameter of a point set 1. Objects 2-dimensional

More information

Selection, Bubble, Insertion, Merge, Heap, Quick Bucket, Radix

Selection, Bubble, Insertion, Merge, Heap, Quick Bucket, Radix Spring 2010 Review Topics Big O Notation Heaps Sorting Selection, Bubble, Insertion, Merge, Heap, Quick Bucket, Radix Hashtables Tree Balancing: AVL trees and DSW algorithm Graphs: Basic terminology and

More information

Stacks API and finding the convex hull. CS Spring 2017

Stacks API and finding the convex hull. CS Spring 2017 Stacks API and finding the convex hull CS 146 - Spring 2017 Today Collision detection Convex hull Graham scan algorithm DFS traversal The stack API push() pop()

More information

CSE 421 Greedy Alg: Union Find/Dijkstra s Alg

CSE 421 Greedy Alg: Union Find/Dijkstra s Alg CSE 1 Greedy Alg: Union Find/Dijkstra s Alg Shayan Oveis Gharan 1 Dijkstra s Algorithm Dijkstra(G, c, s) { d s 0 foreach (v V) d[v] //This is the key of node v foreach (v V) insert v onto a priority queue

More information

16.410/413 Principles of Autonomy and Decision Making

16.410/413 Principles of Autonomy and Decision Making 16.410/413 Principles of Autonomy and Decision Making Lecture 17: The Simplex Method Emilio Frazzoli Aeronautics and Astronautics Massachusetts Institute of Technology November 10, 2010 Frazzoli (MIT)

More information