Line Arrangement. Chapter 6

Similar documents
Line Arrangements. Applications

An Introduction to Computational Geometry: Arrangements and Duality

10. Line Arrangements Lecture on Monday 2 nd November, 2009 by Michael Homann

Computational Geometry Lecture Duality of Points and Lines

Chapter 11. Line Arrangements

Computational Geometry

CS 532: 3D Computer Vision 14 th Set of Notes

Orthogonal Ham-Sandwich Theorem in R 3

Figure 1: Two polygonal loops

Stabbers of line segments in the plane

CS6100: Topics in Design and Analysis of Algorithms

Lecture 3: Art Gallery Problems and Polygon Triangulation

Partitioning Orthogonal Polygons by Extension of All Edges Incident to Reflex Vertices: lower and upper bounds on the number of pieces

Pebble Sets in Convex Polygons

Notes and Answers to Homework Exam 1, Geometric Algorithms, 2017

The Visibility Problem and Binary Space Partition. (slides by Nati Srebro)

Chapter 9. Line Arrangements

For a set S of line segments, a separator can be found using duality. Under duality, the segments transform to double wedges, and a separator line tra

2D Geometry. Pierre Alliez Inria Sophia Antipolis

Polygon decomposition. Motivation: Art gallery problem

Fortune s Algorithm. Notes from the book by de Berg, Van Krevald, Overmars, and Schwarzkpf

Lecture 16: Voronoi Diagrams and Fortune s Algorithm

CHAPTER 2 REVIEW COORDINATE GEOMETRY MATH Warm-Up: See Solved Homework questions. 2.2 Cartesian coordinate system

Line segment intersection. Family of intersection problems

Polygon Triangulation

Computational Geometry: Lecture 5

Lattice Polygon s and Pick s Theorem From Dana Paquin and Tom Davis 1 Warm-Up to Ponder

The Geodesic Integral on Medial Graphs

Voronoi diagrams Delaunay Triangulations. Pierre Alliez Inria

Week 7 Convex Hulls in 3D

arxiv: v1 [cs.cg] 8 Jan 2018

CMSC 425: Lecture 9 Geometric Data Structures for Games: Geometric Graphs Thursday, Feb 21, 2013

On the number of distinct directions of planes determined by n points in R 3

Inversive Plane Geometry

Glossary of dictionary terms in the AP geometry units

January 10-12, NIT Surathkal Introduction to Graph and Geometric Algorithms

Chapter 8. Voronoi Diagrams. 8.1 Post Oce Problem

BMO Round 1 Problem 6 Solutions

Convex Hulls in Three Dimensions. Polyhedra

Crossing Families. Abstract

Computational Geometry

Trapezoidal Maps. Notes taken from CG lecture notes of Mount (pages 60 69) Course page has a copy

Elementary Planar Geometry

Math 777 Graph Theory, Spring, 2006 Lecture Note 1 Planar graphs Week 1 Weak 2

Computational Geometry

Polygon Partitioning. Lecture03

Planar graphs. Chapter 8

3. Voronoi Diagrams. 3.1 Definitions & Basic Properties. Examples :

Discrete Mathematics I So Practice Sheet Solutions 1

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality

Chapter 3. Sukhwinder Singh

2 Geometry Solutions

1 The range query problem

Computational Geometry

INTRODUCTION TO THE HOMOLOGY GROUPS OF COMPLEXES

1. CONVEX POLYGONS. Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D.

On Computing the Centroid of the Vertices of an Arrangement and Related Problems

Computational Geometry

Theoretical Computer Science

Connected Components of Underlying Graphs of Halving Lines

The Helly Number of the Prime-coordinate Point Set

Basics of Computational Geometry

Polygon Triangulation. (slides partially by Daniel Vlasic )

Voronoi Diagram. Xiao-Ming Fu

Polygon Filling. Can write frame buffer one word at time rather than one bit. 2/3/2000 CS 4/57101 Lecture 6 1

COMPUTATIONAL GEOMETRY

Caltech Harvey Mudd Mathematics Competition March 3, 2012

Flavor of Computational Geometry. Voronoi Diagrams. Shireen Y. Elhabian Aly A. Farag University of Louisville

CMSC 754 Computational Geometry 1

Chapter 7 Coordinate Geometry

THE THIRD JTST FOR JBMO - Saudi Arabia, 2017

CSE 5311 Notes 13: Computational Geometry

CAD & Computational Geometry Course plan

7th Bay Area Mathematical Olympiad

Definitions. Topology/Geometry of Geodesics. Joseph D. Clinton. SNEC June Magnus J. Wenninger

