Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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 on Computational Geometry, 1999

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

3 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.

4 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.

5 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)

6 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.

7 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

8 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.

9 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 =>

10 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.

11 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

12 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.

13 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+1. 2. the vertex incident to C i+1 and not in the beam of m floodlights leaving C i. at most m+n' i

14 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.

15 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.

16 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 ?

17 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).


Download ppt "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."

Similar presentations


Ads by Google