Upload
cody-morton
View
220
Download
2
Embed Size (px)
Citation preview
Zoo-Keeper’s Problem Zoo-Keeper’s Problem
An O(nlogn) algorithm for the zoo-keeper’s probleAn O(nlogn) algorithm for the zoo-keeper’s problemm
Sergei BespamyatnikhSergei Bespamyatnikh
Computational Geometry 24 (2003), pp. 63-744th CGC Workshop on Computational Geometry, 1999
TOPIC Introduction & Background
Bounding shortest paths
Floodlights & Floodlight tree
Zoo-keeper’s query
IntroductionP: a simple polygon; C1,…,Ck: k disjoint convex polygons in P;
each Ci 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 Ck and C1;
Let Q=P\{union of all cages}; n: the number of edges of Q; Zoo-keeper’s queryZoo-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:Result: O(nlogn) preprocess time and O(logn+KK) query time.
BackgroundBased on “reflection principlereflection 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:s1, s2, …, sk
(line segments of cage edges)
Background Because of monotone property of zoo-keeper’s path, modify th
e combinatorial type incrementally (one by one).
Chin and Ntafos [1992]: O(n2) time. tune O(n) steps; each step need O(n) tuning time.
Hershberger and Snoeyink [1994]: O(nlog2n) time. reduce tuning time to O(log2n) in each step.
Bounding shortest pathsGoal: the zoo-keeper’s query; build the configuration of Q;
Two stages: Two stages: 1. eliminate the choice of each cage touch point, consider the other part.bounding shortest pathsbounding shortest paths
2. integrate the cage touch points with bounding shortest paths.
p-p1-q2-…-pi-1-qi-…-p and p-q1-p2-…-qi-1-pi-…-p
piqi:commonedge
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: Use shortest path queryshortest path query.
No fixed start and end points (in a simple polygon): O(logn+KK) time: J. Hershberger, [1989,1991].
Also apply in previous papersprevious papers of concerning zoo-keeper’s path.
FloodlightsConsider the cage touching point;
Use FloodlightFloodlight to represent eachpossible shortest path. (funnelfunnel)An example of from p……. =>
Range property:Range property:All floodlights between Ci and Ci+1
are disjoint and their union is =>
Floodlight reflection
Lemma2:Lemma2:Assume that there exist m floodlights illuminating C1 from p, then the floodlights leaving C1 are at most m+2n1, where n1 is the number of edges of C1.
Floodlight reflection
ff11ff22 => f' => f'22ff33f'f'11
If one floodlight f illuminatingh edges in Ci, then the reflectionfloodlight number is 2h-1.(h: edge reflection; h-1:vertex)
at most m+2nat most m+2n11
Floodlight transition
the deleted floodlight1,2,3,7,8the reduced floodlight4,6the added floodlight
the paths piqi+1 and qipi+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 Ci+1, where n'i is the total size (edge, vertex number) of the paths piqi+1 and qipi+1.
Proof:Proof: Consider the possible added floodlights:
1. the last common vertex of paths piqi+1 and qipi+1.
2. the vertex incident to Ci+1 and not in the beam of m floodlights leaving Ci.
at most m+n'at most m+n'ii
Floodlight tree
O(n) spaceO(n) space for all the floodlights reflected about all cages.
construct the Floodlight tree as a balanced binary treebalanced binary tree.
Every operation (insert, delete, split,…) costs O(logn)O(logn) time.
Theorem4: The Floodlight tree can be built in O(nlogn)O(nlogn) time.
AlgorithmAlgorithm: Construct Floodlight treeInput. A polygon P with cages C1, . . .,Ck in clockwise order along the boundary of P and a start point p.Output. The floodlight tree T .1. Find shortest paths (pp1), (pq1), (p1q2), (q1p2),..., (pkp), (qkp) 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// determine beams reaching ith cage4. Delete floodlights whose beams stop at the edges of paths (pi-1qi) and (qi-1pi).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 cage7. Locate the vertices of Ci in T.8. Split each floodlight illuminating a vertex of Ci .9. Insert the floodlight for each vertex of Ci except two boundary vertices of Ci.10. for each edge e of Ci do11. Reflect floodlights illuminating e using canonical nodes of T .
Zoo-keeper’s queryThe difference is no fixed end point q.
Consider the last cage and q.
The floodlights of the last cagepartition the Q and located q in located q in O(logn) timeO(logn) time.
from r ?
Zoo-keeper’s query If q=p, then the order is p-C1-C2-…-Ck-p and find answer by Fl
oodlight tree.
If qp, 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).