Computational Geometry Largest convex subsets Exercise session #9: - - PDF document

computational geometry largest convex subsets
SMART_READER_LITE
LIVE PREVIEW

Computational Geometry Largest convex subsets Exercise session #9: - - PDF document

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


slide-1
SLIDE 1

1

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

1

Computational Geometry

Exercise session #9: Arrangements

  • Applications of arrangements
  • Largest convex subsets
  • Ham sandwich cuts
  • Substructures of arrangements
  • Lower envelopes
  • Davenport-Schinzel sequences
  • Divide & conquer algorithm
  • Homework 4 solution

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

2

Largest convex subsets

  • Definition: A finite set of points P is in convex

position if all points of P are the vertices of the convex hull polygon of P.

  • Definition: let P be a set of n points in general
  • position. Then Q is a convex subset of P if

Q⊆P and Q is in convex position.

  • Problem: given a point set P, find the largest

convex subset of P.

  • Erdös-Szekeres: ES(m) ≤ choose(2m-4,m-2)+1

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

3

Reminder: arrangements & convex hulls

  • The dual of a set of n points is an arrangement
  • f 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.

  • 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.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

4

The dual problem

characteristic curves

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

5

Solution idea

  • Dual problem: find pair of characteristic curves with

largest number of edges.

  • Idea: solve the problem for a fixed leftmost point p,

maximize over all p in P.

  • Linear order on convex subset: leftmost is first, next

are other points in CCW order.

  • Define Lp(e) for each edge e of arrangement, such

that Lp(e) = i if the dual point of its supporting line is the ith smallest point of some convex subset with p as leftmost point, and e is on the characteristic curve.

  • Find edge with largest index i over all p in P.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

6

Observations I

  • Edge e is part of upper (lower) characteristic

curve only if it lies above (below) h = D(p).

  • Definitions:

If e is unbounded on left, e’ is other unbounded edge on same line. Otherwise edges e’ and e’’ share right endpoints with left endpoint of e such that:

e’ is on same line as e. e’’ is on the other line incident on the left endpoint.

slide-2
SLIDE 2

2

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

7

Example of definitions

e1 e’1 e2 e’2 e’’2

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

8

Observations II

  • Index dependencies:

Lp(e) = 0 if line(e) is less steep than h = D(p). Lp(e) = 1 if e belongs to h. Lp(e) = Lp(e’) if:

e is unbounded to left, e∈h+ and line(e’’) is steeper than line(e), or e∈h- and line(e’’) is less steep than line(e)

Otherwise Lp(e) = max{Lp(e’),Lp(e’’)+1} unless line(e’’) = h, in which case Lp(e) = 2.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

9

Example of dependencies

h 1 1 2 x x y max{y,x+1}

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

10

Algorithm

1. Construct arrangement of dual lines. 2. For each point p in P: i. Compute label Lo(e) for each arrangement edge. ii. Determine greatest label m.

  • 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

  • f 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.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

11

Algorithm summary

  • Running time: O(n3) – not optimal.
  • Storage: O(n2) – can be improved to O(n).
  • General position assumption can be removed

with some tedious work.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

12

Ham sandwich cuts

  • Problem: given two point sets A and B, find a

line that simultaneously bisects these sets.

  • Special case: A and B are separable by a line.
  • 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.

slide-3
SLIDE 3

3

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

13

Separable sets cut

A B

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

14

Solution ideas

  • The ham sandwich cut dualizes to a point on

the median levels of both sets (by separability, the intersection is a point).

  • Simple solution: compute entire arrangement
  • f each set, compute levels, find median level,

find intersection.

  • Running time: O(n2).
  • Let Lk(n) be the complexity of kth level of an

arrangement of n lines, then: n2Ω(sqrt(logk)) ≤ Lk(n) ≤ O(nk1/3)

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

15

Efficient solution sketch

  • No need to explicitly compute median levels.
  • Search and prune to find intersection point:

Intersection can be discriminated by a line l: Find medians pA, pB of intersection with l. If pA=pB then intersection found If pA above pB then intersection is left of l. If pA below pB then intersection is right of l. Select two discriminating lines such that at least n/8 lines can be eliminated. Proceed until small subset remains.

  • Total running time in O(n).

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

16

Substructures in arrangements

  • Arrangements are defined also for line

segments and bounded curves.

  • In many cases, we are only interested in a

subset of the arrangement structure:

k-level (≤ k-level): set of points with k (≤ k) curves above it. Lower envelope: the portion of the arrangement seen when observed from infinity below. Single cell: cell of the arrangement, specified for example by a point within it.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

17

Davenport-Schinzel sequences

  • Given an alphabet of n symbols, a word is an ordered

sequence of symbols. A subsequence is word whose symbols are a subset of the original word with the same order.

  • An (n,s) Davenport-Schinzel sequence is a word on

an alphabet with n symbols that:

Two successive symbols of this word are distinct. For each two symbols a,b in the alphabet, the alternating sequence of length s+2 is not a subsequence of this word (no two symbols can alternate more than two times).

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

18

Example and bounds

  • The word ‘computational geometry’ is a (26,4)-

DS sequence (‘oaoao’ is a subsequence).

  • Let λs(n) be the maximal length of a (n,s)-DS

sequence.

  • Theorem: λ1(n) = n, λ2(n) = 2n-1, λ3(n) =

Θ(nα(n)), where α(n) is the inverse of Ackerman’s function.\

  • Proof: ‘Davenport-Schinzel sequences and

their applications’ – M. Sharir, P. Agarwal.

slide-4
SLIDE 4

4

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

19

Lower envelopes

f1 f2 f3 f4 1 2 3 4 3 3 4

LE(x) = mini{fi(x)}

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

20

Complexity of lower envelopes

  • Let F = {fi(x)} be a set of functions which pairwise

intersect at most s times.

  • If functions defined over ℜ then the complexity of

the lower envelope is λs(n).

  • If functions defined over closed interval then

complexity of the lower envelope is λs+2(n).

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

21

Divide & conquer algorithm

LowerEnvelope(F) 1. If |F| = 1 then return f1. 2. Divide the set of functions into F1 and F2. 3. Recursively compute envelopes of F1 and F2. 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)logn) time.

  • Can be improved to O(λs+1(n)logn) time.