3. Polygon Triangulation

Slides:



Advertisements
Similar presentations
Two Segments Intersect?
Advertisements

Polygon Triangulation
Computational Geometry
Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
 Distance Problems: › Post Office Problem › Nearest Neighbors and Closest Pair › Largest Empty and Smallest Enclosing Circle  Sub graphs of Delaunay.
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.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Triangulation (Naive)
POLYGON TRIANGULATION POLYGON TRIANGULATION THE ART GALERY PROBLEM SİNEM GETİR COMPUTER GRAPHIC SEMINAR FEBRUARY 4, 2009.
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.
By Groysman Maxim. Let S be a set of sites in the plane. Each point in the plane is influenced by each point of S. We would like to decompose the plane.
Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.
Feb Polygon Triangulation Shmuel Wimer Bar Ilan Univ., School of Engineering.
ADA: 16. CG Topics1 Objective o an examination of four important CG topics o just a taster of a very large research area Algorithm Design and Analysis.
Zoo-Keeper’s Problem An O(nlogn) algorithm for the zoo-keeper’s problem Sergei Bespamyatnikh Computational Geometry 24 (2003), pp th CGC Workshop.
G UARDING A RT G ALLERY By: Venkatsai Bhimanthini Fall’2014.
Intersections. Intersection Problem 3 Intersection Detection: Given two geometric objects, do they intersect? Intersection detection (test) is frequently.
Voronoi Diagram Presenter: GI1 11號 蔡逸凡
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Lecture 2 Polygon Partitioning Thursday,
Computational Geometry -- Voronoi Diagram
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Lecture 2 Chapter 2: Polygon Partitioning.
Randomized Planning for Short Inspection Paths Tim Danner Lydia E. Kavraki Department of Computer Science Rice University.
Polygon Triangulation Computational Geometry, WS 2007/08 Lecture 9 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 2 Chapter 2: Polygon Partitioning.
Polygon Triangulation Computational Geometry, WS 2006/07 Lecture 8, Part 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Art Gallery Theorem Computational Geometry, WS 2006/07 Lecture 8, Part 1 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
The Art Gallery Problem
Brute-Force Triangulation
Computational Geometry Piyush Kumar (Lecture 4: Planar Graphs, Polygons and Art Gallery) Welcome to CIS5930.
The Art Gallery Problem
Efficient Partition Trees Jiri Matousek Presented By Benny Schlesinger Omer Tavori 1.
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
Triangulating a monotone polygon
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.
1 Triangulation Supplemental From O’Rourke (Chs. 1&2) Fall 2005.
V Spanning Trees Spanning Trees v Minimum Spanning Trees Minimum Spanning Trees v Kruskal’s Algorithm v Example Example v Planar Graphs Planar Graphs v.
Arrangements and Duality Sanjay Sthapit Comp290 10/6/98.
Computational Geometry Polygon Triangulation and The Art Gallery Problem Joachim Gudmundsson NICTA, Sydney.
1/29/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries Carola Wenk.
The Art Gallery Problem Bart Verzijlenberg. Agenda Problem Problem Chvátal’s Classical Art Gallery Theorem Chvátal’s Classical Art Gallery Theorem Proof.
Contest Algorithms January 2016 Triangulation & the Art Gallery Problem Contest Algorithms1.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
Polygon Triangulation
Computational Geometry
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
Computational Geometry
Introduction to Spatial Computing CSE 555
Computer Graphics Filling.
Advanced Algorithms Analysis and Design
Introduction to Polygons
Query Processing in Databases Dr. M. Gavrilova
Tucker, Applied Combinatorics, Sec 2.4
Planarity Testing.
The Art Gallery Problem
Computational Geometry Capter:1-2.1
The Art Gallery Problem
Polygon Triangulation
Depth Estimation via Sampling
Convex Sets & Concave Sets
I. The Problem of Molding
CHAPTER 33 Computational Geometry
Computational Geometry
Presentation transcript:

3. Polygon Triangulation Iwama lab M1 Naoki Hatta

How to minimize # of cameras…. Introduction We consider about the security in the art gallery Owner wants to minimize the number of cameras How to minimize # of cameras….

preliminary simple polygon We consider about only simple polygons. regions enclosed by a single closed polygonal chain that does not intersect itself a simple polygon NOT a simple polygon We consider about only simple polygons.

example A convex polygon can always be guarded with one camera. Finding the minimum number of cameras for a given polygon is NP-hard For any simple polygon with n vertices, we will give a worst-case bound. convex polygon 1 camera 3 camera

Triangulation A simple polygon may be a complicated shape. So, we decompose it into triangles. Drawing diagonals between pairs of vertices without intersecting. Many different ways of triangulation exist.

Theorem 3.1 Every simple polygon admits a triangulation, and any triangulation of a simple polygon with n vertices consists of exactly n-2 triangles. n=5 T= 3 n=19 T= 17

Proof We prove this by induction. case n=3 Clearly, 1 triangle exists. n=19 T= 17 We prove this by induction. case n=3 Clearly, 1 triangle exists. case n=m (m<n) We assume that the theorem is true. case n=n Any diagonal cuts P into 2 simple subpolygons(P1,P2). Let m1 and m2 be # of vertices of P1 and P2. Total vertices increase 2 by cutting, thus m1 + m2 = n + 2. However, # of triangles do not change, so (m1 - 2)+(m2 - 2)= n-2 triangles. decompose n=16 T= 14 n=5 T= 3

