Convex hull smallest convex set containing all the points.

Slides:



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

Chan’s Algorithm It is Jarvis’s march applied to big blobs of points.
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
Advanced Algorithms Piyush Kumar (Lecture 12: Parallel Algorithms) Welcome to COT5405 Courtesy Baker 05.
Computing Convex Hulls CLRS 33.3
CS16: Introduction to Data Structures & Algorithms
Rank Rank of an element is its position in ascending key order. [2,6,7,8,10,15,18,20,25,30,35,40] rank(2) = 0 rank(15) = 5 rank(20) = 7.
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
1 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.
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Reminder: Closest-Pair Problem Given a collection P of n points in  × , obtain the two points p1 and p2 such that their distance is less or equal that.
The Divide-and-Conquer Strategy
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Divide and Conquer.
Convex Hulls May Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
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
Lecture 3: Reduce to known problem Convex Hull (section 33.3 of CLRS). Suppose we have a bunch of points in the plane, given by their x and y coordinates.
Advanced Algorithm Design and Analysis (Lecture 10) SW5 fall 2004 Simonas Šaltenis E1-215b
Computational Geometry for the Tablet PC
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.
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.
Updated QuickSort Problem From a given set of n integers, find the missing integer from 0 to n using O(n) queries of type: “what is bit[j]
Convex Hulls Computational Geometry, WS 2006/07 Lecture 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Algorithm Design Strategy Divide and Conquer. More examples of Divide and Conquer  Review of Divide & Conquer Concept  More examples  Finding closest.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
Computational Geometry Overview from Cormen, et al. Chapter 33
Lecture 4: Divide and Conquer III: Other Applications and Examples Shang-Hua Teng.
5 - 1 § 5 The Divide-and-Conquer Strategy e.g. find the maximum of a set S of n numbers.
Administrivia, Lecture 5 HW #2 was assigned on Sunday, January 20. It is due on Thursday, January 31. –Please use the correct edition of the textbook!
See the demo slide on the website. 4 Example 1: Whole Process H G F E D C B A Divide H G F E D C B A Merge G H E F C D A B Merge E F G H A B.
Closest Pair of Points Computational Geometry, WS 2006/07 Lecture 9, Part II Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen,
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
Lecture 34 CSE 331 Nov 23, Homework related stuff Graded HW 8+9, solutions to HW 9 the week after Thanksgiving.
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.
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
Computational Geometry
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.
Computational Geometry Convex Hulls Robust Geometric Primitives Degeneracy and Stability Nick Pilkington.
Divide and Conquer.
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.
UNC Chapel Hill M. C. Lin Linear Programming Reading: Chapter 4 of the Textbook Driving Applications –Casting/Metal Molding –Collision Detection Randomized.
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 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.
1 Closest Pair of Points (from “Algorithm Design” by J.Kleinberg and E.Tardos) Closest pair. Given n points in the plane, find a pair with smallest Euclidean.
Convex Hull. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day.
15. Computational Geometry Topics
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.
Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms.
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.
Simplex “walk on the vertices of the feasible region” v = current vertex if  neighbor v’ of v with better objective then move to v’
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.
Data Structure & Algorithm 13 – Computational Geometry JJCAO.
Convex Hull.
CSCE350 Algorithms and Data Structure
Convex Sets & Concave Sets
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.
Computational Geometry
Presentation transcript:

Convex hull smallest convex set containing all the points

Convex hull smallest convex set containing all the points

Convex hull smallest convex set containing all the points representation = circular doubly-linked list of points on the boundary of the convex hull next = 2 = 3.prev 2.next = 3 = 4.prev 3.next = 4 = 1.prev 4.next = 1 = 2.prev start = 1

Jarvis march find the left-most point (assume no 3 points colinear) s

Jarvis march find the point that appears most to the right looking from s (assume no 3 points colinear) s

Jarvis march (assume no 3 points colinear) s p find the point that appears most to the right looking from p

Jarvis march (assume no 3 points colinear)

Jarvis march (assume no 3 points colinear)

Jarvis march (assume no 3 points colinear) s  point with smallest x-coord p  s repeat PRINT(p) q  point other than p for i from 1 to n do if i  p and point i to the right of line (p,q) then q  i p  q until p = s

Jarvis march (assume no 3 points colinear) Running time = O(n.h)

Graham scan (assume no 3 points colinear) start with a simple polygon containing all the points fix it in time O(n) O(n log n) homework

Graham scan (assume no 3 points colinear)

Graham scan (assume no 3 points colinear)

Graham scan (assume no 3 points colinear)

Graham scan (assume no 3 points colinear)

Graham scan (assume no 3 points colinear)

Graham scan (assume no 3 points colinear)