Scheduling, Map Coloring, and Graph Coloring

The Art Gallery Problem: An Overview and Extension to Chromatic Coloring and Mobile Guards

Computational Geometry Exercise Duality

Week 8 Voronoi Diagrams

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Fall, 2012

MISCELLANEOUS SHAPES

Exercise set 2 Solutions

Indiana State Math Contest Geometry

Computational Geometry

Planar Point Location


H 2 H 3 H 4. (a) (b) (c)

Optimal detection of intersections between convex polyhedra

Delaunay Triangulations

Lifting Transform, Voronoi, Delaunay, Convex Hulls

Solutions to the ARML Power Question 2006: The Power of Origami

Rubber bands. Chapter Rubber band representation

CSCI 4620/8626. Coordinate Reference Frames

Planarity. 1 Introduction. 2 Topological Results

About Graphing Lines

5 Graphs

DEFINITIONS. Perpendicular Two lines are called perpendicular if they form a right angle.

If three points A (h, 0), P (a, b) and B (0, k) lie on a line, show that: a b 1.

Three applications of Euler s formula. Chapter 10

Solutions to problem set 1

Transcription:

Line Arrangement Chapter 6

Line Arrangement Problem: Given a set L of n lines in the plane, compute their arrangement which is a planar subdivision.

Line Arrangements Problem: Given a set L of n lines in the plane, compute their arrangement which is a planar subdivision. Planar subdivision: stored in a DCEL data structure.

