1 / 23

An optimal algorithm to solve the minimum weakly cooperative guards problem for 1-spiral polygons

An optimal algorithm to solve the minimum weakly cooperative guards problem for 1-spiral polygons. Bern-Cherng Liaw, R.C.T. Lee Information Processing Letters 57 (1994) 69-75. Introduction.

miles
Download Presentation

An optimal algorithm to solve the minimum weakly cooperative guards problem for 1-spiral polygons

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An optimal algorithm to solve the minimum weakly cooperative guards problem for 1-spiral polygons Bern-Cherng Liaw, R.C.T. Lee Information Processing Letters 57 (1994) 69-75

  2. Introduction • The cooperative relation between a set A of guards in a polygon P is represented by a guards visibility graph GVG(A, P) in which all vertices correspond to guards and there is an edge between two vertices if and only if the corresponding guards can see each other in P. • Minimum cooperative guards problem : find a minimum number of guards such that GVG must be connected. ( NP-Hard ) • Minimum weakly cooperative guards problem (MWCG problem) only requires that GVG has no isolated vertices. (NP-Hard) • In this paper, we try to solve the MWCG problem for 1-spiral polygons.

  3. Notation • A reflex (convex) chain, denoted as RC (CC), of a simple polygon is a chain of edges of this polygon if all of the vertices on this chain are reflex (convex) with respect to the interior of the polygon, except the vertices at the end of the chain. • The term “reflex chain” always refers to a maximal reflex chain; that is, it is not contained in any other reflex chain. • A 1-spiral polygon P is a simple polygon whose boundary contains exactly one reflex chain. (Convex polygon is 0-spiral.)

  4. Notation • Traversing the boundary of P counterclockwise, the starting (ending) vertex of the reflex chain is called vs, (ve) and the indices of vertices of P are numbered in increasing order. • A subchain of the boundary of P from point p to point q in counterclockwise order is denoted as C[p, q].

  5. Starting region, ending region • Starting region, ending region: • For two points p and q on the convex (reflex) chain, we define p < q if p is closer to vs on the convex (reflex) chain than is q.

  6. supporting line segment • A line segment S contained in P is said to be tangent at a reflex vertex r if r is a point on S. • Let a be a point in P and b a point on CC of P. A line segment ab tangent at a reflex vertex c is called a left (right) supporting line segment with respect to a if there are exterior points of P to the right (left) of ab in every neighborhood of c. We call vertex c the contact vertex of ab. • If a is in the starting (ending) region, we define the right (left) supporting line segment with respect to a as avs (ave) with vs (ve) as its contact vertex.

  7. Lemma 2.1 • Lemma 2.1 (Nilsson and Wood [6]). There exists an optimal guard placement of the art gallery problem for 1-spiral polygons in which all guards are stationed on the convex chain. Proof: the main idea : Any guard g placed inside a 1-spiral polygon can be transformed to some point g’ on the convex chain such that the region visible from g is also visible from g’.

  8. Lemma 2.2 • Lemma 2.2 There exists an optimal guard placement of the MWCG problem for 1-spiral polygons in which all guards are stationed on the convex chain.Proof:By lemma 2.1, for a guard g in the optimal solution of the MWCG problem, any other guard visible from g is also visible from the transformed guard g’ on the convex chain. The guards visibility graph of the transformed guard placement will still have no isolated vertices.

  9. Order of components of GVG • Let H =(h1,, h2,..., hk) be a guard set in a 1-spiral polygon P, with h1 <h2, < . . .<hkon the convex chain. Let hi and hj be in H and hi <hj. if hi and hj belong to components Ga and Gb of GVG(H, P), respectively, then no ht > hj can belong to Ga and no ht < hi can belong to Gb.Proof:There is a path joining hiand htin GVG(H,P).Let hpand hqbe two guards in Ga, such that hphq is an edge in the path joining hiand ht, and hi ≦hp< hj <hq≦ ht,. Since the region bounded by hp,hqand C[hq, hp] is convex, hjis visible from both hpand hq. Thus, hjbelongs to Ga, which is a contradiction. By the similar reasoning, no ht < hi can belong to Gb.

  10. Lemma 2.3 • the components of GVG(H, P) can be ordered in increasing order along the convex chain from vs to ve such that if Ga < Gb, then hi < hj where hi, with the largest i, belongs to Ga and hj, with the smallest j, belongs to Gb. • Lemma 2.3 There exists an optimal solution of the MWCG problem for 1-spiral polygons such that no component of its guards visibility graph contains more than three guards. proof:Let G = {g1, g2, . . . , gk}be an optimal solution of our problem.and g1 <g2 <. . . <gk are stationed on the convex chain. Let there be m disconnected components Gi,1 < i <m, in GVG(G, P), with G1 < G2 < . .. <Gm.

  11. Proof of Lemma 2.3 • For the component which contains more than three guards, we perform the following transformations.Let | Gj | > 3, with the smallest j, and the first four guards in Gj are gi, gi+1, gi+2, gi+3.We replace gi+2 and gi+3 by g’i+2 and g’i+3.

  12. Proof of Lemma 2.3

  13. pi, qi, ti, ui, v2i and v3i • For a vertex vi in the reflex chain, define pi, qi, ti, ui, v2i and v3i. • if i = e, define pe = ve. Because ve is in ending region, veve is left supporting line and contact vertex is ve. Thus pe=qe=te=ue=v2e=v3e=ve.

  14. Lemma 2.4 • Lemma 2.4. There exists an optimal solution of the MWCG problem for 1-spiral polygons such that each guard is on the specific positions pi, qi, or ti, for some i. proof:According to Lemma 2.2 and Lemma 2.3.Let G = {g1, g2, . . . , gk}be an optimal solution of our problem.and g1 <g2 <. . . <gk are stationed on the convex chain. Each component of GVG(G, P) has two or three guards.Fro each component with two guards, we perform the following transformation:

  15. Proof of Lemma 2.4 (1) G1 is a component with two guards {g1, g2}.The region visible from {g1, g2} is contained in the region visible from {ps, qs}. We can replace {g1, g2} by {ps, qs} (2) For Gj, j>1, is a component with two guards {gh , gh+1}.The region visible from {gh-1, gh, gh+1} is contained in the region visible from {gh-1, pi, qi}We can replace {gh-1, gh, gh+1} by {gh-1, pi, qi} For the component with three guards, we can replace the three guards by the corresponding pi, qi and ti by a similar transformation. gh≦ pi => gh+1 ≦ qi Vi is contact vertex with respect to ghw right supporting line. g1≦ ps => g2 ≦ qs

  16. Algorithm • By Lemma 2.4, we need only test guards on the specific positions pi’s, qi’s, and ti’s. Our algorithm is based upon the dynamic programming approach. • Starting from ps, there are two possible cases to place guards • Denote the remaining 1-spiral polygons defined by vi as P(vi, ve)The original 1-spiral polygon P is also denoted as P(vs, ve).

  17. Algorithm • In a 1- spiral polygon P(vs, ve), let MWCG1(P(vi, ve)) denote the minimum number of guards of the MWCG problem for a 1-spiral subpolygon P(vi, ve) with reflex chain C[vi, ve]. MWCG1(P(vs, ve)) = min { 2 + MWCG1(P(v2s, ve)), 3 + MWCG1(P(v3s, ve))}; MWCG1(P(ve, ve)) =0 • We can compute the answers to MWCG1(P(vi,ve))’s from back to front.

  18. Algorithm Procedure Computing _MWCG1( P(vs, ve)) (* Let MG[s..e], NG[s..e], V2[s..e], V3[s..e] be arrays. *) (* MG[i] is the minimum number of guards needed for P(vi, ve). *) (* NG[i] is the number of guards (2 or 3) in the first component of the minimum solution for P(vi, ve). *) Step 1: For each vi on RC, find the first intersection point pi of CC with vivi+1, and find the three consecutive left supporting line segments piqi, qiti, and tiui, and the contact vertices v2i and v3i of the last two. Let V2[i] be the subscript of the contact vertex v2i of qiti Let V3[i] be the subscript of the contact vertex v3i of tiui. Step 2:MG[e] = 0, NG[e] = 0. Step 3:For i = e - 1 to s step - 1 n2 = 2 + MG[V2[i]] (*MWCG1(P(v2i, ve))) n3 = 3 + MG[V3[i]] (*MWCG1(P(v3i, ve))) If n2 ≦ n3 then MG[i] = n2, NG[i] = 2 else MG[i] = n3, NG[i] = 3. Step 4: The minimum number of guards is MG[s]. The guard placement can be obtained by a linear pass through the NG, V2, and V3 arrays. End of Procedure. (In the guard placement if we choose pi=qi=e, then we can select two disjoint points in the ending region to replace pi and qi.)

  19. Example of the Algorithm Step 3:For i = e - 1 to s step - 1 n2 = 2 + MG[V2[i]] n3 = 3 + MG[V3[i]] If n2 ≦ n3 then MG[i] =n2, NG[i] =2 else MG[i] =n3, NG[i] =3

  20. Example of the Algorithm Step 3:For i = e - 1 to s step - 1 n2 = 2 + MG[V2[i]] n3 = 3 + MG[V3[i]] If n2 ≦ n3 then MG[i] =n2, NG[i] =2 else MG[i] =n3, NG[i] =3

  21. The correctness • Lemma 3.1 (Nilsson and Wood [6]). A collection of guards (mobile or stationary) see the1-spiral polygon if and only if they can see all edges of the reflex chain. • It is clear that {ps, qs} can see C[vs, v2s] and {ps, qs, ts} can see C[vs, v3s]. Thus, the guards resulting from our dynamic programming algorithm can see C[vs, ve] and the entire 1-spiral polygon according to Lemma 3.1.

  22. The correctness • Because our approach is based upon Lemma 2.3 and Lemma 2.4 ( no component contains more than three guards and each guard is on the specific positions pi, qi, or ti, for some i ) and uses the dynamic programming strategy, the following theorem holds. • Theorem 3.3. Our dynamic programming algorithm finds an optimal solution of the MWCG problem for a 1-spiral polygon.

  23. Analysis of algorithm • Step 3 is executed at most O(n) time and Step 4 is also executed in linear time. • Step 1 can be accomplished in linear timepf:For each vi in the reflex chain, pi <pi+1, we can find all pi‘s by a linear scan along the reflex and convex chains from vs to ve. Similarly, we have qi< qi+1,v2i≤ v2i+1, ti < ti+1,v3i≤v3i+1 and ui < ui+1. In other words, we can find all pi’s, qi’s, v2i’s, ti’s, v3i‘s, and ui’s in turn in totally linear time.

More Related