an introduction to computational geometry: arrangements...

40
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]

Upload: others

Post on 17-Mar-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · 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, 2nd Edition, Chapter 6]

Page 2: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Arrangement of Lines

2

1 2

3

4

5 A partition of the plane into vertices, edges, cells, by a finite set of lines.

Page 3: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

3

[O’Rourke, Chapter 6]

Page 4: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Sign Vectors

4

1 2

3

4

5 A partition of the plane into vertices, edges, cells, by a finite set of lines.

(+,+,-,-,-)

(+,+,+,+,+)

(-,-,-,-,-)

(0,-,-,+,+) (+,0,-,0,0)

Page 5: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Combinatorics of Arrangements of Lines

Arrangement is simple if • No 2 lines are parallel; and

• No 3 lines pass through a common point

Theorem 6.2.1: In a simple arrangement of n lines, V=n(n-1)/2, E=n2, F=n(n-1)/2+n+1. These are upper bounds in a nonsimple arrangement.

5

Page 6: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Proof

Consider a simple arrangement; non-simple arrangements only have fewer vertices, edges and faces

6

Page 7: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Proof (cont)

Vertices: Every pair of lines defines a unique vertex: {n choose 2} = n(n-1)/2

Edges: Each line is crossed at n-1 distinct points by the other n-1 lines: This yields n edges per line, so n2 total

Faces: • Use Euler (include a “vertex at infinity”,

where all unbounded edges are incident): f-e+v=f-n2+(1+n(n-1)/2)=2, so f=1+n+n(n-1)/2

• Use sweep argument (as done in class) 7

Assume: The n lines form a simple arrangement

Page 8: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Zone of a Line in an Arrangement of Lines

8

The zone of the blue line (x-axis) is highlighted in red: It has complexity 15

The zone, Z(L), of line L in an arrangement of lines is the set of all cells intersected by L. The complexity of the zone, |Z(L)|, is the total number of edges of the cells of the zone. (Some edges may be counted twice.)

Page 9: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Zone Theorem

Theorem 6.2.2: The total number of edges in all the cells that intersect any one line L in an arrangement of n lines is O(n). Specifically, |Z(L)| ≤ 6n.

9

Page 10: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Zone Theorem: Proof

Proof: By induction on n.

WLOG: L is horizontal

We show that the number of “left contributions” is at most 3n.

Clearly true for n=1.

Induction Hypothesis (IH): true for n≤k.

10

Page 11: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Zone Theorem: Proof

Consider a set of k+1 lines; remove the one, Lk+1 , with rightmost crossing along L.

When we add Lk+1 back, we get at most one new left contribution along it, and potentially split 2 other left contributions.

Thus, going from k lines to k+1 lines increases number of left contributions by at most 3: total is at most 3(k+1) for k+1 lines.

By induction, we have proved that the number of left contributions is at most 3n, for any n

Thus, total zone has at most 6n complexity 11

Page 12: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

12

Page 13: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

13

Page 14: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Constructing an Arrangement of Lines

Corollary to Zone Thm: The arrangement of n lines can be constructed (e.g., in a winged-edge data structure) in time O(n2)

Algorithm: Incremental

14

Page 15: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Inserting a Line in the Arrangement

15

Page 16: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Point-Line Duality

16

Lines dual to the 4 points

L : y = 2ax – b p : (a,b) Applet: (uses L : y = ax – b p : (a,b) )

http://nms.lcs.mit.edu/~aklmiu/6.838/dual/

Page 17: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Relationship to Parabola y=x2

17

Page 18: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Example

18

Page 19: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Example

19

Page 20: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Duality Properties

1. D(D(x)) = x

2. D is one-to-one correspondence between all nonvertical lines and all points in the plane

3. Point p lies on line L iff point D(L) lies on line D(p)

4. Lines L1 and L2 intersect at point p iff the line D(p) passes through the two points D(L1) and D(L2)

5. If point p lies above line L, then line D(p) lies below point D(L); if p lies below L, then D(p) lies above D(L) 20

Page 21: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Duality Properties

1. D(D(x)) = x

2. D is one-to-one correspondence between all nonvertical lines and all points in the plane

21

Page 22: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Duality Properties

3. Point p lies on line L iff point D(L) lies on line D(p)

22

Page 23: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Duality Properties

4. Lines L1 and L2 intersect at point p iff the line D(p) passes through the two points D(L1) and D(L2)

23

Page 24: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Duality Properties

5. If point p lies above line L, then line D(p) lies below point D(L); if p lies below L, then D(p) lies above D(L)

24

Page 26: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Dual of a Line Segment

26

p

q D(p)

D(q)

D(L) L

r

D(r) Applet

Page 27: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Applications of Duality

Degeneracy testing

Halfplane intersection/convex hull

k-Nearest Neighbors, higher order Voronoi diagrams

Hidden surface removal

Aspect graphs

Smallest polytope shadow

Ham sandwich cuts

Red-blue matching

Segment stabbing

Radial sorting/visibility graphs

Minimum area triangle 27

Page 28: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Degeneracy Testing

Given n points in the plane: Decide if some 3 (or more) of them are collinear

Naïve: Check all triples: O(n3)

Smarter: Sort points by angle around each point pi : n sorts, total O(n2 log n)

28

Applet

Page 29: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Degeneracy Testing Given n points in the plane: Decide if

some 3 (or more) of them are collinear

Use duality: Build arrangement of the n lines, D(pi), in time O(n2), and check if there is some vertex having degree 6 or more (where 3 or more lines pass through – such is dual to a line passing through 3 or more points)

Total time: O(n2)

O(n2) space, but O(n) possible with “topological sweep”

29

Page 30: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Halfplane Intersection/Convex Hull

Given n halfplanes, compute their intersection

View in dual: lower envelope of n lines corresponds to upper convex hull of n points that are duals of the lines

30

Applet

Page 31: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Segment Stabbing

Given n line segments in the plane

Decide if there exists a line L that stabs all of them (or find a line L that stabs as manhy as possible)

View in dual: n double wedges (duals of segments) overlay to give an arr of 2n lines (build in O(n2)). Look for a point that lies in as many double wedges as possible (BFS/DFS in faces of arr)

31

Page 32: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Ham Sandwich Cut

Bisector of a set S of points: A line L that has at most |S|/2 points strictly on each side of L

Ham Sandwich Theorem: Given a set S=AB of red points (A) and blue points (B), there exists a line L that bisects both A and B

32

Page 33: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Ham Sandwich Cut

33

L

Page 34: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Ham Sandwich Cut: Example

34

Page 35: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Ham Sandwich Cut: Example

35

Page 36: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Ham Sandwich Cut: Example

36

Page 37: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Ham Sandwich Cut: Example

37

Page 38: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Ham Sandwich Cuts

Application: Noncrossing red-blue matching

Higher dimensions:

38

Page 39: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Ham Sandwich Cut

39

Page 40: An Introduction to Computational Geometry: Arrangements ...jsbm/courses/345/13/lecture-arrangements-duality.pdf · An Introduction to Computational Geometry: Arrangements and Duality

Higher Dimensions

In d dimensions: Arrangement of n hyperplanes has overall complexity O(nd)

Zone of a plane: Zone Theorem: O(nd-1)

Algorithm to construct arr: O(nd)

Point-hyperplane duality

40