1 / 41 Convex Hulls in 3-space Jason C. Yang
2 / 41 Problem Statement Given P: set of n points in 3-space Return: –Convex hull of P: CH (P) –Smallest polyhedron s.t. all elements of P on or in the interior of CH (P).
3 / 41 Algorithm Randomized incremental algorithm Steps: –Initialize the algorithm –Loop over remaining points Add p r to the convex hull of P r-1 to transform CH (P r-1 ) to CH (P r ) [for integer r 1, let P r :={p 1,…,p r }] Main Idea: Incrementally insert new points into the running/intermediate Convex Hull.
4 / 41 Initialization Need a CH to start with Build a tetrahedron using 4 points in P –Start with two distinct points in P: p 1 and p 2 –Walk through P to find p 3 that does not lie on the line through p 1 and p 2 –Find p 4 that does not lie on the plane through p 1, p 2, p 3 –Special case: No such points exist? Compute random permutation p 5,…,p n of the remaining points Need a CH to start with Build a tetrahedron using 4 points in P –Start with two distinct points in P: p 1 and p 2 –Walk through P to find p 3 that does not lie on the line through p 1 and p 2 –Find p 4 that does not lie on the plane through p 1, p 2, p 3 –Special case: No such points exist? All points lie on a plane. Use planar CH algorithm! Compute random permutation p 5,…,p n of the remaining points
5 / 41 Inserting Points into CH Add p r to the convex hull of P r-1 to transform CH (P r-1 ) to CH (P r ) [for integer r 1, let P r :={p 1,…,p r }] Two Cases: 1) P r is inside or on the boundary of CH (P r-1 ) Trivial: CH (P r ) = CH (P r-1 ) 2) P r is outside of CH (P r-1 )
6 / 41 Case 2: P r outside CH (P r-1 ) Determine horizon of p r on CH (P r-1 ) –Closed curve of edges enclosing the visible region of p r on CH (P r-1 )
7 / 41 Visibility Consider plane h f containing a facet f of CH (P r-1 ) f is visible from a point if that point lies in the open half-space on the other side of h f
8 / 41 Rethinking the Horizon –Boundary of polygon obtained from projecting CH (P r-1 ) onto a plane with p r as the center of projection
9 / 41 CH (P r-1 ) CH (P r ) Remove visible facets from CH (P r-1 ) Found horizon: Closed curve of edges of CH (P r-1 ) Form CH (P r ) by connecting each horizon edge to p r to create a new triangular facet
10 / 41 Algorithm So Far… Initialization –Form tetrahedron CH (P 4 ) from 4 points in P –Compute random permutation of remaining pts. For each remaining point in P –p r is point to be inserted –If p r is outside CH (P r-1 ) then Determine visible region Find horizon and remove visible facets Add new facets by connecting each horizon edge to p r How do we determine the visible region?
11 / 41 How to Find Visible Region Naïve approach: –Test every facet with respect to p r –O(n 2 ) Trick is to work ahead: Maintain information to aid in determining visible facets.
12 / 41 Conflict Lists For each facet f maintain P conflict ( f ) {p r+1, …, p n } containing points to be inserted that can see f For each p t, where t > r, maintain F conflict (p t ) containing facets of CH (P r ) visible from p t p and f are in conflict because they cannot coexist on the same convex hull
13 / 41 Conflict Graph G Bipartite graph –pts not yet inserted –facets on CH (P r ) Arc for every point-facet conflict Conflict sets for a point or facet can be returned in linear time At any step of our algorithm, we know all conflicts between the remaining points and facets on the current CH
14 / 41 Initializing G Initialize G with CH (P 4 ) in linear time Walk through P 5-n to determine which facet each point can see f1f1 f2f2 p6p6 p5p5 p7p7 p6p6 p7p7 p5p5 f2f2 f1f1 G
15 / 41 Updating G Discard visible facets from p r by removing neighbors of p r in G Remove p r from G Determine new conflicts p6p6 p7p7 p5p5 f2f2 f1f1 G f1f1 f2f2 f3f3 f3f3 p6p6 p7p7 p5p5 f2f2 f1f1 G p6p6 p7p7 p5p5 f2f2 f1f1 G p5p5 p7p7 p6p6
16 / 41 Determining New Conflicts If p t can see new f, it can see edge e of f. e on horizon of p r, so e was already in and visible from p t in CH (P r-1 ) If p t sees e, it saw either f 1 or f 2 in CH (P r-1 ) P t was in P conflict (f 1 ) or P conflict (f 2 ) in CH (P r-1 ) ptpt
17 / 41 Determining New Conflicts Conflict list of f can be found by testing the points in the conflict lists of f 1 and f 2 incident to the horizon edge e in CH (P r-1 ) ptpt
18 / 41 What About the Other Facets? P conflict ( f ) for any f unaffected by p r remains unchanged ptpt Deleted facets not on horizon already accounted for
19 / 41 Final Algorithm Initialize CH (P 4 ) and G For each remaining point –Determine visible facets for p r by checking G –Remove F conflict (p r ) from CH –Find horizon and add new facets to CH and G –Update G for new facets by testing the points in existing conflict lists for facets in CH (P r-1 ) incident to e on the new facets –Delete p r and F conflict (p r ) from G
20 / 41 Fine Point Coplanar facets –p r lies in the plane of a face of CH (P r-1 ) f is not visible from p r so we merge created triangles coplanar to f New facet has same conflict list as existing facet
21 / 41 Analysis
22 / 41 Complexity of CH for n points in 3-space is O(n) Number of edges of a convex polytope with n vertices is at most 3n-6 and the number of facets is at most 2n-4 From Euler’s formula: n – n e + n f = 2 Complexity
23 / 41 Complexity Each face has at least 3 arcs Each arc incident to two faces 2n e 3n f Using Euler n f 2n-4n e 3n-6
24 / 41 Expected Number of Facets Created Will show that expected number of facets created by our algorithm is at most 6n-20 Initialized with a tetrahedron = 4 facets
25 / 41 Expected Number of New Facets Backward analysis: –Remove p r from CH (P r ) –Number of facets removed same as those created by p r –Number of edges incident to p r in CH (P r ) is degree of p r : deg(p r, CH (P r ))
26 / 41 Expected Degree of p r Convex polytope of r vertices has at most 3r-6 edges Sum of degrees of vertices of CH (P r ) is 6r-12 Expected degree of p r bounded by (6r-12)/r
27 / 41 Expected Number of Created Facets 4 from initial tetrahedron Expected total number of facets created by adding p 5,…,p n
28 / 41 Running Time Initialization O(nlogn) Creating and deleting facets O(n) –Expected number of facets created is O(n) Deleting p r and facets in F conflict (p r ) from G along with incident arcs O(n) Finding new conflicts O(?)
29 / 41 Total Time to Find New Conflicts For each edge e on horizon we spend O(card(P(e)) time where P(e) P confict (f 1 ) P conflict (f 2 ) Total time is O( e L card(P(e))) bounded by expected value of card(P(e)) Lemma 11.6 The expected value of e card(P(e)), where the summation is over all horizon edges that appear at some stage of the algorithm is O(nlogn)
30 / 41 Randomized Insertion Order
31 / 41 Running Time Initialization O(nlogn) Creating and deleting facets O(n) Updating G O(n) Finding new conflicts O(nlogn) Total Running Time is O(nlogn)
32 / 41 Higher Dimensional Convex Hulls Upper Bound Theorem: The worst-case combinatorial complexity of the convex hull of n points in d-dimensional space is (n d/2 ). Our algorithm generalizes to higher dimensions with expected running time of (n d/2 )
33 / 41 Higher Dimensional Convex Hulls Best known output-sensitive algorithm for computing convex hulls in R d is: O(nlogk +(nk) 1-1/( d/2 +1) log O(n) ) where k is complexity