Contest Algorithms January 2016 Triangulation & the Art Gallery Problem Contest Algorithms1.

Slides:



Advertisements
Similar presentations
Polygon Triangulation
Advertisements

Brute-Force Triangulation
EECS 4101/5101 Prof. Andy Mirzaian. References: [M. de Berge et al ’00] chapter 3 [Preparata-Shamos’85] chapter 6 [O’Rourke’98] chapter 1 [M. de Berge.
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
Fundamentals of computational geometry M. Ramanathan STTP CAD 2011.
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)
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
3.4 The Polygon Angle-Sum Theorems
Classes of Polygons Planar polygons Non-planar polygons Simple
The Maths of Pylons, Art Galleries and Prisons Under the Spotlight John D. Barrow.
Feb Polygon Triangulation Shmuel Wimer Bar Ilan Univ., School of Engineering.
How are polygons classified?
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.
G UARDING A RT G ALLERY By: Venkatsai Bhimanthini Fall’2014.
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,
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.
Art Gallery Problems Prof. Silvia Fernández. Star-shaped Polygons A polygon is called star-shaped if there is a point P in its interior such that the.
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.
1.4 Perimeter and Area in the Coordinate Plane
The Art Gallery Problem
Section 3-4 Polygon Angle-SumTheorems
Brute-Force Triangulation
Computational Geometry Piyush Kumar (Lecture 4: Planar Graphs, Polygons and Art Gallery) Welcome to CIS5930.
The Art Gallery Problem
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
AMS 345/CSE 355 Computational Geometry
Triangulating a monotone polygon
Computational Geometry Course Summary (First Half) Spring 2008 Pay special attention to: algorithm details (able to explain correctness and carry out a.
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.
Objectives Define polygon, concave / convex polygon, and regular polygon Find the sum of the measures of interior angles of a polygon Find the sum of the.
Polygons A Polygon is a closed plane figure formed by 3 or more segments Each segment intersects exactly 2 other segments only at their endpoints. No.
Pylon of the Month Rigidity  Division leads to more boundary  cut Division Can be Dangerous.
Areas of Regular Polygons Section Theorem 11.3 Area of an Equilateral Triangle: The area of an EQUILATERAL triangle is one fourth the square of.
Computational Geometry Polygon Triangulation and The Art Gallery Problem Joachim Gudmundsson NICTA, Sydney.
 A Polygon is a closed plane figure with at least three sides. The sides intersect only at their endpoints, and no adjacent sides are collinear. A. B.
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.
Polygons Advanced Geometry Polygons Lesson 1. Polygon a closed figure Examples NO HOLES NO CURVES SIDES CANNOT OVERLAP all sides are segments.
6-1B Exploring Polygons How are polygons classified? How are polygons classified? How do you find the sum of the measures of the interior angles of a convex.
§10.1 Polygons  Definitions:  Polygon  A plane figure that…  Is formed by _________________________ called sides and… ..each side intersects ___________.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
5.5 Indirect Reasoning -Indirect Reasoning: All possibilities are considered and then all but one are proved false -Indirect proof: state an assumption.
3-5 Angles of a Polygon. A) Terms Polygons – each segment intersects exactly two other segments, one at each endpoint. Are the following figures a polygon?
Possible Art Gallery Polygonal Closed CurveSay what?  Any figure that is made up of straight line pieces that are connected end to end to form a loop.
Polygon Triangulation
Quadrilaterals Sec 6.1 GOALS: To identify, name, & describe quadrilaterals To find missing measures in quadrilaterals.
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
Introduction to Spatial Computing CSE 555
CENG 789 – Digital Geometry Processing 02- Polygons and Triangulations
3-5 Angles of a Polygon.
An angle inside a polygon
Angle Relationships.
The Art Gallery Problem
Convex Hull obstacle start end 11/21/2018 4:05 AM Convex Hull
The Art Gallery Problem
Polygon Triangulation
Convex Sets & Concave Sets
Triangulation of a polygon
Convex Hull obstacle start end 4/30/2019 5:21 PM Convex Hull
Presentation transcript:

Contest Algorithms January 2016 Triangulation & the Art Gallery Problem Contest Algorithms1

1. Simple Polygons Some definitions would allow this as a “degenerate” simple polygon  P is a simple polygon is one which does not intersect with itself

 A partition of P into triangles by a set of noncrossing diagonals. 2. Triangulation

create a stack with all of the vertices in CCW order; pop the top vertex off the stack and store in p0; pop the top vertex off the stack and store in pHelper; while the stack is not empty pop the top vertex off the stack and store in pTemp; create a triangle with vertices p0, pHelper, pTemp; let pHelper = pTemp Triangulation of Convex Polygons Contest Algorithms4

 A simple polygon has a triangulation.  An n-gon with n  4 has a diagonal.  Any triangulation of a simple n-sided polygon has:  n-3 diagonals  n-2 triangles Triangulation Theory in 2D 5

 A diagonal of the form v i-1 v i+1 is an ear diagonal ; the triangle v i-1 v i v i+1 is an ear, and v i is the ear tip  There are at most n ears (and a convex polygon has exactly n ears) Ears v i-1 v i+1 vivi

Ear Clipping Triangulation Contest Algorithms7

create a list of the vertices (in CCW order, starting anywhere) while true for every vertex let pPrev = the previous vertex in the list let pCur = the current vertex; let pNext = the next vertex in the list if the vertex is not an interior vertex; continue; if there are any vertices in the polygon inside the triangle made by the current vertex and the two adjacent ones continue; create the triangle with the points pPrev, pCur, pNext; remove pCur from the list; if no triangles were made in the above for loop break; Pseudo-code Contest Algorithms8 see triangulate() and isEar() in Polygon.java

 Simple “ear-clipping” methods: O(n 2 )  Cases with simple O(n) algorithms:  Convex polygons (trivial!)  Monotone polygons, monotone mountains  General case (even with holes!):  Sweep algorithm to decompose into monotone mountains  O(n log n) Triangulation Running Times 9

 A polygon is monotone with respect to a line L, if every line orthogonal to L intersects P at most twice.  allows for sweep-based triangulation methods Monotone Polygon Contest Algorithms10

Example (tri4.txt) Contest Algorithms

> java TriangulationTests tri4.txt Triangulation: Indicies: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] try ear: 17, 0, 1 > 1. Cut off: [ (5.000, 5.000) (0.000, 0.000) (10.000, 7.000) ] Indicies: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] try ear: 17, 1, 2 try ear: 1, 2, 3 > 2. Cut off: [ (10.000, 7.000) (12.000, 3.000) (20.000, 8.000) ] Indicies: [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] try ear: 1, 3, 4 try ear: 3, 4, 5 try ear: 4, 5, 6 > 3. Cut off: [ (13.000, ) (10.000, ) (12.000, ) ] Indicies: [1, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] try ear: 4, 6, 7 > 4. Cut off: [ (13.000, ) (12.000, ) (14.000, 9.000) ] Indicies: [1, 3, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] try ear: 4, 7, 8 try ear: 7, 8, 9 try ear: 8, 9, 10 Execution Contest Algorithms12 see TriangulationTests.java

try ear: 9, 10, 11 > 5. Cut off: [ (6.000, ) (10.000, ) (7.000, ) ] Indicies: [1, 3, 4, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17] try ear: 9, 11, 12 > 6. Cut off: [ (6.000, ) (7.000, ) (0.000, ) ] Indicies: [1, 3, 4, 7, 8, 9, 12, 13, 14, 15, 16, 17] try ear: 9, 12, 13 try ear: 12, 13, 14 > 7. Cut off: [ (0.000, ) (1.000, ) (2.000, ) ] Indicies: [1, 3, 4, 7, 8, 9, 12, 14, 15, 16, 17] try ear: 12, 14, 15 try ear: 14, 15, 16 try ear: 15, 16, 17 > 8. Cut off: [ (5.000, 8.000) (-2.000, 9.000) (5.000, 5.000) ] Indicies: [1, 3, 4, 7, 8, 9, 12, 14, 15, 17] try ear: 15, 17, 1 > 9. Cut off: [ (5.000, 8.000) (5.000, 5.000) (10.000, 7.000) ] Indicies: [1, 3, 4, 7, 8, 9, 12, 14, 15] try ear: 15, 1, 3 > 10. Cut off: [ (5.000, 8.000) (10.000, 7.000) (20.000, 8.000) ] Indicies: [3, 4, 7, 8, 9, 12, 14, 15] try ear: 15, 3, 4 : Contest Algorithms13

