Computational Geometry Piyush Kumar (Lecture 4: Planar Graphs, Polygons and Art Gallery) Welcome to CIS5930.

Slides:



Advertisements
Similar presentations
Polygon Triangulation
Advertisements

Divide and Conquer. Subject Series-Parallel Digraphs Planarity testing.
Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
Convex drawing chapter 5 Ingeborg Groeneweg. Summery What is convex drawing What is convex drawing Some definitions Some definitions Testing convexity.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
CompSci 102 Discrete Math for Computer Science April 19, 2012 Prof. Rodger Lecture adapted from Bruce Maggs/Lecture developed at Carnegie Mellon, primarily.
Brute-Force Triangulation
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
One of the most important problems is Computational Geometry is to find an efficient way to decide, given a subdivision of E n and a point P, in which.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
I. The Problem of Molding Does a given object have a mold from which it can be removed? object not removable mold 1 object removable Assumptions The object.
Convex Hulls in 3-space Jason C. Yang.
Feb Polygon Triangulation Shmuel Wimer Bar Ilan Univ., School of Engineering.
Applied Combinatorics, 4th Ed. Alan Tucker
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
3. Delaunay triangulation
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
Duality and Arrangements Computational Geometry, WS 2007/08 Lecture 6 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Computational Geometry Seminar Lecture 1
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
Lecture 8 : Arrangements and Duality Computational Geometry Prof. Dr. Th. Ottmann 1 Duality and Arrangements Duality between lines and points Computing.
Polygon Triangulation Computational Geometry, WS 2007/08 Lecture 9 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Art Gallery Theorem Computational Geometry, WS 2006/07 Lecture 8, Part 1 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Duality and Arrangements Computational Geometry, WS 2006/07 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
The Art Gallery Problem
Brute-Force Triangulation
The Art Gallery Problem
Matthew Bowling Euler’s Theorem Mathfest Spring ‘15.
Graph Theory Ch6 Planar Graphs. Basic Definitions  curve, polygon curve, drawing  crossing, planar, planar embedding, and plane graph  open set  region,
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
Graph Theory Chapter 6 Planar Graphs Ch. 6. Planar Graphs.
Triangulating a monotone polygon
Planar Graphs: Euler's Formula and Coloring Graphs & Algorithms Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.:
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
CENG 789 – Digital Geometry Processing 02- Polygons and Triangulations Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.
1 Triangulation Supplemental From O’Rourke (Chs. 1&2) Fall 2005.
Computational Geometry Piyush Kumar (Lecture 10: Point Location) Welcome to CIS5930.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
Arrangements and Duality Sanjay Sthapit Comp290 10/6/98.
Planar Graphs Graph Coloring
Computational Geometry Polygon Triangulation and The Art Gallery Problem Joachim Gudmundsson NICTA, Sydney.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness)
1/29/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries Carola Wenk.
Contest Algorithms January 2016 Triangulation & the Art Gallery Problem Contest Algorithms1.
Great Theoretical Ideas in Computer Science for Some.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
COMPSCI 102 Introduction to Discrete Mathematics.
An Introduction to Computational Geometry: Arrangements and Duality Joseph S. B. Mitchell Stony Brook University Some images from [O’Rourke, Computational.
Polygon Triangulation
Graphs. Representations of graphs : undirected graph An undirected graph G have five vertices and seven edges An adjacency-list representation of G The.
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
Algorithms and Networks
Great Theoretical Ideas In Computer Science
Outline 1 Properties of Planar Graphs 5/4/2018.
Introduction to Spatial Computing CSE 555
Geometric Graphs and Quasi-Planar Graphs
Query Processing in Databases Dr. M. Gavrilova
Tucker, Applied Combinatorics, Sec 2.4
Planarity Testing.
The Art Gallery Problem
The Art Gallery Problem
Polygon Triangulation
I. The Problem of Molding
Computational Geometry
Gaph Theory Planar Graphs
Discrete Mathematics for Computer Science
Presentation transcript:

Computational Geometry Piyush Kumar (Lecture 4: Planar Graphs, Polygons and Art Gallery) Welcome to CIS5930

Definitions Planar Straight Line Graph  No two edges intersect except at endpoints Courtesy Lovasz Every planar graph can be drawn in the plane with straight edges Fáry-Wagner

PSLG A graph is called planar if it can be drawn in the plane in such a way that no two edges intersect except possibly at endpoints. The clique of size 4

PSLG : Definitions A plane graph cuts the plane into regions called faces. 4 faces! 6 edges 4 vertices v – e + f = ?

PSLG What about K 3,3 ?

PSLG Another example v – e + f = ?

Euler 1752 For any connected planar graph G,  vertices – edges + faces = 2 Let v = # of vertices e = # of edges f = # of faces

Why study PSLGs?

PSLG Any planar graph can be triangulated  Draw the planar graph with straight edges  For every face with more than 3 edges oInsert new edges

PSLG Any planar graph can be embedded on the sphere with ‘straight line’ edges  Stereographic projection oWrapping the plane on a sphere

Euler’s Formula: Proof Sum of angles of a triangle? What about a triangle on a sphere? Courtesy Hopf

Formula for the spherical excess Area of a 2-gon = ? Formula for spherical excess?

Euler’s Formula Proof 2v –f = 4; 3f = 2e; and hence v-e+f = 2 Note that f = O(v) and e=O(v)

Food for thought Prove that on a torus  V – e + f = 0 In general for g handles  V-e + f = 2-2g

Euler’s formula extensions In 3D, a polyhedral subdivision can already have e in O(v 2 ) Dehn-Sommerville relations relate the maximum number of edges vertices and faces of various dimensions.

Kuratowski’s Theorem [1930] A graph is planar if and only if it contains no subgraph obtainable from K 5 or K 3,3 by replacing edges with paths.

Graph Coloring A coloring of a graph is an assignment of colors to the vertices of the graph such that the endpoints of every edge has different colors.

Four-Color Theorem [1976] The vertices of any planar graph can be 4-colored in such a way that no two adjacent vertices receive the same color. Appel-Haken

Representing PSLGs Doubly connected edge list Winged Edge Quad Edge Facet edge Split edge, Corner edge obj file format ;)