Does a diagonal always exist? v u Choose one vertex (v) and connect two neighbors(w, u), we get a diagonal wu. If there are vertices inside △vuw, wu is not a diagonal, but vv’ cannot intersect an edge of a polygon, so vv’ is a diagonal . w v u v’ In conclusion, a diagonal always exists. v’: the vertex farthest from uw

By the way, how many cameras are needed? on each triangle on well-chosen diagonals on well-chosen vetices n=19 T= 17 17 cameras 9 cameras 6 cameras n-2 roughly n/2 roughly n/3

Therorem 3.2 For a simple polygon with n vertices, cameras are occasionally necessary and always sufficient to have every point in the polygon visible from at least one of the cameras. 3-Coloring The coloring will be such that any two vertices connected by an edge or a diagonal have different colors. any triangles have each 3 color vertices Set cameras on one color vertices, all triangles are covered. Thus, cameras are sufficient.

Does 3-coloring always exist? Consider about dual graph. The edge of dual graph corresponds to a diagonal of the original graph. Dual graph is a tree. Coloring algorithm Step 1: Choose one vertex on dual graph and color the three vertices of the triangle. Step 2: Depth first search (O(n) time) Step 3: color the remining vertex on the next triangle without same colored vertex. Step 4: Go to step2

Is this limit? needles and n vertices Look at this example. ・・・ An instance which needs cameras to cover exists. Thus, the worst case bound is and it is optimal. cameras are needed.

? How to triangulation?? We notice that cameras is sufficient, but how to triangulation actually? And how long does it take to compute this? 3-coloring INPUT OUTPUT ? doubly connected edge list triangulated list

? Trivial algorithm In worst case computation time is O(n^2) n vertices 1 vertex + n-1 vertices O(n) In worst case computation time is O(n^2)

Outline of efficient algorithms ? Make Monotone Algorithm Triangulation Algorithm O(nlogn) O(n)

Monotone y–monotone : A simple polygon is y-monotone if for any line perpendicular to y-axis the intersection of the polygon with the line is connected. y-monotone NOT y-monotone

Make Monotone Algorithm INPUT: A simple polygon OUTPUT: Some simple polygons which are y-monotone We distinguish five types of vertices. start vertex : ① and ③ end vertex : ① and ④ regular vertex : else split vertex : ② and ③ merge vertex : ② and ④ ① interior angle is less than π ② interior angle is greater than π ③ neighbors lie below ④ neighbors lie above ※if two vertices have same y-coordinate, let the left one be the “above” vertex.

Lemma 3.4 A polygon is y-monotone if it has no split vertices or merge vertices. Proof Suppose a polygon is not y-monotone, scan edges from p(second vertex from most left), then have to meet a split or merge vertex, until reaching the next intersection. split vertex q p r q p r merge vertex

detail of algorithm Step1 : Sort vertices by y-coordinate and By Lemma3.4, we should remove a split and merge vertices. sweep line v5 e4 v3 v6 e3 Find diagonals to decompose a polygon into y-monotone polygons without such vertices. v4 e2 v7 v9 e1 v1 v2 v8 Step1 : Sort vertices by y-coordinate and set event queue Step2 : Check type of each vertices by neighbors Step3 : Plane sweep algorithm using the queue Step4 : At a vertex, work the algorithm which corresponds to type of it v14 v10 v15 v11 v12 v13 event queue v5 v3 v4 v6 … start merge regular

definition of helper helper(ej) : The lowest vertex above the sweep line such that the horizontal segment connecting the vertex to ej lies inside a polygon. sweep line v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 e1 e2 e3 e4 1 3 1 helper(e3) = v3 helper(e5) = v5 helper(e7) = v2 helper(e9) = v8 2 2 helper(e3) = v3 helper(e5) = v4 3 When sweep line is on a split or merge vertex, if we connect the vertex to helper(ek) (ek is the left edge of it), the line is a good diagonal.

work like this We use a binary search tree in order to save the way to the edges against vertices v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 e1 e2 e3 e4 1 binary search tree 1 helper(e5) = v5 2 helper(e3) = v3 3 2 helper(e5) = v4 4 helper(e3) = v3 5 7 5 6 3 3 Get a diagonal !! helper(e6) = v6 helper(e3) = v3 9 7 3 1 4 ……

Computation time Computation time is O(nlogn) Preprocessing : binary search tree Preprocessing : Sorting in O(nlogn) time At one event search in O(logn) time insert and delete in O(1) time n vertices 9 7 3 1 Computation time is O(nlogn)

Triangulation Algorithm INPUT: A y-monotone polygon OUTPUT: Some triangles Scan the vertices from above, and cut out the triagnles using a stack. v1 v2 v3 v4 v5 v12 v11 v10 v9 v8 v7 v6 Step 1 : Search a vertex and check the stacked vertices If we get three vertices then If the triangle is outer of the polygon, then stack the vertices. else add a diagonal as much as possible Step 2 : Goto step 1

Work like this v1 v2 v3 v4 v5 v12 v11 v10 v9 v8 v7 v6 stack v8 v9 v10

Computation time Computation time is O(n) Vertices are already sorted At one vertex push happens at most twice pop happens at most 2n times Computation time is O(n)

algorithm of each type start vertex(vi) : Insert ei in T and set helper(ei) to vi end vertex(vi) : Insert ei in T and set helper(ei) to vi v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 e1 e2 e3 e4