[ (5.000, 5.000) (0.000, 0.000) (10.000, 7.000) ] [ (10.000, 7.000) (12.000, 3.000) (20.000, 8.000) ] [ (13.000, ) (10.000, ) (12.000, ) ] [ (13.000, ) (12.000, ) (14.000, 9.000) ] [ (6.000, ) (10.000, ) (7.000, ) ] [ (6.000, ) (7.000, ) (0.000, ) ] [ (0.000, ) (1.000, ) (2.000, ) ] [ (5.000, 8.000) (-2.000, 9.000) (5.000, 5.000) ] [ (5.000, 8.000) (5.000, 5.000) (10.000, 7.000) ] [ (5.000, 8.000) (10.000, 7.000) (20.000, 8.000) ] [ (20.000, 8.000) (13.000, ) (14.000, 9.000) ] [ (6.000, ) (0.000, ) (2.000, ) ] [ (6.000, ) (2.000, ) (5.000, 8.000) ] [ (5.000, 8.000) (20.000, 8.000) (14.000, 9.000) ] [ (5.000, 8.000) (14.000, 9.000) (8.000, ) ] [ (5.000, 8.000) (8.000, ) (6.000, ) ] try ear: 3, 4, 7 > 11. Cut off : [ (20.000, 8.000) (13.000, ) (14.000, 9.000) ] Indicies: [3, 7, 8, 9, 12, 14, 15] try ear: 3, 7, 8 Collinear problem near point 3 try ear: 7, 8, 9 try ear: 8, 9, 12 try ear: 9, 12, 14 > 12. Cut off : [ (6.000, ) (0.000, ) (2.000, ) ] Indicies: [3, 7, 8, 9, 14, 15] try ear: 9, 14, 15 > 13. Cut off: [ (6.000, ) (2.000, ) (5.000, 8.000) ] Indicies: [3, 7, 8, 9, 15] try ear: 9, 15, 3 try ear: 15, 3, 7 > 14. Cut off : [ (5.000, 8.000) (20.000, 8.000) (14.000, 9.000) ] Indicies: [7, 8, 9, 15] try ear: 15, 7, 8 > 15. Cut off : [ (5.000, 8.000) (14.000, 9.000) (8.000, ) ] Indicies: [8, 9, 15] try ear: 15, 8, 9 > 16. Cut off : [ (5.000, 8.000) (8.000, ) (6.000, ) ] Indicies: [9, 15] Contest Algorithms14 16 triangles for 18-sided polygon 2 points left at end; 16 used

Result Contest Algorithms triangles and 15 diagonals for 18-sided polygon

3. The Art Gallery Problem Question: How many guards are needed to guard an art gallery? Guard: (camera, motion sensors, fire detectors, …) - 2  range visibility - infinite distance - cannot see through walls x y z

Some Gallery Examples n=3 n=4 n=5 n=6 the best guard position; 1 guard needed

n=6 n=9 n=3k

 Put one guard in each triangle. Since the triangle is convex, the guard can see the whole triangle. Guard Positioning Using Triangulation

 An assignment of one out of three colors to each vertex. Adjacent vertices must have different colors. 3-Coloring

Theorem; For any simple polygon with n vertices guards are sufficient to guard the whole polygon -- this means less guards might be possible There are polygons for which guards are necessary -- less is not possible, e.g: Art Gallery Theorem n3n3    n3n3   