Obj file format Drawback: How do you find which all vertices a vertex connects to? What if you wanted to jump from a face to an adjacent one?

Half Edges (DCEL) Vertex List  Knows its coordinates  Knows one of its incident edges Face List  Pointer to one of its edges Edges  Split the edge into two records

DCEL: Edge record

Quad Edge Considers the PSLG and its dual

Quad Edge Edge Record  Two vertices, two faces Vertex  A circular list of adjacent edges Face  A circular list of adjacent edges

Quad Edge example

Art Gallery

Visibility inside polygons When is x visible to y if both x and y are inside a polygon P?

Art gallery problem Art Gallery Problem  Art gallery room is a polygon P.  A guard can see all around (360 degrees)  Place G(n) guards such that they cover P.  What is minimum G(n) that is occasionally necessary and always sufficient?

Theorem Every simple polygon admits a triangulation with n-2 triangles. Proof:  Lemma: Every polygon has a diagonal  For a triangle the theorem is true.  Use MI now.

G(n) from previous theorem Every n vertex polygon can be guarded using n-2 cameras. (Why?) What if we place the cameras on the diagonals? (n-3 diagonals / 2) What about vertices?  If we place a guard on a vertex, it can cover all the triangles incident on the vertex.

3-colorablity of polygon triangulations If T be a triangulation of a polygon P, then the vertices of P can be 3-colored.

Why can we do 3-coloring? Look at the dual graph of the polygon triangulation. What is the maximum degree of the dual? Each edge of the dual is associated with a diagonal of the polygon. Removal of each edge of the dual splits the dual into two connected components

Why can we do 3-coloring The dual is a free tree  No cycles  Every free tree has a leaf (An EAR) Proof of 3-colorability  Use MI  For a triangle its trivial  For a polygon P, color and remove an ear, by induction, we are done!

The Art Gallery Theorem Given a simple polygon with n vertices there exists a set of g(n) = floor(n/3) guards that can cover it. Proof: Use vertex guards: the minimum cardinality vertex set of same color in the 3-coloring of the polygon triangulation.

Art Gallery theorem In the following example you would use red.

Art Gallery Theorem Let r <= g <= b be the number of nodes colored with red, green and blue colors (w.l.o.g) Can r > n/3? If not, then r <= n/3 But r has to be an integer So r must be <= floor(n/3) For what kind of Polygon is r = floor(n/3)?

Polygon Triangulation Triangulation of a polygon refers to the decomposition of P into triangles using non-intersecting diagonals such that no more diagonals can be further added.  A maximal set of non-intersecting diagonals.

Polygon Triangulation Naïve algorithm?  Find diagonal, add it, recurse  T(n) = T(n-1) + O(n 2 )*n = O(n 3 ) Less Na ï ve?  Find diagonal using existence theorem  T(n) = T(n-1) + O(n) = O(n 2 ) What about O(n) or O(nlogn)?

History O(nlogn) Monotone pieces 1978 O(nlogn) D&C 1982 O(nlogn) Plane Sweep 1985 O(nlog*n)Randomized 1991 O(n)Polygon cutting, 1991 O(n)Randomized 2000 O(n) implementable with small constants? ??

What about point set triangulation? A triangulation T of V is a set of triangles such that  Each t in T is incident on 3 vertices of V and does not contain any other vertex  If t1, t2 in T => t1 does not intersect t2  T is a decomposition of the convex hull of V.

