Top Banner
APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer Science Tel Aviv University
42

APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

May 31, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

APPLIED aspects ofCOMPUTATIONAL GEOMETRY

Arrangements, 2D

Dan Halperin

School of Computer ScienceTel Aviv University

Page 2: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Overview� Part I, A first tour of “solving it with arrangements”:

The minimum area triangle problem� duality, dcel, incremental construction, zone

� Part II, Generalizations� transformations

2

� transformations� different types of arrangements� alternative representation� construction by sweeping� other substructures: complexity and algorithms

Page 3: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Overview� Part I, A first tour of “solving it with arrangements”:

The minimum area triangle problem� duality, dcel, incremental construction, zone

� Part II, Generalizations� transformations

3

� transformations� different types of arrangements� alternative representation� construction by sweeping� other substructures: complexity and algorithms

Page 4: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Background� Lines, segments, and rays� A tale of two paradigms:

sweep vs. incremental� Arrangements of lines:

the shape and complexity of

4

� the shape and complexity of a face

� the complexity of the entirearrangements is θ(n2)

Page 5: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Reminder: Minimum area triangle� find the three of the given set of n points P = {p1, p2, . . . , pn} that define the minimum area triangle

5

Page 6: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Reminder: Minimum area triangle� find the three of the given set of n points

P = {p1, p2, . . . , pn} that define the minimum area triangle� a naïve algorithm requires O(n3) time

6

Page 7: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

The transformation: Duality

Primal planePrimal planePrimal planePrimal plane� the point p := (a, b)� the line l := (y = cx + d)

Dual PlaneDual PlaneDual PlaneDual Plane� the line p* := (y = ax − b)� the point l * := (c,−d)

this duality transform does not handle vertical lines

7

this duality transform does not handle vertical lines

Page 8: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Properties of this duality transform� preserves incidence

8

Page 9: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Properties of this duality transform� preserves incidence� preserves above/below relation

9

Page 10: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Properties of this duality transform� preserves incidence� preserves above/below relation� preserves the vertical distance between a line and a

point

10

Page 11: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Minimum area triangle for a fixed pair� fix a pair of input points pi ,pj� which point pk of P defines the smallest area trianglewith pi ,pj?

11

Page 12: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Minimum area triangle for a fixed pair� fix a pair of input points pi ,pj� which point pk of P defines the smallest area trianglewith pi ,pj?

12

Page 13: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

In the dual…� in an arrangement of n lines P* = {p *1, p *2, . . . , p *n}, foreach vertex find the vertically closest line

13

Page 14: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Interim summary� our problem: given an arrangement of n lines find the

vertex and the line that induce the smallest vertical distance

14

Page 15: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Representing the arrangement I: Dcel

� vertices, half-edges, and faces� halfedges:

� twinprevious� previous

� next� CCBs: inner

and outer

15

Page 16: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Incremental construction� recall the general position assumption� computing a bounding box� inserting the i-th line

the edge the edge the edge the edge eeeethe edge the edge the edge the edge e’e’e’e’

16

the edge the edge the edge the edge e’e’e’e’

ppppffffp’p’p’p’

Page 17: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Searching for the minimum area triangle

� line by line, going over all the relevant vertices

17

Page 18: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

How much time does it take?� computing the bounding box

� naively O(n2); can be done in O(n log n)� finding where to insert line i

� simple, O(i)inserting line i� inserting line i� O(zone complexity)

� searching for the minimum area triangle for one line� O(zone complexity)

18

Page 19: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

The zone of a curve� the zone of a curve ɣ in an arrangement A is the

collection of faces of A intersected by ɣ � the complexity of the zone is the overall complexity of

cells of various dimensions in the closure of the zone� we need: the complexity of the zone of a line in an

arrangement of i lines

19

arrangement of i lines

Page 20: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Zone theorem� theorem: the complexity of the zone of a line in anarrangement of i lines is O(i)� proof:

20

Page 21: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

How much time does it take?� computing the bounding box

� naively O(n2); can be done in O(n log n), exercise� finding where to insert line i

� simple, O(i)� inserting line i� inserting line i

� O(zone complexity) = O(i)� searching for the minimum area triangle for

one line� O(zone complexity) = O(i)

� Overall O(n2) time21

Page 22: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Summary, a tour of “solving it with arrangements”: the minimum area triangle

� transforming to arrangements, duality� combinatorial analysis zone theorem� design of data structures: Dcel / design of data structures: Dcel /

algorithms: incremental� implementation

22

Page 23: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Minimum area triangle, notes� the solution to the minimum-area-triangle problem

[Chazelle-Guibas-Lee 84]� the solution for any fixed dimension (minimum volume

simplex) appears in Edelsbrunner's book (1987)� the efficiency of the solution in any dimension relies on a

