Zoo-Keeper’s Problem An O(nlogn) algorithm for the zoo-keeper’s problem Sergei Bespamyatnikh Computational Geometry 24 (2003), pp. 63-74 4 th CGC Workshop.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

Polygon Triangulation
UNC Chapel Hill Lin/Foskey/Manocha Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses.
Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
INTERVAL TREE & SEGMENTATION TREE
Approximations of points and polygonal chains
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
Dynamic Planar Convex Hull Operations in Near- Logarithmic Amortized Time TIMOTHY M. CHAN.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
1 Persistent data structures. 2 Ephemeral: A modification destroys the version which we modify. Persistent: Modifications are nondestructive. Each modification.
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.
Visibility Graphs May Shmuel Wimer Bar-Ilan Univ., Eng. Faculty Technion, EE Faculty.
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.
1 Voronoi Diagrams. 2 Voronoi Diagram Input: A set of points locations (sites) in the plane.Input: A set of points locations (sites) in the plane. Output:
Ruslana Mys Delaunay Triangulation Delaunay Triangulation (DT)  Introduction  Delaunay-Voronoi based method  Algorithms to compute the convex hull 
Feb Polygon Triangulation Shmuel Wimer Bar Ilan Univ., School of Engineering.
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930.
17. Computational Geometry Chapter 7 Voronoi Diagrams.
Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses in a matrix chain multiplication (A.
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.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Fractional Cascading and Its Applications G. S. Lueker. A data structure for orthogonal range queries. In Proc. 19 th annu. IEEE Sympos. Found. Comput.
The Art Gallery Problem
Brute-Force Triangulation
Randomized Algorithms - Treaps
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
Spring 2015 Lecture 11: Minimum Spanning Trees
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.
RA PRESENTATION Sublinear Geometric Algorithms B 張譽馨 B 汪牧君 B 李元翔.
14/13/15 CMPS 3130/6130 Computational Geometry Spring 2015 Windowing Carola Wenk CMPS 3130/6130 Computational Geometry.
B-trees and kd-trees Piotr Indyk (slides partially by Lars Arge from Duke U)
Mehdi Mohammadi March Western Michigan University Department of Computer Science CS Advanced Data Structure.
October 9, 2003Lecture 11: Motion Planning Motion Planning Piotr Indyk.
Approximation algorithms for TSP with neighborhoods in the plane R 郭秉鈞 R 林傳健.
Computational Geometry Piyush Kumar (Lecture 10: Point Location) Welcome to CIS5930.
Segment Trees - motivation.  When one wants to inspect a small portion of a large and complex objects. Example: –GIS: windowing query in a map.
CMPS 3130/6130 Computational Geometry Spring 2015
1/29/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries Carola Wenk.
On the Problem of Computing Zookeeper Routes. Hakan Jonsson & Sofia Sundberg ISSN / ISRN LTU-FR-- 04/10--SE / NR 2004:10.
February 17, 2005Lecture 6: Point Location Point Location (most slides by Sergi Elizalde and David Pritchard)
Algorithms for hard problems Parameterized complexity Bounded tree width approaches Juris Viksna, 2015.
1 Schematization of Networks Rida Sadek. 2 This talk discusses: An algorithm that is studied in the following papers:  S. Cabello, M. de Berg, and M.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
Polygon Triangulation
CSE 589 Applied Algorithms Spring 1999 Prim’s Algorithm for MST Load Balance Spanning Tree Hamiltonian Path.
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
Computational Geometry
Geometric Data Structures
CMPS 3130/6130 Computational Geometry Spring 2017
Lecture 12 Algorithm Analysis
Orthogonal Range Searching and Kd-Trees
Computational Geometry Capter:1-2.1
The Art Gallery Problem
Reporting (1-D) Given a set of points S on the line, preprocess them to build structure that allows efficient queries of the from: Given an interval I=[x1,x2]
Lecture 12 Algorithm Analysis
CMPS 3130/6130 Computational Geometry Spring 2017
Kinetic Collision Detection for Convex Fat Objects
Computational Geometry
Lecture 12 Algorithm Analysis
Switching Lemmas and Proof Complexity
Presentation transcript:

Zoo-Keeper’s Problem An O(nlogn) algorithm for the zoo-keeper’s problem Sergei Bespamyatnikh Computational Geometry 24 (2003), pp th CGC Workshop on Computational Geometry, 1999

TOPIC Introduction & Background Bounding shortest paths Floodlights & Floodlight tree Zoo-keeper’s query

Introduction P: a simple polygon; C 1,…,C k : k disjoint convex polygons in P; each C i represents the cage and shares an edge of P; p: start vertex; Goal: Goal: shortest closed path from p, touching each cage  1 times.

Introduction Similar to Art Gallery problem. There exists an optimal visiting ordering. Since each cage shares one edge of P; Clockwise ordering along P and p in C k and C 1 ; Let Q=P\{union of all cages}; n: the number of edges of Q; Zoo-keeper’s query Zoo-keeper’s query: Preprocess the configuration of Q and for a query point q in Q, the goal is to find a shortest path from p to q touching each cage at least one times. Result:K Result: O(nlogn) preprocess time and O(logn+K) query time.

Background reflection principle Based on “reflection principle”. A shortest path from a to b and must visit the line l. Or even more, must visit the line segment [p,q]. Use this idea, define the combinatorial type of the zoo-keeper’s path: s 1, s 2, …, s k (line segments of cage edges)

Background Because of monotone property of zoo-keeper’s path, modify the combinatorial type incrementally (one by one). Chin and Ntafos [1992]: O(n 2 ) time. tune O(n) steps; each step need O(n) tuning time. Hershberger and Snoeyink [1994]: O(nlog 2 n) time. reduce tuning time to O(log 2 n) in each step.

Bounding shortest paths Goal: the zoo-keeper’s query; build the configuration of Q; Two stages: 1. eliminate the choice of each cage touch point, consider the other part. bounding shortest paths 2. integrate the cage touch points with bounding shortest paths. p-p 1 -q 2 -…-p i-1 -q i -…-p and p-q 1 -p 2 -…-q i-1 -p i -…-p p i q i : common edge

Bounding shortest paths Lemma1: Lemma1: The total complexity of bounding shortest paths is linear. The proof: each vertex of Q occurs  2 times in such path. How to find bounding shortest paths: How to find bounding shortest paths: shortest path query Use shortest path query. No fixed start and end points (in a simple polygon): K O(logn+K) time: J. Hershberger, [1989,1991]. previous papers Also apply in previous papers of concerning zoo-keeper’s path.

Floodlights Consider the cage touching point; Floodlight Use Floodlight to represent each funnel possible shortest path. (funnel) An example of from p……. => Range property: All floodlights between C i and C i+1 are disjoint and their union is =>

Floodlight reflection Lemma2: Assume that there exist m floodlights illuminating C 1 from p, then the floodlights leaving C 1 are at most m+2n 1, where n 1 is the number of edges of C 1.

Floodlight reflection f 1 f 2 => f' 2 f 3 f' 1 If one floodlight f illuminating h edges in C i, then the reflection floodlight number is 2h-1. (h: edge reflection; h-1:vertex) at most m+2n 1

Floodlight transition the deleted floodlight 1,2,3,7,8 the reduced floodlight 4,6 the added floodlight the paths p i q i+1 and q i p i+1 have one common point.

Floodlight transition Lemma3: Lemma3: If there exist m floodlights leaving the cage C i, then there at most m+n' i floodlights reaching the cage C i+1, where n' i is the total size (edge, vertex number) of the paths p i q i+1 and q i p i+1. Proof: Proof: Consider the possible added floodlights: 1. the last common vertex of paths p i q i+1 and q i p i the vertex incident to C i+1 and not in the beam of m floodlights leaving C i. at most m+n' i

Floodlight tree O(n) space O(n) space for all the floodlights reflected about all cages. balanced binary tree construct the Floodlight tree as a balanced binary tree. O(logn) Every operation (insert, delete, split,…) costs O(logn) time. Theorem4: O(nlogn) The Floodlight tree can be built in O(nlogn) time.

Algorithm Algorithm: Construct Floodlight tree Input. A polygon P with cages C 1,...,C k in clockwise order along the boundary of P and a start point p. Output. The floodlight tree T. 1. Find shortest paths (pp 1 ), (pq 1 ), (p 1 q 2 ), (q 1 p 2 ),..., (p k p), (q k p) in Q. 2. Initialize the tree T with one floodlight of angle 2  at point p. 3. for i = 1 to k do // determine beams reaching ith cage 4. Delete floodlights whose beams stop at the edges of paths (p i-1 q i ) and (q i-1 p i ). 5. Update leftmost and rightmost floodlights restricted by the above two paths. 6. Insert floodlights generated by remaining edges of the above two paths. // reflection of the floodlights about ith cage // reflection of the floodlights about ith cage 7. Locate the vertices of C i in T. 8. Split each floodlight illuminating a vertex of C i. 9. Insert the floodlight for each vertex of C i except two boundary vertices of C i. 10. for each edge e of C i do 11. Reflect floodlights illuminating e using canonical nodes of T.

Zoo-keeper’s query The difference is no fixed end point q. Consider the last cage and q. The floodlights of the last cage located q in partition the Q and located q in O(logn) time O(logn) time. from r ?

Zoo-keeper’s query If q=p, then the order is p-C 1 -C 2 -…-C k -p and find answer by Floodlight tree. If q  p, then ??? assume the paper know who is last cage, that’s not enough. The zoo-keeper’s problem can be solved in O(nlogn) time. The zoo-keeper’s query can be answered in O(logn+K) time as the preprocess configuration is built (in O(nlogn) time).