Point Set Triangulation

Point Set triangulation Can be built using one vertex at a time. Three cases  New point outside current convex hull  New point inside triangle  New point on an edge of the current triangulation

Back to Polygon Triangulations Courtesy Martin Held

Polygon Triangulation Partition the polygon into monotone pieces O(nlogn) Triangulate them in O(n) time

Monotone polygons A polygon is x-monotone if the intersection of P with a vertical line is connected ( a point, a line segment or O ).

Monotonicity in x Implies you can sort all the x- coordinates of the vertices in O(n) implies that there are no “cusps”.  A reflex vertex is a vertex with internal angle > π  A reflex vertex is a cusp if its neighbors both lie to the left or to the right of the vertical line.

Monotone polygons => no cusps Th: Any polygon that contains no cusps is monotone. Proof: We will prove that any polygon that is non-monotone has a cusp. Lets assume that P’ is a non-monotone polygon due to its upper chain. Let v1, v2…vk be its upper chain and vi be the first vertex such that v(i+1) lies left to vi.

Monotone polygons => no cusps The vertex leftmost from vi…in the chain vi to vk….has to be a cusp.

Polygon Triangulation First we partition the polygon into polygons without cusps. (Remove all cusps). O(nlogn) Then we triangulate all the monotone polygons. O(n)

Polygon Triangulation Sweep from left to right.  Remove leftward pointing cusps Sweep right to left  Remove rightward pointing cusps Triangulate all monotone polygons

Regularization Remove all cusps that point in the same direction

Regularization Regularize from left to right removing all leftward pointing cusps Exactly in the same way, Regularize from right to left removing all rightward pointing cusps

Regularization Once you find a leftward pointing cusp, how do you find a diagonal?

Regularization Once you find a leftward pointing cusp, how do you find a diagonal?

Monotone Polygon Triangulation Greedy Algorithm  Sweep from left to right adding diagonals whenever you can.

Greedy plane sweep Sort vertices from left to right in O(n) Process vertices from left to right Stack keeps vertices that have been encountered but not yet used in a diagonal. When a vertex is encountered add as many diagonals as you can  Each diagonal removes a triangle and a vertex from the stack

Vertices on Stack: A Funnel Courtesy Nancy Amato One boundary is chain of reflex vertices except for rightmost vertex (top of stack). Other boundary is (partial) edge. (We have not seen bottom endpoint yet). Sweepline Invariant: Vertices on the stack conform to this funnel structure.

Vertices on Stack: A Funnel Split off triangle Funnel Partial Edge Reflex chain Last encountered vertex

What happens when we encounter a new vertex? Case 1: Vj is on the side opposite the reflex chain on the stack  Easy case: Can add diagonals from Vj to all vertices on reflex chain except Vi VjVj VkVk ViVi Stack pop all push vj,vk

What happens when we encounter a new vertex? Case 2: Vj is on the same side as the reflex chain on the stack VjVj Popped and pushed The only interesting case in this case, If Vj extends the reflex chain, we just need to push it on the stack

Case 2 Can add diagonals from Vj to a consecutive set (possibly empty) of vertices in its same reflex chain (starting from the top of the stack/rightmost vertex. Check each vertex in turn until finding one that does not make a diagonal

Homework Textbook question 3.11

New Problem Given a set of half-planes, compute their intersection in O(nlogn) time.  How can we do it using what we know?

Projective Geometry Basic Elements:  Points, Lines and Planes Studies properties of geometric figures that remain unchanged under projection Lengths and ratios of lengths are NOT invariant under projection Asserts parallel lines meets at infinity

Duality The most remarkable concept in projective geometry The terms point and line are dual and can be interchanged in any valid statement to yield another valid statement

Example A line contains at least 3 collinear points of the plane. A point contains at least 3 coincident lines of the plane. Point  Line Join  Intersection Collinear  Coincident

Duality in higher dimensions? In space, the terms plane, line, and point are interchanged with point, line, and plane, respectively, to yield dual statements

Point Line Duality Duality is usually denoted by a * in the superscript. A point and line are uniquely determined by two parameters.  p = (a,b) is mapped to p*: y = ax– b  l: y = ax - b is mapped to l* = (a, b) Characteristics ((p*)*) = p p lies above l iff l* lies above p* p = (px, py) lies on l: y = ax-b iff l* lies on p*

Property : p lies above l iff l* lies above p* p = (p x, p y ) (p x,ap x - b) l: y = ax-b p lies above l p y > ap x - b l* = (a,b) p*: y = p x x - p y (a, p x a – p y ) l* lies above p* b > p x a – p y iff p y > p x a - b Characteristics of the duality transform

Summary Observations: 1. Point p on straight line l iff point l * on straight line p * 2. p above l iff l * above p *

New Problem Given n lines, compute the lower envelope of these lines in O(nlogn) time.