hyperplane zone theorem [Edelsbrunner-Seidel-Sharirhyperplane zone theorem [Edelsbrunner-Seidel-Sharir93]

� no better solution is known to the problem; related to the so-called 3-sum hard problems

� see also Ch 8 of the book Computational Geometry by de Berg et al, for the incremental construction of arrgs of lines

23

Page 24: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Overview� Part I, A first tour of “solving it with arrangements”:

The minimum area triangle problem� duality, dcel, incremental construction, zone

� Part II, Generalizations� transformations

24

� transformations� different types of arrangements� alternative representation� construction by sweeping� other substructures: complexity and algorithms

Page 25: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Transformation to arrangements� various dualities, Plücker coordinates, the

locus method (configuration space, Minkowski sums), and numerous other

� we will see a few more later in the course

25

Page 26: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Variety of 2D arrangements

� major complications� faces can have convoluted shapes� the algebra becomes more involved

26

Page 27: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Vertical decomposition

� the complexity in the plane O(arrg-complexity)� n interior-pairwise-disjoint segments in a bounding box

at most 3n+1 trapezoids� extends to higher dimensions and “well-behaved” surfaces� partial decomposition

27

Page 28: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Construction by sweeping� sweeping a vertical line� status line: intersecting curves in order� events: endpoints and intersection points� event queueevent queue� complexity for arrg of n “well-behaved”

curves: O(arrg-complexity x log n) � a possible by-product within the same

running time: the vertical decomposition

28

Page 29: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Sweep vs. incremental construction� efficiency (in theory) for line arrangement� what about other types of arrangements?

� the sweep has the same complexity for n “well-behaved” curves (constant # of pairwiseintersections): O(arrg-complexity x log n)intersections): O(arrg-complexity x log n)

� for incremental construction:zone theorem for curves?

29

Page 30: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Substructures: envelope, single face, zone

30

Page 31: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Davenport-Schinzel sequences� n,s positive integers� U = <u1, …, um> a seq of integers� U is called an (n,s) DS sequence if

� ∀i 1 ≤ i ≤ n∀i < m, u ≠ u� ∀i < m, ui ≠ ui+1

� there do not exist s+2 indices i1<i2<…<is+2 so that ui1=ui3=…=j and ui2=ui4=…=k for two distinct numbers 1 ≤ j,k ≤ n

(we call it DS Seq of order s on n symbols, or DS(n,s) for short)� λs(n ) = max { |U| | U is a DS(n,s) }

31

Page 32: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Lower envelopes� F={f1,f2,…,fn} :a set of continuous function

defined over an interval I, every pair intersect in at most s points

� m: the minimal number of subintervals such that over each of them the lower envelopes is over each of them the lower envelopes is uniquely defined by a function of F with index ui

� let U(f1,f2,…,fn) = <u1,u2,…,um>

32

Page 33: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

DS sequences and envelopes� claim 1: U(f1,f2,…,fn) is a DS(n,s)� Claim 1': for every DS(n,s) U, there exist

functions g1,…,gn such that U(g1,…,gn) = U

for functions f partially denied over Ifor functions fi partially denied over I� claim 2: U(f1,f2,…,fn) is a DS(n,s+2)� Claim 2': for every DS(n,s+2) U, there exist

partially defined functions g1,…,gn such that U(g1,…,gn) = U

33

Page 34: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

The maximum complexity of envelopesnamely the maximum value of λs(n ) (or λs+2 (n ))

λ1(n ) = nλ2(n ) = 2n-12λ3(n ) = take I: O(n log n)

λs(n ) = take I: O(n log*n)

34

Page 35: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

The maximum complexity of envelopesnamely the maximum value of λs(n ) (or λs+2 (n ))

λ1(n ) = nλ2(n ) = 2n-12λ3(n ) = θ(nα(n))

λs(n ) = see references

35

Page 36: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Constructing envelopes� divide & conquer� Hershberger’s improvement

36

Page 37: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

The complexity of a single face� with some care show that the appearance of

curves along a CCB of the marked face constitute a DS sequence

� The complexity of a face in an arrg where each pair of curves intersect at most s times each pair of curves intersect at most s times is� O(λs(n)) for unbounded curves,� O(λs+2 (n )) for bounded curves, � O(λs+1 (n )) for curves bounded on one side

37

Page 38: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Constructing a single face� deterministic algorithm, O(λs+2 (n )log2n) time� randomized algorithms, expected

O(λs+2 (n )log n) time� λs+2 (n ) replaced by λs(n ) for unbounded

curvesλs+2 (n ) replaced by λs(n ) for unbounded curves

� for bounded curves: the complexity and construction of the zone follows

38

Page 39: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

Operations on arrangements� traversals� point location� overlay

� Boolean operations

39

Page 40: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

What of it is in arrangements?

almost everything:� different families of curves (in the form of traits classes)� Dcel and traversals� point location: simple, walk-along-a-line, RIC-based,

landmarkslandmarks� incremental and zone construction� vertical decomposition� envelopes� overlay� Boolean operations� all extended to a families of parametric surfaces

40

Page 41: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

References� [Sharir -Agarwal '95]

Davenport-Schinzel Sequences and Their Geometric Applications, Cambridge U Press

� [Halperin '04] Arrangements (Ch 24), in CRC Handbook Arrangements (Ch 24), in CRC Handbook

on Discrete and Computational Geometry� [Agarwal-Sharir '00]

Chapters 1&2 in NH Handbook of Computational Geometry

41

Page 42: APPLIED aspects of COMPUTATIONAL GEOMETRYacg.cs.tau.ac.il/courses/applied-computational... · APPLIED aspects of COMPUTATIONAL GEOMETRY Arrangements, 2D Dan Halperin School of Computer

THE END

42