Graham scan (assume no 3 points colinear) A  start B  next(A) C  next(B) repeat 2n times if C is to the right of AB then A.next  C; C.prev  A B  A A  prev(A) else A  B B  C C  next(C)

Closest pair of points

2T(n/2)  min(left,right)

Closest pair of points 2T(n/2)  min(left,right) 

Closest pair of points 2T(n/2)  min(left,right)   

Closest pair of points X  sort the points by x-coordinate Y  sort the points by y-coordinate pre-processing Closest-pair(S) if |S|=1 then return  if |S|=2 then return the distance of the pair split S into S 1 and S 2 by the X-coord  1  Closest-pair(S 1 ),  2  Closest-pair(S 2 )  min(  1,  2 ) for points x in according to Y check 12 points around x, update  if a closer pair found

Smallest enclosing disc

The smallest enclosing disc is unique. Claim #1:

Smallest enclosing disc The smallest enclosing disc is unique. Claim #1:

Smallest enclosing disc SED(S) pick a random point x  S (c,r)  SED(S-{x}) if x  Disc(c,r) then return (c,r) else return SED-with-point(S,x)

Smallest enclosing disc SED(S) pick a random point x  S (c,r)  SED(S-{x}) if x  Disc(c,r) then return (c,r) else return SED-with-point(S,x) SED-with-point(S,y) pick a random point x  S (c,r)  SED-with-point(S-{x},y) if x  Disc(c,r) then return (c,r) else return SED-with-2-points(S,y,x)

Smallest enclosing disc SED(S) pick a random point x  S (c,r)  SED(S-{x}) if x  Disc(c,r) then return (c,r) else return SED-with-point(S,x) SED-with-2-point(S,y,z) pick a random point x  S (c,r)  SED-with-2-points(S-{x},y,z) if x  Disc(c,r) then return (c,r) else return circle given by x,y,z SED-with-point(S,y) pick a random point x  S (c,r)  SED-with-point(S-{x},y) if x  Disc(c,r) then return (c,r) else return SED-with-2-points(S,y,x)

Running time ? SED(S) pick a random point x  S (c,r)  SED(S-{x}) if x  Disc(c,r) then return (c,r) else return SED-with-point(S,x) SED-with-2-point(S,y,z) pick a random point x  S (c,r)  SED-with-2-points(S-{x},y,z) if x  Disc(c,r) then return (c,r) else return circle given by x,y,z SED-with-point(S,y) pick a random point x  S (c,r)  SED-with-point(S-{x},y) if x  Disc(c,r) then return (c,r) else return SED-with-2-points(S,y,x)

Running time ? SED(S) pick a random point x  S (c,r)  SED(S-{x}) if x  Disc(c,r) then return (c,r) else return SED-with-point(S,x) SED-with-2-point(S,y,z) pick a random point x  S (c,r)  SED-with-2-points(S-{x},y,z) if x  Disc(c,r) then return (c,r) else return circle given by x,y,z SED-with-point(S,y) pick a random point x  S (c,r)  SED-with-point(S-{x},y) if x  Disc(c,r) then return (c,r) else return SED-with-2-points(S,y,x) O(n)

Running time ? SED(S) pick a random point x  S (c,r)  SED(S-{x}) if x  Disc(c,r) then return (c,r) else return SED-with-point(S,x) SED-with-point(S,y) pick a random point x  S (c,r)  SED-with-point(S-{x},y) if x  Disc(c,r) then return (c,r) else return SED-with-2-points(S,y,x) T(n) = T(n-1) + 2 n SED-with-2-points T(n) = O(n) O(n)

Running time ? SED(S) pick a random point x  S (c,r)  SED(S-{x}) if x  Disc(c,r) then return (c,r) else return SED-with-point(S,x) T(n) = T(n-1) + 2 n SED-with-point T(n) = O(n) O(n)

Smallest enclosing disc Claim #2: md(I,B) = smallest enclosing disc with B on the boundary and I inside if x is inside md(I,B) then md(I  {x},B) = md(I,B)

Smallest enclosing disc Claim #3: md(I,B) = smallest enclosing disc with B on the boundary and I inside if x is outside of md(I,B) then md(I  {x},B) = md(I,B  {x})

Smallest enclosing disc Claim #3: md(I,B) = smallest enclosing disc with B on the boundary and I inside if x is outside of md(I,B) then md(I  {x},B) = md(I,B  {x}) md(I,B) md(l  {x},B) x

Smallest enclosing disc Claim #3: md(I,B) = smallest enclosing disc with B on the boundary and I inside if x is outside of md(I,B) then md(I  {x},B) = md(I,B  {x}) Claim #2: if x is inside md(I,B) then md(I  {x},B) = md(I,B) Claim #1: md(I,B) is unique