Theorem: The complexity of the arrangement of n lines is Θ(n 2 ) in the worst case (non degenerate situation) Number of vertices : Θ(n 2 ) (n 1 vertices on each line; total=n(n 1)/2; each vertex is counted twice) Number of edges : n 2 (n edges on each line) Number of faces : Θ(n 2 ) (follows from Euler formula : # faces # edges + # vertices = 2) In degenerate situation when all lines pass through a single point (number of vertices = 1), the number of edges and faces are linear in n.

Line Arrangement Goal: compute this planar map (as a DCEL) Algorithm: Use an incremental algorithm: (add one line at a time and update the DCEL structure) We will construct the arrangement inside a rectangular box.

An incremental algorithm: Input: A set L of n lines in the plane and a bounding box B. Output: The DCEL structure of the arrangement A(L) inside a bounding box.

What happens when a line is added? Consider the arrangement of i lines

What happens when a line is added? Consider the arrangement of first i lines. We now insert the (i+1) th line. Without any loss of generality, suppose the inserted line is horizontal.

What happens when a line is added? Consider the arrangement of first i lines. We now insert the (i+1) th line. Faces affected

Zone Theorem Zone of a line l: The zone of a line l in an arrangement A(L) is the set of faces of A(L) whose closure intersectsl. The complexity of a zone (z n ) of A(L) is the total complexity of all the faces: the total sum of edges (or vertices) of these faces. Theorem: z n 6n where L = n.

What happens when a line is added? Consider the arrangement of first i lines We now insert the (i+1) th line. Count the number of left bounding edges. Show that there are no more than 3n left bounding edges in the event of no degeneracy.

Zone Theorem (left bounding edges): Theorem: The number of left bounding edges in the zone of a line in A(L) is at most 3n.

By induction on n; for n=1, it is trivial. Suppose the zone complexity is true for any arrangement of m lines, m < n. For any n > 1: Let l right be the rightmost line intersecting l n, the line being inserted. Without any loss of generality we assume that l n is horizontal. We now remove the line l right. By the induction hypothesis, the zone of l n in A(L {l right }) has at most 3(n 1) left bounding edges. When adding l right back, the number of left bounding edges in the zone of l n increases as follows: One new left bounding edge on l right. At most two old left bounding edges get split by l right. The zone complexity of l n is at most 3(n 1)+3 3n. The theorem follows from the principle of mathematical induction.

l right is the line with the rightmost intersection with l n l right l n

Removel right l right l n

All left bounding edges in the zone of l n in A (L {l right }) is highlighted l n

Adding l right introduces two extra left bounding edges in this case l right l n

Adding l right introduces two (three) extra left bounding edges l right l n

Zone Theorem (right bounding edges): Similarly we can show that Theorem: The number of right bounding edges in the zone of a line in A(L) is at most 3n.

Constructing the Arrangement The time insert the (i+1) th line is linear in the complexity of the zone, which is linear in the number of existing lines (i.e. i). Therefore, the total running time of the incremental algorithm is O(n 2 ) + = O(n 2 ) Finding a bounding box Finding the left entry point According to the zone theorem Note: Bound doesn t depend on the insertion order.

Applications of Arrangement Sweeping Arrangements We know the arrangement of n lines can be constructed in O(n 2 ) time, which is optimal. For some instances, any graph traversal would suffice. For other problems, we need traversal in some order, for example as a plane sweep from left to right. Requires the sweep to stop at every intersection point of the lines. This implies O(n 2 logn) time algorithm requiring O(n) space. There is more sophisticated version of the sweep, called topological plane sweep. The plane is swept by a thread, instead of a line. This can be done in O(n 2 ) time and O(n) space. It is applicable in almost all instances where ordinary plane sweep works.

Applications of Arrangements and Duality Duality concept and arrangements allow a large number of problems to be solved. Unless otherwise stated, all problems can be solved in O(n 2 ) time and O(n 2 ) space by constructing a line arrangement, or in O(n 2 logn) time and O(n) space through plane sweep. (In all instances, the extra logn factor can be removed through the use of the topological plane sweep.

Applications of Arrangements and Duality General position test: Given a set of n points in the plane, determine whether any three are collinear. Minimum area triangle: Given a set of n points in the plane, determine the minimum area triangle whose vertices are selected from these points. Minimum k corridor: Given a set of n points, and integer k, determine the narrowest pair of parallel lines that enclose at least k points of the set. The distance between the lines can be defined either as the vertical distance between the lines or the perpendicular distance between the lines. Visibility graphs non intersecting line segments: The vertices are the end points of the segments and two endpoints are visible if the interior of the line segment joining them intersects none of the segments.

Applications of Arrangements and Duality Maximum stabbing line: Given a set of line segments in the plane, compute the line that stabs (intersects) the maximum number of segments. Hidden surface removal: Given a set of n non intersecting polygons in 3 space, imagine projecting these polygons onto a plane (either orthogonally or using perspective). Determine which portions of the polygons are visible from a viewpoint under this projection. In practice, the projected scene is rarely quadratic. O(n 2 ) algorithm is really of theoretical values. Ham Sandwich Cut: Given n red points and m blue points, find a single line that simultaneously bisects these point sets. If the point sets are linearly separable, this can be done in O(n+m) time and space.

Sorting all angular sequences. Consider a set of n points in the plane. For each point p in this set, we want to perform an angular sweep, say in counterclockwise order, visiting the other n 1 points of the set. For each point p, we can order the angles of the points around p in O(nlogn) time per point and O(n 2 logn) overall. With arrangements we can speed this up to O(n 2 ) total time. A point p=(p x,p y ) and line l: (y=ax b) in the primal plane are respectively mapped to a dual point p * and dual line l * where l * = (a,b) and p * : (b=p x a p y ). Suppose p is the point around which we want to sort. Let p 1, p 2,..., p n be the points in the final angular order.

Sorting all angular sequences. Suppose p is the point around which we want to sort. Let p 1, p 2,..., p n be the points in the final angular order. Since the a axis in the dual plane is the slope axis, the intersection points of p i*, i= 1, 2,...,n in increasing order along p * realize the slope ordering around p. This ordering can be determined in O(n) time from the DCEL structure of the arrangement.

Maximum Discrepancy we consider a problem derived from computer graphics and sampling. Suppose that we are given a collection of n points S lying in a unit square U=[0,1] 2. We want to use these points for random sampling purposes. In particular, the property that we would like these points to have is that for any halfplane h, we would like the size of the fraction of points of P that lie within h should be roughly equal to the area of intersection of h with U. If we define μ(h) to be the area of h U, and μ S (h)= S h / S then we would like μ(h) = μ S (h). This property is important when point sets are used for things like sampling and Monte Carlo integration.

Maximum Discrepancy We define the discrepancy of S with respect to a halfplane h to be Δ S (h)= μ(h) μ S (h). In the following figure, μ S (h) = 7/13=0.538; μ(h) = 0.625 Halfplane discrepancy of S is defined to be the maximum (least upper bound) of Δ S (*) over all halfplanes. This is denoted by Δ(S).

Maximum Discrepancy Finiteness criterion Lemma Let h denote the halfplane that generates the maximum discrepancy with respect to S, and let denote the line l that bounds h. Then either (i) l passes through at least two points of S, or (ii) l passes through one point of S, and this point is the midpoint of the line segment l U. Remark: If a line passes through one or more points of S, then should this point be included in μ S (h)? For the purposes of computing the maximum discrepancy, the answer is to either include or omit the point, whichever will generate the larger discrepancy. The justification is that it is possible to perturb h infinitesimally so that it includes none or all of these points without altering μ(h).

Maximum Discrepancy h is determined by two points. There are O(n 2 ) such pairs determining halfplanes. These can be picked from the arrangement easily. Moreover, the number of points lying on both halfplanes can be determined from the arrangment of the dual lines as well. This can be done in O(n 2 logn) time and O(n) space using the sweep method, or O(n 2 ) time and linear space using the topological sweep. h is determined by one point. Every point p realizes at most two placements. There are O(n) such halfplanes, and the discrepancy of each such halfplane can be determined in O(n) time.

Median Level of an Arrangement Consider a set S of n points Without any loss of generality suppose n is odd S S*

Median Level of an Arrangement Consider a set S of n points Without any loss of generality suppose n is odd L L* 3points lie above L 3 lines lie below L*

Median Level of an Arrangement Consider a set S of n points Without any loss of generality suppose n is odd L p p* 4 points lie above and below and p lies on L Any point on the segment has 4 points above and 4 points below

Median Level of an Arrangement Any point on the median level => the corresponding line in the primal plane bisects S Median level

Minimum Area Triangle If points {a, b, c} achieve a minimum area triangle among the points in a given point set P, c is the closest point among P - {a,b} to the line L ab containing ab, where the distance is measured orthogonal to L ab a b c This corridor must be empty if Δabc is the smallest area triangle L ab L c

Minimum Area Triangle Interpret the relationship in the dual arrangement (assuming order preserving dual) L ab L c a b c L ab * a* b* s c* L c * The line segment s must be contained in a face (i.e. no dual line can intersect s, otherwise the corridor is not empty

Problem 4: 219 4 Sections: A point set P in the plane can be partitioned into 4 open wedges by two lines such that each wedge contains no more than points A Find A that splits P into P 1, P 2 ; P 1 = P 2 B B is a ham-sandwich cut of P 1 and P 2 B

Other forms of duality

Duality p : (p x,p y ) => p * : b = p x a p y L : y = ax b => L * : (a,b) Properties: (p * ) * = p (L * ) * = L Incidence: If p, q, r lies on L, p *, q *, and r * contain L * L p q r L * r * q * p *

Duality (properties) Above Below Relationship: If p lies above L, then L * lies above p * L p L * p * Y distance is Preserved: L: y = ax -b P : (p x,p y ) L * : (a,b) p * : b = p x a-p y Y-distance of p to L =p y - (ap x -b) Y-distance of L* to p* = b- (p x a-p y )

Duality (properties) Vertical line does not dualize => singular (0,0) does not dualize either Polar Duality p: (a,b) => p * : ax + by + 1 = 0 L : ax +by + 1 = 0 => L * : (a,b) L d p = (a,b) 1/d

Polar Duality Incidence Property is Preserved: p: (c,d) L*: (a,b) L: ax + by + 1 = 0 p*: cx + dy = 1

Polar Duality Above Below Relationship p: (α,β) 1/t L* t 1/d d L: ax + by + 1 = 0 If p lies above the line L, p* lies above L*. (order does not change Singularity Any line through the origin Point (0,0) p*

Duality (from the text) p: (a,b) => p*: y = 2ax b L: y = 2ax b => L* : (a,b) y = x 2 L 1 L 2 : y = 2ax b 1 p 1 = (a, b 2 ) L 3 p 3 * p 2 * b 2 b 1 b 1 b 0 p 2 = (a, b 1 ) p 3 = (a, b 0 ) b 2 b 1 = b 1 b 0 p 3 = L 1 * p 2 = L 2 * p 1 = L 3 * p 1 * Can be shown that if p is above L, then L* is above p*

Order Preserving Duality p : (a,b) => p* : ax + by + 1 = 0 L : ax + by + 1 = 0 => L* : (a,b) a b h c g d f e Dual a* b* c* d* h* g* f* (ab)* (ef)* e*

Duality Order Preserving Duality Envelope Theorem: Computing the lower (upper) envelope of a set L of lines is equivalent to computing the lower (upper) convex hull of the set L* of points Non-order Preserving Duality Envelope Theorem: Computing the lower (upper) envelope of a set L of lines is equivalent to computing the upper (lower) convex hull of the set L* of points

Problem 4: 219 4 Sections: A point set P in the plane can be partitioned into 4 open wedges by two lines such that each wedge contains no more than points A Find A that splits P into P 1, P 2 ; P 1 = P 2 B B is a ham-sandwich cut of P 1 and P 2 B