Computational Geometry Largest convex subsets Exercise session #9: Arrangements • Definition : A finite set of points P is in convex position if all points of P are the vertices of the • Applications of arrangements convex hull polygon of P . � Largest convex subsets � • Definition : let P be a set of n points in general Ham sandwich cuts position. Then Q is a convex subset of P if • Substructures of arrangements Q ⊆ P and Q is in convex position. � Lower envelopes • Problem : given a point set P , find the largest � Davenport-Schinzel sequences � convex subset of P . Divide & conquer algorithm • Homework 4 solution • Erdös-Szekeres : ES ( m ) ≤ choose (2 m -4, m -2)+1 1 2 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Reminder: arrangements & convex hulls The dual problem • The dual of a set of n points is an arrangement of n lines. Denote dual of p with D ( p ). • Boundary of lower hull of the points is a set of line segments supported by lines incident on two points and below all other points. characteristic curves • In the dual plane: the lower hull is the set of edges whose level is zero. • Upper hull is corresponds to set of edges with level n -1. 3 4 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Solution idea Observations I • Dual problem : find pair of characteristic curves with • Edge e is part of upper (lower) characteristic largest number of edges. curve only if it lies above (below) h = D ( p ). • Idea : solve the problem for a fixed leftmost point p , • Definitions: maximize over all p in P . � If e is unbounded on left, e ’ is other unbounded • Linear order on convex subset: leftmost is first, next are other points in CCW order. edge on same line. • Define L p ( e ) for each edge e of arrangement, such � Otherwise edges e ’ and e ’’ share right endpoints that L p ( e ) = i if the dual point of its supporting line is with left endpoint of e such that: the i th smallest point of some convex subset with p as � e ’ is on same line as e . leftmost point, and e is on the characteristic curve. � e ’’ is on the other line incident on the left endpoint. • Find edge with largest index i over all p in P . 5 6 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 1
Example of definitions Observations II • Index dependencies: e 1 � L p ( e ) = 0 if line ( e ) is less steep than h = D ( p ). � L p ( e ) = 1 if e belongs to h . � L p ( e ) = L p ( e’ ) if: e’ 2 e ’ 1 � e is unbounded to left, e ∈ h + and line( e ’’) is steeper than e’’ 2 line ( e ), or e 2 � e ∈ h - and line ( e ’’) is less steep than line ( e ) � Otherwise L p ( e ) = max { L p ( e’ ), L p ( e’’ )+1} unless line ( e ’’) = h , in which case L p ( e ) = 2. 7 8 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Example of dependencies Algorithm 1. Construct arrangement of dual lines. max { y,x +1} 0 x h 2. For each point p in P : x y i. Compute label L o ( e ) for each arrangement edge. 1 2 ii. Determine greatest label m . 1 iii. If m > maximum, update maximum & determine convex subset by following label backwards. • Efficient labeling of edges using order ≤ : • e ≤ e ’ if, first, right endpoint of edge e coincides with left endpoint of e ’ and either both e and e ’ are below h or neither of them is, or if, second, e and e ’ belong to same line different from h s.t. e is unbounded to right and e ’ is unbounded to left. 9 10 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Algorithm summary Ham sandwich cuts • Running time: O ( n 3 ) – not optimal. • Problem : given two point sets A and B , find a line that simultaneously bisects these sets. • Storage: O ( n 2 ) – can be improved to O ( n ). • Special case : A and B are separable by a line. • General position assumption can be removed with some tedious work. • Reminder: the bisector of a single set A dualizes to a point on the median level of the arrangement. • Assumption: the size of the sets is odd. • With assumption, the cut passes through a point of A and a point of B . 11 12 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 2
Separable sets cut Solution ideas • The ham sandwich cut dualizes to a point on A B the median levels of both sets (by separability, the intersection is a point). • Simple solution: compute entire arrangement of each set, compute levels, find median level, find intersection. • Running time: O ( n 2 ). • Let L k ( n ) be the complexity of k th level of an arrangement of n lines, then: n2 Ω (sqrt(log k )) ≤ L k ( n ) ≤ O ( nk 1/3 ) 13 14 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Efficient solution sketch Substructures in arrangements • No need to explicitly compute median levels. • Arrangements are defined also for line • Search and prune to find intersection point: segments and bounded curves. � Intersection can be discriminated by a line l : • In many cases, we are only interested in a � Find medians p A , p B of intersection with l . subset of the arrangement structure: � If p A = p B then intersection found � k-level ( ≤ k-level ): set of points with k ( ≤ k) curves � If p A above p B then intersection is left of l . above it. � If p A below p B then intersection is right of l . � Lower envelope : the portion of the arrangement � Select two discriminating lines such that at least n /8 lines seen when observed from infinity below. can be eliminated. � Single cell : cell of the arrangement, specified for � Proceed until small subset remains. example by a point within it. • Total running time in O ( n ). 15 16 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Davenport-Schinzel sequences Example and bounds • Given an alphabet of n symbols, a word is an ordered • The word ‘computational geometry’ is a (26,4)- sequence of symbols. A subsequence is word whose DS sequence (‘oaoao’ is a subsequence). symbols are a subset of the original word with the • Let λ s ( n ) be the maximal length of a ( n , s )-DS same order. sequence. • An ( n , s ) Davenport-Schinzel sequence is a word on • Theorem : λ 1 ( n ) = n , λ 2 ( n ) = 2 n -1, λ 3 ( n ) = an alphabet with n symbols that: Θ ( n α ( n )), where α ( n ) is the inverse of � Two successive symbols of this word are distinct. � For each two symbols a , b in the alphabet, the alternating Ackerman’s function.\ sequence of length s +2 is not a subsequence of this word • Proof : ‘ Davenport-Schinzel sequences and (no two symbols can alternate more than two times). their applications ’ – M. Sharir, P. Agarwal. 17 18 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 3
Lower envelopes Complexity of lower envelopes • Let F = { f i ( x )} be a set of functions which pairwise intersect at most s times. f 3 f 2 • If functions defined over ℜ then the complexity of the lower envelope is λ s ( n ). f 1 • If functions defined over closed interval then complexity of the lower envelope is λ s +2 ( n ). f 4 0 1 2 3 4 3 4 3 0 LE ( x ) = min i {f i ( x )} 19 20 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Divide & conquer algorithm LowerEnvelope ( F ) 1. If | F | = 1 then return f 1 . 2. Divide the set of functions into F 1 and F 2 . 3. Recursively compute envelopes of F 1 and F 2 . 4. Merge envelopes with a vertical sweepline: • Event points are endpoints intersections • At each event, decide which envelope is lower Complexity : O ( λ s +2 ( n )) space and • O ( λ s +2 ( n )log n ) time. Can be improved to O ( λ s +1 ( n )log n ) time. • 21 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 4
Recommend
More recommend