This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Constant Approximation Algorithms for Guarding Simple Polygons using Vertex Guards

Pritam Bhattacharya Email: pritam.bhattacharya@cse.iitkgp.ernet.in, lord.pritomose@gmail.com Department of Computer Science and Engineering, Indian Institute of Technology, Kharagpur, West Bengal - 721302, India. Subir Kumar Ghosh Email: subir.ghosh@rkmvu.ac.in, profsubirghosh@gmail.com Department of Computer Science, RKM Vivekananda Educational and Research Institute, Belur, West Bengal - 711202, India. Sudebkumar Prasant Pal Email: spp@cse.iitkgp.ernet.in, sudebkumar@gmail.com Department of Computer Science and Engineering, Indian Institute of Technology, Kharagpur, West Bengal - 721302, India.
Abstract

The art gallery problem enquires about the least number of guards sufficient to ensure that an art gallery, represented by a simple polygon PP, is fully guarded. Most standard versions of this problem are known to be NP-hard. In 1987, Ghosh provided a deterministic 𝒪(logn)\mathcal{O}(\log n)-approximation algorithm for the case of vertex guards and edge guards in simple polygons. In the same paper, Ghosh also conjectured the existence of constant ratio approximation algorithms for these problems. We present here three polynomial-time algorithms with a constant approximation ratio for guarding an nn-sided simple polygon PP using vertex guards. (i) The first algorithm, that has an approximation ratio of 18, guards all vertices of PP in 𝒪(n4)\mathcal{O}(n^{4}) time. (ii) The second algorithm, that has the same approximation ratio of 18, guards the entire boundary of PP in 𝒪(n5)\mathcal{O}(n^{5}) time. (iii) The third algorithm, that has an approximation ratio of 27, guards all interior and boundary points of PP in 𝒪(n5)\mathcal{O}(n^{5}) time. Further, these algorithms can be modified to obtain similar approximation ratios while using edge guards. The significance of our results lies in the fact that these results settle the conjecture by Ghosh regarding the existence of constant-factor approximation algorithms for this problem, which has been open since 1987 despite several attempts by researchers. Our approximation algorithms exploit several deep visibility structures of simple polygons which are interesting in their own right.

1 Introduction

1.1 The art gallery problem and its variants

The art gallery problem enquires about the least number of guards sufficient to ensure that an art gallery (represented by a polygon PP) is fully guarded, assuming that a guard’s field of view covers 360° as well as unbounded distance. This problem was first posed by Victor Klee in a conference in 1973, and has become a well investigated problem in computational geometry.

A polygon PP is defined to be a closed region in the plane bounded by a finite set of line segments, called edges of PP, such that between any two points of PP, there exists a path which does not intersect any edge of PP. If the boundary of a polygon PP consists of two or more cycles, then PP is called a polygon with holes (see Figure 2). Otherwise, PP is called a simple polygon or a polygon without holes (see Figure 2).

An art gallery can be viewed as an nn-sided polygon PP (with or without holes) and guards as points inside PP. Any point zPz\in P is said to be visible from a guard gg if the line segment zg{zg} does not intersect the exterior of PP. In general, guards may be placed anywhere inside PP. If the guards are allowed to be placed only on vertices of PP, they are called vertex guards. If there is no such restriction, then they are called point guards. The point guards that are constrained to lie on the boundary of PP, but not necessarily at the vertices, are referred to as perimeter guards. Point, vertex and perimeter guards together are also referred to as stationary guards. If guards are allowed to patrol along a line segment inside PP, they are called mobile guards. If they are allowed to patrol only along the edges of PP, they are called edge guards [13, 26].

Refer to caption

Figure 1: Polygon with holes

Refer to caption

Figure 2: Polygon without holes

In 1975, Chvátal [6] showed that n3\lfloor\frac{n}{3}\rfloor stationary guards are sufficient and sometimes necessary (see Figure 4) for guarding a simple polygon. In 1978, Fisk [11] presented a simpler and more elegant proof of this result. For a simple orthogonal polygon, whose edges are either horizontal or vertical, Kahn et al. [18] and also O’Rourke [25] showed that n4\lfloor\frac{n}{4}\rfloor stationary guards are sufficient and sometimes necessary (see Figure 4).

Refer to caption

Figure 3: A polygon where n3\lfloor\frac{n}{3}\rfloor stationary guards are necessary.

Refer to caption

Figure 4: A polygon where n4\lfloor\frac{n}{4}\rfloor stationary guards are necessary.

1.2 Related hardness and approximation results

The decision version of the art gallery problem is to determine, given a polygon PP and a number kk as input, whether the polygon PP can be guarded with kk or fewer point guards. This problem was first shown to be NP-hard for polygons with holes by O’Rourke and Supowit [27]. This problem was also shown to be NP-hard for simple polygons for guarding using only vertex guards by Lee and Lin [24]. Their proof was generalized to work for point guards by Aggarwal [2]. The problem was shown to be NP-hard even for simple orthogonal polygons by Katz and Roisman [20] and Schuchardt and Hecker [28]. Abrahamsen, Adamaszek and Miltzow [1] have recently shown that the art gallery problem for point guards is ETR-complete.

In 1987, Ghosh [12, 14] provided a deterministic 𝒪(logn)\mathcal{O}(\log n)-approximation algorithm for the case of vertex and edge guards by discretizing the input polygon PP and treating it as an instance of the Set Cover problem. As pointed out by King and Kirkpatrick [21], newer methods for improving the approximation ratio of the Set Cover problem itself have been developed in the time after Ghosh’s algorithm was published. By applying these methods, the approximation ratio of Ghosh’s algorithm becomes 𝒪(logOPT)\mathcal{O}(\log OPT) for guarding simple polygons and 𝒪(loghlogOPT)\mathcal{O}(\log h\log OPT) for guarding a polygon with hh holes, where OPTOPT denotes the size of the smallest guard set for PP. Deshpande et al. [7] obtained an approximation factor of 𝒪(logOPT)\mathcal{O}(\log OPT) for point guards or perimeter guards by developing a sophisticated discretization method that runs in pseudo-polynomial time. Efrat and Har-Peled [8] provided a randomized algorithm with the same approximation ratio that runs in fully polynomial expected time. Bonnet and Miltzow [5] obtained an approximation factor of 𝒪(logOPT)\mathcal{O}(\log OPT) for the point guard problem assuming integer coordinates and a specific general position. For guarding simple polygons using perimeter guards, King and Kirkpatrick [21] designed a deterministic 𝒪(loglogOPT)\mathcal{O}(\log\log OPT)-approximation algorithm in 2011. The analysis of this result was simplified by Kirkpatrick [22].

In 1998, Eidenbenz, Stamm and Widmayer [9, 10] proved that the problem is APX-complete, implying that an approximation ratio better than a fixed constant cannot be achieved unless NP = P. They also proved that if the input polygon is allowed to contain holes, then there cannot exist a polynomial time algorithm for the problem with an approximation ratio better than ((1ϵ)/12)lnn((1−\epsilon)/12)\ln n for any ϵ>0\epsilon>0, unless NP \subseteq TIME(n𝒪(loglogn)n^{\mathcal{O}(\log\log n)}). Extending their method, Bhattacharya, Ghosh and Roy [3] proved that, even for the special subclass of polygons with holes that are weakly visible from an edge, there cannot exist a polynomial time algorithm for the problem with an approximation ratio better than ((1ϵ)/12)lnn((1−\epsilon)/12)\ln n for any ϵ>0\epsilon>0, unless NP = P. These inapproximability results establish that the approximation ratio of 𝒪(logn)\mathcal{O}(\log n) obtained by Ghosh in 1987 is in fact the best possible for the case of polygons with holes. However, for simple polygons, the existence of a constant factor approximation algorithm for vertex and edge guards was conjectured by Ghosh [12, 15] in 1987.

Ghosh’s conjecture has been shown to be true for vertex guarding in two special sub-classes of simple polygons, viz. monotone polygons and polygons weakly visible from an edge. In 2012, Krohn and Nilsson [23] presented an approximation algorithm that computes in polynomial time a guard set for a monotone polygon PP, such that the size of the guard set is at most 30OPT30\cdot OPT. Bhattacharya, Ghosh and Roy [3, 4] presented a 6-approximation algorithm that runs in 𝒪(n2)\mathcal{O}(n^{2}) time for vertex guarding simple polygons that are weakly visible from an edge. For vertex guarding this subclass of simple polygons that are weakly visible from an edge, a PTAS has recently been proposed by Katz [19].

1.3 Our contributions

In this paper, we present three polynomial-time algorithms with a constant approximation ratio for guarding an nn-sided simple polygon PP using vertex guards. The first algorithm, that has an approximation ratio of 18, guards all vertices of PP in 𝒪(n4)\mathcal{O}(n^{4}) time. The second algorithm, that has the same approximation ratio of 18, guards the entire boundary of PP in 𝒪(n5)\mathcal{O}(n^{5}) time. The third algorithm, that has an approximation ratio of 27, guards all interior and boundary points of PP in 𝒪(n5)\mathcal{O}(n^{5}) time. As an extension we show, using similar techniques, constant-factor approximation can also be achieved for guarding PP we also present identical algorithms, maintaining both the approximation bounds as well as the running times, can be obtained using edge guards. In particular, we show that the same approximation ratios of 18, 18 and 27 hold for guarding all vertices, the entire boundary, and the interior of PP, with time complexities 𝒪(n4)\mathcal{O}(n^{4}), 𝒪(n5)\mathcal{O}(n^{5}) and 𝒪(n5)\mathcal{O}(n^{5}) respectively. The significance of our results lies in the fact that these results settle the long-standing conjecture by Ghosh [12] regarding the existence of constant-factor approximation algorithms for these problem, which has been open since 1987 despite several attempts by researchers.

In each of our algorithms, PP is first partitioned into a hierarchy of weak visibility polygons according to the link distance from a starting vertex (see Figure 6). This partitioning is very similar to the window partitioning given by Suri [29, 30] in the context of computing minimum link paths. Then, starting with the farthest level in the hierarchy (i.e. the set of weak visibility polygons that are at the maximum link distance from the starting vertex), the entire hierarchy is traversed backward level by level, and at each level, vertex guards (of two types, viz. inside and outside) are placed for guarding every weak visibility polygon at that level of PP. At every level, a novel procedure is used that has been developed for placing guards in (i) a simple polygon that is weakly visible from an internal chord, or (ii) a union of overlapping polygons that are weakly visible from multiple disjoint internal chords. Note that these chords are actually the constructed edges introduced during the hierarchical partitioning of PP.

Due to partitioning according to link distances, guards can only see points within the adjacent weak visibility polygons in the hierarchical partitioning of PP. This property locally restricts the visibility of the chosen guards, and thereby ensures that the approximation bound on the number of vertex guards placed by our algorithms at any level leads directly to overall approximation bounds for guarding PP. Thus, a constant factor approximation bound on the overall number of guards placed by our algorithms is a direct consequence of choosing vertex guards in a judicious manner for guarding each collection of overlapping weak visibility polygons obtained from the hierarchical partitioning of PP. Our algorithms exploit several deep visibility structures of simple polygons which are interesting in their own right.

1.4 Organization of the paper

In Section 2, we introduce some preliminary definitions and notations that are used throughout the rest of the paper. In Section 3, we present the hierarchical partitioning of a simple polygon PP into weak visibility polygons. Next, in Section 4, we describe how the algorithm traverses the hierarchy of visibility polygons, starting from the farthest level, and uses the procedures from Section 5 at each level as a sub-routine for guarding PP. In Section 5, we present a novel procedure for placing vertex guards necessary for guarding a simple polygon QQ that is weakly visible from a single internal chord uvuv or from multiple disjoint chords. In Section 6, we establish the overall approximation ratios for the three approximation algorithms. In Section 7, we show how these algorithms can be modified to obtain similar approximation bounds while using edge guards. Finally, in Section 8, we conclude the paper with a few remarks.

2 Preliminary definitions and notations

Let PP be a simple polygon. Assume that the vertices of PP are labelled v1,v2,,vnv_{1},v_{2},\dots,v_{n} in clockwise order. Let 𝒱(P)\mathcal{V}(P) denote the set of all vertices. Let bdc(p,q)bd_{c}(p,q) (or bdcc(p,q)bd_{cc}(p,q)) denote the clockwise (respectively, counterclockwise) boundary of PP from a vertex pp to another vertex qq. Note that by definition, bdc(p,q)=bdcc(q,p)bd_{c}(p,q)=bd_{cc}(q,p). Also, we denote the entire boundary of PP by bd(P)bd(P). So, bd(P)=bdc(p,p)=bdcc(p,p)bd(P)=bd_{c}(p,p)=bd_{cc}(p,p) for any chosen vertex pp belonging to PP.

The visibility polygon of PP from a point zz, denoted as 𝒱𝒫(z)\mathcal{VP}(z), is defined to be the set of all points of PP that are visible from zz. In other words, 𝒱𝒫(z)={qP:q is visible from z}\mathcal{VP}(z)=\{q\in P:q\mbox{\> is visible from \>}z\}. Observe that the boundary of 𝒱𝒫(z)\mathcal{VP}(z) consists of polygonal edges and non-polygonal edges. We refer to the non-polygonal edges as constructed edges. Note that one point of a constructed edge is a vertex (say, viv_{i}) of PP, while the other point (say, uiu_{i}) lies on bd(P)bd(P). Moreover, the points zz, viv_{i} and uiu_{i} are collinear (see Figure 6).

Let bcbc be an internal chord or an edge of PP. A point qq of PP is said to be weakly visible from bcbc if there exists a point zbcz\in bc such that qq is visible from zz. The set of all such points of PP is said to be the weak visibility polygon of PP from bcbc, and denoted as 𝒱𝒫(bc)\mathcal{VP}(bc). If 𝒱𝒫(bc)=P\mathcal{VP}(bc)=P, then PP is said to be weakly visible from bcbc. Like 𝒱𝒫(z)\mathcal{VP}(z), the boundary of 𝒱𝒫(bc)\mathcal{VP}(bc) also consists of polygonal edges and constructed edges viuiv_{i}u_{i} (see Figure 6). If zz (or bcbc) does not belong to bdc(viui)bd_{c}(v_{i}u_{i}), then viuiv_{i}u_{i} is called a left constructed edge of 𝒱𝒫(z)\mathcal{VP}(z) (respectively, 𝒱𝒫(bc)\mathcal{VP}(bc)). Otherwise, viuiv_{i}u_{i} is called a right constructed edge. For any constructed edge viuiv_{i}u_{i} of 𝒱𝒫(bc)\mathcal{VP}(bc) (or 𝒱𝒫(z)\mathcal{VP}(z)), observe that viuiv_{i}u_{i} divides PP into two subpolygons. One of the subpolygons is bounded by bdc(vi,ui)bd_{c}(v_{i},u_{i}) and viuiv_{i}u_{i}, whereas the other one is bounded by bdcc(vi,ui)bd_{cc}(v_{i},u_{i}) and viuiv_{i}u_{i}. Out of these two, the subpolygon that does not contain bcbc (respectively, zz) is referred to as the pocket of viuiv_{i}u_{i}, and is denoted by P(viui)P(v_{i}u_{i}) (see Figure 6). If viuiv_{i}u_{i} is a left (or right) constructed edge, then P(viui)P(v_{i}u_{i}) is called a left pocket (or right pocket).

Refer to caption

Figure 5: Figure showing visibility polygon 𝒱𝒫(v2)\mathcal{VP}(v_{2}) and weak visibility polygon 𝒱𝒫(v16v17)\mathcal{VP}(v_{16}v_{17}), along with several pockets created by constructed edges belonging to both.

Refer to caption

Figure 6: Figure showing the partitioning of a simple polygon into visibility windows.

Let SP(s,t)SP(s,t) define the Euclidean shortest path from a point ss to another point tt within PP. The shortest path tree of PP rooted at any point ss of PP, denoted by SPT(s)SPT(s), is the union of Euclidean shortest paths from ss to all vertices of PP (see Figure 7). This union of paths is a planar tree, rooted at ss, which has nn nodes, namely the vertices of PP. For every vertex xx of PP, let p(s,x)p(s,x) denote the parent of xx in SPT(s)SPT(s).

Refer to caption

Figure 7: Euclidean shortest path tree rooted at ss. The parents of vertices xx, yy and zz in SPT(s)SPT(s) are marked as ps(x)p_{s}(x), ps(y)p_{s}(y) and ps(z)p_{s}(z) respectively.

A link path between two points ss and tt in PP is a path inside PP that connects ss and tt by a chain of line segments called links. A minimum link path between ss and tt is a link path connecting ss and tt that has the minimum number of links. Observe that there may be several different minimum link paths between ss and tt. The link distance between any two points of PP is defined to be the number of links in a minimum link path between them.

3 Partitioning a simple polygon into weak visibility polygons

The partitioning algorithm partitions PP into regions according to their link distance from v1v_{1}. The algorithm starts by computing 𝒱𝒫(v1)\mathcal{VP}(v_{1}), which is the set of all points of PP whose link distance from v1v_{1} is 1. Let us denote 𝒱𝒫(v1)\mathcal{VP}(v_{1}) as V1,1V_{1,1}. Then the algorithm computes the weak visibility polygons from every constructed edge of V1,1V_{1,1}. Let vk(1)uk(1),vk(2)uk(2),,vk(c)uk(c)v_{k(1)}u_{k(1)},v_{k(2)}u_{k(2)},\dots,v_{k(c)}u_{k(c)} denote the constructed edges of V1,1V_{1,1} along bd(P)bd(P) in clockwise order from v1v_{1}, where cc is the number of constructed edges in V1,1V_{1,1}. Then the algorithm removes V1,1V_{1,1} from PP. It can be seen that the remaining polygon PV1,1P\setminus V_{1,1} consists of cc disjoint polygons P(vk(1)uk(1)),P(vk(2)uk(2)),,P(vk(c)uk(c))P(v_{k(1)}u_{k(1)}),P(v_{k(2)}u_{k(2)}),\dots,P(v_{k(c)}u_{k(c)}). For each j{1,2,,c}j\in\{1,2,\dots,c\}, the weak visibility polygon 𝒱𝒫(vk(j)uk(j))\mathcal{VP}(v_{k(j)}u_{k(j)}) is computed inside the pocket P(vk(j)uk(j))P(v_{k(j)}u_{k(j)}), and it is denoted as V2,jV_{2,j}, i.e. V2,j=𝒱𝒫(vk(j)uk(j))P(vk(j)uk(j))V_{2,j}=\mathcal{VP}(v_{k(j)}u_{k(j)})\cap P(v_{k(j)}u_{k(j)}). Let W1={V1,1}W_{1}=\{V_{1,1}\} and W2=j=1c{V2,j}W_{2}=\bigcup_{j=1}^{c}\{V_{2,j}\}. Observe that W2W_{2} is the set of all the disjoint regions of PP, such that every point of each disjoint region in W2W_{2} is at link distance two from v1v_{1}.

Repeating the same process, the algorithm computes W3,W4,,WdW_{3},W_{4},\dots,W_{d}, where dd denotes the maximum link distance of any point of PP from v1v_{1}. Note that it is not possible for any visibility polygon belonging to Wd=j=1cVd,jW_{d}=\bigcup_{j=1}^{c}V_{d,j} to have any constructed edge. Therefore, no further visibility polygon is computed. Hence, P=W1W2Wd=V1,1V2,1V2,2Vd,1Vd,2P=W_{1}\cup W_{2}\cup\ldots W_{d}=V_{1,1}\cup V_{2,1}\cup V_{2,2}\cup\ldots\cup V_{d,1}\cup V_{d,2}\cup\ldots. Thus, the algorithm returns the set W=i=1dWiW=\bigcup_{i=1}^{d}W_{i}, which is a partition of PP. We present the pseudocode for the entire partitioning algorithm below as Algorithm 1.

Algorithm 1 An algorithm for partitioning PP into visibility polygons
1:Compute 𝒱𝒫(v1)\mathcal{VP}(v_{1})
2:V1,1𝒱𝒫(v1)V_{1,1}\leftarrow\mathcal{VP}(v_{1}), W1{V1,1}W_{1}\leftarrow\{V_{1,1}\}
3:CsW1(constructed edges of s)C\leftarrow\bigcup_{s\in W_{1}}(\mbox{constructed edges of }s), c|C|c\leftarrow|C|
4:WW1W\leftarrow W_{1}, i1i\leftarrow 1
5:while c>0c>0 do
6:  ii+1i\leftarrow i+1, WiW_{i}\leftarrow\emptyset
7:  for j=1j=1 to cc do
8:   Vi,j𝒱𝒫(vk(j)uk(j))P(vk(j)uk(j))V_{i,j}\leftarrow\mathcal{VP}(v_{k(j)}u_{k(j)})\cap P(v_{k(j)}u_{k(j)})
9:   WiWi{Vi,j}W_{i}\leftarrow W_{i}\cup\{V_{i,j}\}
10:  end for
11:  WWWiW\leftarrow W\cup W_{i}
12:  CsWi(constructed edges of s)C\leftarrow\bigcup_{s\in W_{i}}(\mbox{constructed edges of }s), c|C|c\leftarrow|C|
13:end while
14:return WW

Figure 6 shows the outcome of running Algorithm 1 on a simple polygon PP having 31 vertices, where the maximum link distance of any point of PP from v1v_{1} is 5. The algorithm returns the partition W={V1,1,V2,1,V2,2,V3,1,V3,2,V3,3,,V4,1,V4,2,V5,1,V5,2,V5,3}W=\{V_{1,1},V_{2,1},V_{2,2},V_{3,1},V_{3,2},V_{3,3,},V_{4,1},V_{4,2},V_{5,1},V_{5,2},V_{5,3}\}.

It can be seen that Algorithm 1, as stated above, requires 𝒪(n2)\mathcal{O}(n^{2}) time, since the visibility polygons are computed separately. However, the running time can be improved to 𝒪(n)\mathcal{O}(n) by using the partitioning method given by Suri [29, 30] in the context of computing minimum link paths. Using the algorithm of Hershberger [17] for computing visibility graphs of PP, Suri’s algorithm computes weak visibility polygons from selected constructed edges. The same method can be used to compute weak visibility polygons from all constructed edges of visibility polygons in WW in 𝒪(n)\mathcal{O}(n) time. The visibility graph of PP is a graph which has a node corresponding to every vertex of PP and there is an edge between a pair of nodes if and only if the corresponding pair of vertices are visible from each other in PP. We summarize the result in the following theorem.

Theorem 1.

A simple polygon PP can be partitioned into visibility polygons according to their link distance from any vertex in 𝒪(n)\mathcal{O}(n) time.

4 Traversing the hierarchy of visibility polygons

Our algorithm for placement of vertex guards uses the hierarchy of visibility polygons WW, as computed in Section 3. Let Sd,Sd1,,S2,S1S_{d},S_{d-1},\ldots,S_{2},S_{1} be the set of vertex guards chosen for guarding vertices of visibility polygons in Wd,Wd1,,W2,W1W_{d},W_{d-1},\ldots,W_{2},W_{1} respectively. Since W1={V1,1}W_{1}=\{V_{1,1}\} and V1,1=𝒱𝒫(v1)V_{1,1}=\mathcal{VP}(v_{1}), we have S1={v1}S_{1}=\{v_{1}\}. So the algorithm essentially has to decide guards in Sd,Sd1,,S2S_{d},S_{d-1},\ldots,S_{2}. We have the following observation.

Lemma 2.

For every 2i<d2\leq i<d, every vertex guard in SiS_{i} belongs to some visibility polygon in Wi+1WiWi1W_{i+1}\cup W_{i}\cup W_{i-1}, and every vertex guard in SdS_{d} belongs to some visibility polygon in WdWd1W_{d}\cup W_{d-1}.

Proof.

Consider any vertex guard gSig\in S_{i}, where 2i<d2\leq i<d. Now gg can guard only vertices in 𝒱𝒫(g)\mathcal{VP}(g), and every vertex in 𝒱𝒫(g)\mathcal{VP}(g) must be at a link distance of 1 from gg. Let UU denote the set of vertices in 𝒱𝒫(g)\mathcal{VP}(g) that also belong to any Vi,jWiV_{i,j}\in W_{i}. The inclusion of gg in SiS_{i} guarantees that UU is not empty, since there exists at least one vertex yUy\in U that is guarded by gg. Now, if we consider any such yUy\in U, then the link distance between gg and yy must be 1, and also the link distance of yy from v1v_{1} must be ii. Therefore, the link distance of gg from v1v_{1} can only be i1i-1, ii, or i+1i+1, and hence gg must belong to some visibility polygon in Wi+1WiWi1W_{i+1}\cup W_{i}\cup W_{i-1}. Using the same argument, for any vertex guard gSdg\in S_{d}, gg must belong to some visibility polygon in WdWd1W_{d}\cup W_{d-1} (rather than Wd+1WdWd1W_{d+1}\cup W_{d}\cup W_{d-1}), since the level Wd+1W_{d+1} does not exist in the hierarchy WW. ∎

As can be seen from the proof of Lemma 2, the placement of guards is locally restricted to visibility polygons belonging to adjacent levels in the partition hierarchy WW. We formalize this intuition by introducing the notion of the partition tree of PP, which is a dual graph denoted by TT. Each visibility polygon Vi,jWV_{i,j}\in W is represented as a vertex of TT (also denoted by Vi,jV_{i,j}), and two vertices of TT are connected by an edge in TT if and only if the corresponding visibility polygons share a constructed edge. Treating V1,1V_{1,1} as the root of TT, the standard parent-child-sibling relationships can be imposed between the visibility polygons in WW.

Our algorithm starts off by guarding all vertices belonging to the visibility polygons in Wd={Vd,1,Vd,2,}W_{d}=\{V_{d,1},V_{d,2},\dots\}, which are effectively the nodes of TT furthest from the root V1,1V_{1,1}. The algorithm scans Vd,1V_{d,1},Vd,2V_{d,2},…separately for identifying the respective guards in SdS_{d}. We know from Lemma 2 that every vertex guard in SdS_{d} belongs to some visibility polygon in WdWd1W_{d}\cup W_{d-1}. Consider a particular Vd,kWdV_{d,k}\in W_{d}, and let Vd1,jWd1V_{d-1,j}\in W_{d-1} be the parent of Vd,kV_{d,k} in TT. Consider the constructed edge vkukv_{k}u_{k} between Vd,kV_{d,k} and Vd1,jV_{d-1,j}. For guarding the vertices of Vd,k=𝒱𝒫(vkuk)Vd1,jV_{d,k}=\mathcal{VP}(v_{k}u_{k})\setminus V_{d-1,j}, it is enough to focus on the subpolygon QQ consisting of Vd,kV_{d,k} itself and the portion of Vd1,jV_{d-1,j} that is weakly visible from vkukv_{k}u_{k}. So, the subproblem of guarding Vd,kV_{d,k} (or any other visibility polygon belonging to WdW_{d}) essentially reduces to placing vertex guards in a polygon containing a weak visibility chord vuvu (corresponding to vkukv_{k}u_{k} in the original subproblem) in order to guard only the vertices lying on one side of uvuv; however, vertex guards can be chosen freely from either side of the chord uvuv. We discuss the placement of guards in this reduced problem in Section 5.

Instead of guarding each weak visibility polygon QQ separately, common vertex guards can be placed by traversing the boundary of overlapping weak visibility polygons. Let us explain by considering any Vd1,jWd1V_{d-1,j}\in W_{d-1}. Let us denote the constructed edges that are shared between Vd1,jV_{d-1,j} and the mm children of Vd1,jV_{d-1,j} as vj(1)uj(1),vj(2)uj(2),,vj(m)uj(m)v_{j(1)}u_{j(1)},v_{j(2)}u_{j(2)},\dots,v_{j(m)}u_{j(m)} respectively. Using all these constructed edges, let us construct the weak visibility polygons 𝒱𝒫(vj(1)uj(1))\mathcal{VP}(v_{j(1)}u_{j(1)}), 𝒱𝒫(vj(2)uj(2))\mathcal{VP}(v_{j(2)}u_{j(2)}), \dots, 𝒱𝒫(vj(m)uj(m))\mathcal{VP}(v_{j(m)}u_{j(m)}). Observe that each such weak visibility polygon is divided into two portions by the corresponding constructed edge; one of the portions forms a child of Vd1,jV_{d-1,j} belonging to WdW_{d}, whereas the other portion is a subregion of Vd1,jV_{d-1,j} itself. Moreover, for several of the weak visibility polygons among 𝒱𝒫(vj(1)uj(1)),𝒱𝒫(vj(2)uj(2)),,𝒱𝒫(vj(m)uj(m))\mathcal{VP}(v_{j(1)}u_{j(1)}),\mathcal{VP}(v_{j(2)}u_{j(2)}),\dots,\mathcal{VP}(v_{j(m)}u_{j(m)}), the second portions may have overlapping subregions in Vd1,jV_{d-1,j}. Thus, there may exist vertex guards in these overlapping subregions that can see portions of several of the children of Vd1,jV_{d-1,j}. Therefore, for guarding vertices of polygons from WdW_{d}, let us extend the definition of QQ to be the union of all the overlapping weak visibility polygons defined by the constructed edges corresponding to the children of each Vd1,jV_{d-1,j}. For instance, consider the constructed edges v17u17v_{17}u_{17}, v21u21v_{21}u_{21} and v23u23v_{23}u_{23} on the boundary of V4,1V_{4,1} in Figure 6; for guarding the corresponding children V5,1V_{5,1}, V5,2V_{5,2} and V5,3V_{5,3} respectively, we define QQ as 𝒱𝒫(v17u17)𝒱𝒫(v21u21)𝒱𝒫(v23u23)\mathcal{VP}(v_{17}u_{17})\cup\mathcal{VP}(v_{21}u_{21})\cup\mathcal{VP}(v_{23}u_{23}) and traverse QQ.

After having successively computed SdS_{d} for guarding vertices belonging to visibility polygons in Wd={Vd,1,Vd,2,}W_{d}=\{V_{d,1},V_{d,2},\dots\}, the algorithm next computes Sd1S_{d-1} for guarding vertices belonging to visibility polygons in Wd1={Vd1,1,Vd1,2,}W_{d-1}=\{V_{d-1,1},V_{d-1,2},\dots\}. Since all vertices belonging to visibility polygons in WdW_{d} are already marked by guards chosen belonging to SdS_{d}, all remaining unmarked vertices of PP can have link distance at most d1d-1 from v1v_{1}. So, any weak visibility polygon Vd1,kWd1V_{d-1,k}\in W_{d-1} can now be treated as a weak visibility polygon that is the farthest link distance from v1v_{1}. Therefore, the guards of Sd1S_{d-1} are chosen in a similar way as those of SdS_{d}. It can be seen that this same method can be used for computing SiS_{i} for every i<di<d. Thus, in successive phases, our algorithm computes the guard sets Sd,Sd1,Sd2,,S2S_{d},S_{d-1},S_{d-2},\ldots,S_{2} for guarding vertices belonging to visibility polygons in Wd,Wd1,Wd2,,W2W_{d},W_{d-1},W_{d-2},\ldots,W_{2} respectively, until it finally terminates after placing a single guard at v1v_{1} for guarding vertices of V1,1W1V_{1,1}\in W_{1}. The final guard set S=SdSd1Sd2S2S1S=S_{d}\cup S_{d-1}\cup S_{d-2}\cup\dots\cup S_{2}\cup S_{1} returned by the algorithm guards all vertices of PP. The pseudocode for the entire algorithmic framework is provided below.

Algorithm 1 Algorithm for computing a guard set SS from the partition tree TT rooted at v1v_{1}
1:Initialize all vertices of PP as unmarked
2:dd\leftarrow number of levels in the partition tree TT
3:for  each i{d1,,3,2,1}i\in\{d-1,\dots,3,2,1\}  do \triangleright Traverse starting from the 2nd deepest level of TT
4:  Si+1S_{i+1}\leftarrow\emptyset
5:  ci|Wi|c_{i}\leftarrow|W_{i}| \triangleright cic_{i} denotes the number of nodes at the iith level of TT
6:  for  each j{1,2,,ci}j\in\{1,2,\dots,c_{i}\}  do
7:   Place new guards in Si+1S_{i+1} for guarding every unmarked vertex of all children of Vi,jV_{i,j}
8:   Mark all vertices of PP that are visible from the new guards added to Si+1S_{i+1}
9:  end for
10:end for
11:S1{v1}S_{1}\leftarrow\{v_{1}\}
12:return S=SdSd1Sd2S2S1S=S_{d}\cup S_{d-1}\cup S_{d-2}\cup\dots\cup S_{2}\cup S_{1}

The procedure for placing new guards in Si+1S_{i+1} for guarding all children of a particular Vi,jV_{i,j}, as mentioned in line 7 of Algorithm 1, is presented in detail in Section 5.

5 Placement of Vertex Guards in a Weak Visibility Polygon

Let QQ be a simple polygon that is weakly visible from an internal chord uvuv, i.e. we have 𝒱𝒫(uv)=Q\mathcal{VP}(uv)=Q. Observe that the chord uvuv splits QQ into two sub-polygons QUQ_{U} and QLQ_{L} as follows. The sub-polygon bounded by bdc(u,v)bd_{c}(u,v) and uvuv, is denoted as QUQ_{U}, and the sub-polygon bounded by bdcc(u,v)bd_{cc}(u,v) and uvuv, is denoted as QLQ_{L}. As a first step, our algorithm (see Algorithm 2) places a set of vertex guards, denoted by SS, for guarding only the vertices belonging to QUQ_{U}, though SS is allowed to contain guards from both QUQ_{U} and QLQ_{L}.

Let GoptG_{opt} be a set of optimal vertex guards for guarding all points of QUQ_{U}, including interior points. Let GoptUG_{opt}^{U} and GoptLG_{opt}^{L} be the subsets of guards in GoptG_{opt} that belong to QUQ_{U} (i.e. lie on bdc(u,v)bd_{c}(u,v)) and QLQ_{L} (i.e. lie on bdcc(u,v)bd_{cc}(u,v)) respectively. Since GoptUG_{opt}^{U} and GoptLG_{opt}^{L} form a partition of GoptG_{opt}, |GoptU|+|GoptL|=|Gopt||G_{opt}^{U}|+|G_{opt}^{L}|=|G_{opt}|.

5.1 Concept of Inside and Outside Guards

Suppose we wish to guard an arbitrary vertex zz of QUQ_{U}. Then, a guard must be placed at a vertex of QQ belonging to 𝒱𝒫(z)\mathcal{VP}(z). Henceforth, let 𝒱𝒱𝒫(z)\mathcal{VVP}(z) denote the set of all polygonal vertices of 𝒱𝒫(z)\mathcal{VP}(z). Further, let us define the inward visible vertices and the outward visible vertices of zz, denoted by 𝒱𝒱𝒫+(z)\mathcal{VVP}^{+}(z) and 𝒱𝒱𝒫(z)\mathcal{VVP}^{-}(z) respectively, as follows.

𝒱𝒱𝒫+(z)={x𝒱𝒱𝒫(z):the segment zx does not intersect uv}\mathcal{VVP}^{+}(z)=\{x\in\mathcal{VVP}(z):\mbox{the segment $zx$ does not intersect $uv$}\}

𝒱𝒱𝒫(z)={x𝒱𝒱𝒫(z):the segment zx intersects uv}\mathcal{VVP}^{-}(z)=\{x\in\mathcal{VVP}(z):\mbox{the segment $zx$ intersects $uv$}\}

We shall henceforth refer to the vertex guards belonging to 𝒱𝒱𝒫+(z)\mathcal{VVP}^{+}(z) and 𝒱𝒱𝒫(z)\mathcal{VVP}^{-}(z) as inside guards and outside guards for zz respectively.

Consider the weakly visible polygon in Figure 9, where the three vertices z1z_{1}, z2z_{2} and z3z_{3} of QUQ_{U} are such that their respective sets of outward visible vertices are pairwise disjoint, i.e. 𝒱𝒱𝒫(z1)𝒱𝒱𝒫(z2)=\mathcal{VVP}^{-}(z_{1})\cap\mathcal{VVP}^{-}(z_{2})=\emptyset, 𝒱𝒱𝒫(z2)𝒱𝒱𝒫(z3)=\mathcal{VVP}^{-}(z_{2})\cap\mathcal{VVP}^{-}(z_{3})=\emptyset, and 𝒱𝒱𝒫(z1)𝒱𝒱𝒫(z3)=\mathcal{VVP}^{-}(z_{1})\cap\mathcal{VVP}^{-}(z_{3})=\emptyset. If an algorithm chooses only outside guards, then three separate guards are required for guarding z1z_{1}, z2z_{2} and z3z_{3}. However, an optimal solution may place a single guard on any one of the five vertices of QUQ_{U} for guarding z1z_{1}, z2z_{2} and z3z_{3}.

Refer to caption

Figure 8: Example showing the need for placement of inside guards. Note that 𝒱𝒱𝒫(z1)𝒱𝒱𝒫(z2)=\mathcal{VVP}^{-}(z_{1})\cap\mathcal{VVP}^{-}(z_{2})=\emptyset, 𝒱𝒱𝒫(z2)𝒱𝒱𝒫(z3)=\mathcal{VVP}^{-}(z_{2})\cap\mathcal{VVP}^{-}(z_{3})=\emptyset, and 𝒱𝒱𝒫(z1)𝒱𝒱𝒫(z3)=\mathcal{VVP}^{-}(z_{1})\cap\mathcal{VVP}^{-}(z_{3})=\emptyset.

Refer to caption

Figure 9: Example showing the need for placement of outside guards. Note that 𝒱𝒱𝒫+(z1)𝒱𝒱𝒫+(z2)=\mathcal{VVP}^{+}(z_{1})\cap\mathcal{VVP}^{+}(z_{2})=\emptyset, 𝒱𝒱𝒫+(z2)𝒱𝒱𝒫+(z3)=\mathcal{VVP}^{+}(z_{2})\cap\mathcal{VVP}^{+}(z_{3})=\emptyset, and 𝒱𝒱𝒫+(z1)𝒱𝒱𝒫+(z3)=\mathcal{VVP}^{+}(z_{1})\cap\mathcal{VVP}^{+}(z_{3})=\emptyset.

On the other hand, in Figure 9, the three vertices z1z_{1}, z2z_{2} and z3z_{3} of QUQ_{U} are such that their respective sets of inward visible vertices are pairwise disjoint, i.e. 𝒱𝒱𝒫+(z1)𝒱𝒱𝒫+(z2)=\mathcal{VVP}^{+}(z_{1})\cap\mathcal{VVP}^{+}(z_{2})=\emptyset, 𝒱𝒱𝒫+(z2)𝒱𝒱𝒫+(z3)=\mathcal{VVP}^{+}(z_{2})\cap\mathcal{VVP}^{+}(z_{3})=\emptyset, and 𝒱𝒱𝒫+(z1)𝒱𝒱𝒫+(z3)=\mathcal{VVP}^{+}(z_{1})\cap\mathcal{VVP}^{+}(z_{3})=\emptyset. If an algorithm chooses only inside guards, then three separate guards are required for guarding z1z_{1}, z2z_{2} and z3z_{3}. However, the outward visible vertices of z1z_{1}, z2z_{2} and z3z_{3} overlap; and moreover there exists a vertex YY of QLQ_{L} such that G𝒱𝒱𝒫(z1)𝒱𝒱𝒫(z2)𝒱𝒱𝒫(z3)G\in\mathcal{VVP}^{-}(z_{1})\cap\mathcal{VVP}^{-}(z_{2})\cap\mathcal{VVP}^{-}(z_{3}). Thus, an optimal solution may choose yy as an outside guard for guarding z1z_{1}, z2z_{2} and z3z_{3} together.

The above discussion suggests that it is better to choose guards from both 𝒱𝒱𝒫+(z)\mathcal{VVP}^{+}(z) and 𝒱𝒱𝒫(z)\mathcal{VVP}^{-}(z) for guarding the same vertex zz of QUQ_{U}, in order to prevent computing a guard SS that is arbitrarily large compared to GoptG_{opt}. Therefore, our algorithm selects a subset ZZ of vertices of QUQ_{U}, and places a fixed number of both inside and outside guards corresponding to each of them, so that these guards together see the entire QUQ_{U}. Moreover, the vertices in ZZ (and also the guards corresponding to them) are selected in such a way that they correspond to the guards in GoptG_{opt}, though the correspondence is not necessarily one-to-one, and this enables us to provide an approximation bound on our chosen set of guards. We henceforth refer to this subset ZZ of selected vertices as primary vertices. Further, let ZUZZ^{U}\subseteq Z be such that each primary vertex in ZUZ^{U} is visible from at least one guard in GoptUG_{opt}^{U}. Similarly, let ZLZZ^{L}\subseteq Z be such that each primary vertex in ZLZ^{L} is visible from at least one guard in GoptLG_{opt}^{L}. Since any zZz\in Z must be visible from at least one guard of GoptUG_{opt}^{U} or GoptLG_{opt}^{L}, we have Z=ZUZLZ=Z^{U}\cup Z^{L}, and so we have:

|Z||ZU|+|ZL||Z|\leq|Z^{U}|+|Z^{L}| (1)

The general strategy for placement of guards by our algorithm for guarding only the vertices of QUQ_{U} aims to establish a constant-factor approximation bound on SS by separately proving the following three bounds.

|S|c|Z||S|\leq c\cdot|Z| (2)
|ZL|c1|GoptL||Z^{L}|\leq c_{1}\cdot|G_{opt}^{L}| (3)
|ZU|c2|GoptU||Z^{U}|\leq c_{2}\cdot|G_{opt}^{U}| (4)

The above inequalities (1), (2), (3) and (4) together imply the following conclusion.

|S|c.|Z|c.|ZL|+c.|ZU|c.c1|GoptL|+c.c2|GoptU|c.max(c1,c2)|Gopt||S|\leq c.|Z|\leq c.|Z^{L}|+c.|Z^{U}|\leq c.c_{1}\cdot|G_{opt}^{L}|+c.c_{2}\cdot|G_{opt}^{U}|\leq c.\max(c_{1},c_{2})\cdot|G_{opt}| (5)

5.2 Selection of Primary Vertices

Observe that, for any vertex zkZz_{k}\in Z, both 𝒱𝒱𝒫+(zk)\mathcal{VVP}^{+}(z_{k}) and 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}) may be considered to be ordered sets by taking into account the natural ordering of the visible vertices of QQ in clockwise order along bdc(u,v)bd_{c}(u,v) and in counter-clockwise order along bdcc(u,v)bd_{cc}(u,v) respectively. Let us denote the first visible vertex and the last visible vertex belonging to the ordered set 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}) by f(zk)f(z_{k}) and l(zk)l(z_{k}) respectively (see Figure 9). Also, we denote by l(zk)l^{\prime}(z_{k}) (similarly, f(zk)f^{\prime}(z_{k})) the last visible point (similarly, first visible point) of 𝒱𝒫(zk)bdcc(u,v)\mathcal{VP}(z_{k})\cap bd_{cc}(u,v), which is obtained by extending the ray zkp(v,zk)\overrightarrow{z_{k}p(v,z_{k})} (respectively, zkp(u,zk)\overrightarrow{z_{k}p(u,z_{k})}) till it touches bdcc(u,v)bd_{cc}(u,v), where p(v,zk)p(v,z_{k}) (similarly, p(u,zk)p(u,z_{k})) is the parent of zkz_{k} in SPT(v)SPT(v) (respectively, SPT(u)SPT(u)). Observe that bdcc(f(zk),l(zk))𝒱𝒫(zk)bd_{cc}(f^{\prime}(z_{k}),l^{\prime}(z_{k}))\cap\mathcal{VP}(z_{k}) is the only portion of the boundary bdcc(u,v)bd_{cc}(u,v) that has vertices visible from zkz_{k}. Note that all vertices of bdcc(f(zk),l(zk))bd_{cc}(f^{\prime}(z_{k}),l^{\prime}(z_{k})) may not be visible from zkz_{k}, since some of them may lie inside left or right pockets of 𝒱𝒫(zk)\mathcal{VP}(z_{k}). Similarly, observe that bdc(p(u,zk),p(v,zk))bd_{c}(p(u,z_{k}),p(v,z_{k})) is the only portion of the boundary bdc(u,v)bd_{c}(u,v) that has vertices visible from zkz_{k}. Note that all vertices of bdcc(p(u,zk),p(v,zk))bd_{cc}(p(u,z_{k}),p(v,z_{k})) may not be visible from zkz_{k}, since some of them may lie inside left or right pockets of 𝒱𝒫(zk)\mathcal{VP}(z_{k}).

Let us discuss how primary vertices are selected by our algorithm. Initially, since all vertices of QUQ_{U} are unguarded, they are considered to be unmarked. As vertex guards are placed over successive iterations, vertices of QUQ_{U} are marked as soon as they become visible from some guard placed so far. In the kk-th iteration, the next primary vertex zkZz_{k}\in Z chosen by our algorithm is an unmarked vertex such that l(zk)l^{\prime}(z_{k}) precedes l(x)l^{\prime}(x) (henceforth denoted notationally as l(zk)l(x)l^{\prime}(z_{k})\prec l^{\prime}(x)) for any other unmarked vertex xx of QUQ_{U}. An immediate consequence of such choice of the primary vertex zkz_{k} is that all vertices on bdc(zk,p(v,zk))bd_{c}(z_{k},p(v,z_{k})) must already be marked.

Lemma 3.

If zkz_{k} is chosen as the next primary vertex by Algorithm 1, then no unmarked vertices exist on bdc(zk,p(v,zk))bd_{c}(z_{k},p(v,z_{k})).

Proof.

Let us assume, on the contrary, that there exists a vertex qq on bdc(zk,p(v,zk))bd_{c}(z_{k},p(v,z_{k})) that is yet to be marked. Observe that the ray qp(v,q)\overrightarrow{qp(v,q)} must intersect the ray zkp(v,zk)\overrightarrow{z_{k}p(v,z_{k})} at a point between zkz_{k} and p(v,zk)p(v,z_{k}), which implies that l(q)l(zk)l^{\prime}(q)\prec l^{\prime}(z_{k}) on bdcc(u,v)bd_{cc}(u,v) (see Figure 11). So, in the current iteration, qq rather than zkz_{k} is chosen as the next primary vertex, which is a contradiction. ∎

In Section 5.3, we consider guarding vertices of QUQ_{U} in a special scenario where GoptG_{opt} uses vertex guards only from QLQ_{L}. In Section 5.4, we consider guarding vertices of QUQ_{U} in the general scenario where the guards of GoptG_{opt} are not restricted to QLQ_{L}. In Section 5.5, we enhance the procedure for guarding vertices to ensure that all interior points of QUQ_{U} are guarded as well.

5.3 Placement of guards in a special scenario

Let us consider a special scenario where GoptL=GoptG_{opt}^{L}=G_{opt} and GoptU=G_{opt}^{U}=\emptyset, i.e. GoptG_{opt} uses only vertex guards from QLQ_{L}. In such a scenario, for every vertex zkZz_{k}\in Z, 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}) must contain a guard from GoptG_{opt}. So, a natural idea is to place outside guards in a greedy manner so that they lie in the common intersection of outward visible vertices of as many vertices of QUQ_{U} as possible. For any primary vertex zkz_{k}, let us denote by 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) the set of unmarked vertices of QUQ_{U} whose outward visible vertices overlap with those of zkz_{k}. In other words,

𝒪𝒱𝒱(zk)={x𝒱(QU): x is unmarked, and 𝒱𝒱𝒫(zk)𝒱𝒱𝒫(x)}\mathcal{OVV}^{-}(z_{k})=\{x\in\mathcal{V}(Q_{U}):\mbox{ $x$ is unmarked, and }\mathcal{VVP}^{-}(z_{k})\cap\mathcal{VVP}^{-}(x)\neq\emptyset\}

So, each vertex of QUQ_{U} belonging to 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) is visible from at least one vertex of 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}). Further, 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) can be considered to be an ordered set, where for any pair of elements x1,x2𝒪𝒱𝒱(zk)x_{1},x_{2}\in\mathcal{OVV}^{-}(z_{k}), we define x1x2x_{1}\prec x_{2} if and only if l(x1)l^{\prime}(x_{1}) precedes l(x2)l^{\prime}(x_{2}) in counter-clockwise order on bdcc(u,v)bd_{cc}(u,v). For the current primary vertex zkz_{k}, let us assume without loss of generality that 𝒪𝒱𝒱(zk)={x1k,x2k,x3k,xm(k)k}\mathcal{OVV}^{-}(z_{k})=\{x^{k}_{1},x^{k}_{2},x^{k}_{3},\dots\,x^{k}_{m(k)}\} such that l(x1k)l(x2k)l(xm(k)k)l^{\prime}(x^{k}_{1})\prec l^{\prime}(x^{k}_{2})\prec\dots\prec l^{\prime}(x^{k}_{m(k)}) in counter-clockwise order on bdcc(u,v)bd_{cc}(u,v).

Let us partition the vertices belonging to 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) into 3 sets, viz. AkA^{k}, BkB^{k} and CkC^{k} in the following manner. Every vertex of 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) visible from l(zk)l(z_{k}) is included in BkB^{k}. Observe that, by definition zkBkz^{k}\in B^{k}. Obviously, for each vertex xik𝒪𝒱𝒱(zk)Bkx^{k}_{i}\in\mathcal{OVV}^{-}(z_{k})\setminus B^{k}, xikx^{k}_{i} is not visible from l(zk)l(z_{k}) due to the presence of some constructed edge. The vertices of 𝒪𝒱𝒱(zk)Bk\mathcal{OVV}^{-}(z_{k})\setminus B^{k} are categorized into AkA^{k} and CkC^{k} based on whether this constructed edge creates a right pocket or a left pocket. Suppose xik𝒪𝒱𝒱(zk)Bkx^{k}_{i}\in\mathcal{OVV}^{-}(z_{k})\setminus B^{k} is a vertex such that 𝒱𝒫(xik)\mathcal{VP}(x^{k}_{i}) creates a constructed edge t(xik)t(xik)t(x^{k}_{i})t^{\prime}(x^{k}_{i}), where t(xik)𝒱(QL)t(x^{k}_{i})\in\mathcal{V}(Q_{L}) is a polygonal vertex and t(xik)t^{\prime}(x^{k}_{i}) is the point where xikt(xik)\overrightarrow{x^{k}_{i}t(x^{k}_{i})} first intersects bdcc(u,v)bd_{cc}(u,v). If t(xik)t(x^{k}_{i}) lies on bdcc(f(zk),l(zk))bd_{cc}(f^{\prime}(z_{k}),l^{\prime}(z_{k})) and t(xik)t^{\prime}(x^{k}_{i}) lies on bdcc(l(zk),v)bd_{cc}(l(z_{k}),v), i.e. if f(zk)t(xik)l(zk)f(z_{k})\prec t(x^{k}_{i})\prec l^{\prime}(z_{k}) and l(zk)t(xik)vl(z_{k})\prec t^{\prime}(x^{k}_{i})\prec v, then xikx^{k}_{i} is included in AkA^{k}. For instance, in Figure 11, x12A2x_{1}^{2}\in A^{2} due to the constructed edge t(x12)t(x12)t(x_{1}^{2})t^{\prime}(x_{1}^{2}). On the other hand, if t(xik)t(x^{k}_{i}) lies on bdcc(l(zk),v)bd_{cc}(l^{\prime}(z_{k}),v) and t(xik)t^{\prime}(x^{k}_{i}) lies on bdcc(f(zk),l(zk))bd_{cc}(f(z_{k}),l^{\prime}(z_{k})), i.e. if l(zk)t(xik)vl^{\prime}(z_{k})\prec t(x^{k}_{i})\prec v and f(zk)t(xik)l(zk)f(z_{k})\prec t^{\prime}(x^{k}_{i})\prec l^{\prime}(z_{k}), then xikx^{k}_{i} is included in CkC^{k}. For instance, in Figure 11, x32C2x_{3}^{2}\in C^{2} due to the constructed edge t(x32)t(x32)t(x_{3}^{2})t^{\prime}(x_{3}^{2}). Observe that, all vertices of AkA^{k} must lie on bdc(u,zk)bd_{c}(u,z_{k}), whereas all vertices of CkC^{k} must lie on bdc(zk,v)bd_{c}(z_{k},v).

Lemma 4.

The vertex l(zk)l(z_{k}) sees all vertices belonging to BkB^{k}.

Proof.

We know that, due to the choice of the primary vertex zkz_{k}, f(x)l(zk)l(x)f^{\prime}(x)\prec l(z_{k})\prec l^{\prime}(x) for every vertex x𝒪𝒱𝒱(zk)x\in\mathcal{OVV}^{-}(z_{k}). Therefore, if xx is not visible from l(zk)l(z_{k}), then there must exist a constructed edge t(x)t(x)t(x)t^{\prime}(x) of 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}) such that (i) either t(x)𝒱𝒱𝒫(zk)t(x)\in\mathcal{VVP}^{-}(z_{k}), in which case xx must belong to AkA^{k}, or (ii) t(x)t(x) lies on bdcc(l(zk),v)bd_{cc}(l^{\prime}(z_{k}),v), in which case xx must belong to CkC^{k}. So, if xBkx\in B^{k}, xx must be visible from l(zk)l(z_{k}). In other words, l(zk)l(z_{k}) sees all vertices belonging to BkB^{k}. ∎

Corollary 5.

The shortest paths from l(zk)l(z_{k}) to any vertex of AkA^{k} makes only left turns, whereas the shortest paths from l(zk)l(z_{k}) to any vertex of CkC^{k} makes only right turns.

Corollary 6.

If bdcc(f(zk),l(zk))bd_{cc}(f(z_{k}),l(z_{k})) is convex, then Ak=Ck=A^{k}=C^{k}=\emptyset and Bk=𝒪𝒱𝒱(zk)B^{k}=\mathcal{OVV}^{-}(z_{k}), which implies that all vertices of 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) are visible from l(zk)l(z_{k}).

For any X𝒪𝒱𝒱(zk)X\subseteq\mathcal{OVV}^{-}(z_{k}), we define 𝒞(X)=xX𝒱𝒱𝒫(x)\mathcal{CI}(X)=\bigcap_{x\in X}\mathcal{VVP}^{-}(x), which implies that, for each vertex y𝒞(X)y\in\mathcal{CI}(X), all the vertices belonging to XX are visible from yy, and hence can be guarded by placing a vertex guard at yy. By definition, for any X𝒪𝒱𝒱(zk)X\subseteq\mathcal{OVV}^{-}(z_{k}), the vertices belonging to 𝒞(X)\mathcal{CI}(X) lie on bdcc(u,v)bd_{cc}(u,v).

Lemma 7.

For every k{1,2,,|Z|}k\in\{1,2,\dots,|Z|\}, 𝒞(Bk)\mathcal{CI}(B^{k})\neq\emptyset.

Proof.

It follows directly from Lemma 4 that l(zk)𝒱𝒱𝒫(x)l(z_{k})\in\mathcal{VVP}^{-}(x) for every xBkx\in B^{k}. Thus, l(zk)xBk𝒱𝒱𝒫(x)l(z_{k})\in\bigcap_{x\in B^{k}}\mathcal{VVP}^{-}(x), i.e. l(zk)𝒞(Bk)l(z_{k})\in\mathcal{CI}(B^{k}). ∎

Depending on the vertices in AkA^{k}, BkB^{k} and CkC^{k}, we have the following exhaustive cases because 𝒞(Bk)\mathcal{CI}(B^{k})\neq\emptyset by Lemma 4.

Case 1 -

𝒞(AkBkCk)\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})\neq\emptyset (see Figure 11)

Case 2 -

𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset and 𝒞(Bk)\mathcal{CI}(B^{k})\neq\emptyset

     Case 2a -

𝒞(Ak)\mathcal{CI}(A^{k})\neq\emptyset and 𝒞(Ck)\mathcal{CI}(C^{k})\neq\emptyset (see Figure 12)

     Case 2b -

𝒞(Ak)=\mathcal{CI}(A^{k})=\emptyset and 𝒞(Ck)\mathcal{CI}(C^{k})\neq\emptyset (see Figure 13)

     Case 2c -

𝒞(Ak)\mathcal{CI}(A^{k})\neq\emptyset and 𝒞(Ck)=\mathcal{CI}(C^{k})=\emptyset (see Figure 14)

     Case 2d -

𝒞(Ak)=\mathcal{CI}(A^{k})=\emptyset and 𝒞(Ck)=\mathcal{CI}(C^{k})=\emptyset (see Figure 15)

Refer to caption

Figure 10: The choice of the next primary vertex.

Refer to caption

Figure 11: Figure for Case 1, where A2={x12}A^{2}=\{x_{1}^{2}\}, B2{x22}B^{2}\supseteq\{x_{2}^{2}\}, C2={x32}C^{2}=\{x_{3}^{2}\}, and s12𝒞(A2B2C2)s_{1}^{2}\in\mathcal{CI}(A^{2}\cup B^{2}\cup C^{2}).

Consider Case 1, where 𝒞(AkBkCk)\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})\neq\emptyset (see Figure 11, and line 16 of Algorithm 1). Here, the algorithm places a vertex guard s3ks_{3}^{k} at any vertex belonging to 𝒞(AkBkCk)\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k}) (in line 19). So, every vertex in 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) is visible from s3ks_{3}^{k} and are hence marked after the placement of the guard at s3ks_{3}^{k}.

Lemma 8.

If 𝒞(AkBkCk)\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})\neq\emptyset, then all vertices belonging to 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) are visible from the vertex guard placed at s3ks_{3}^{k}. Therefore, no vertex xik𝒪𝒱𝒱(zk)x_{i}^{k}\in\mathcal{OVV}^{-}(z_{k}) can be a primary vertex zjz_{j} for any j>kj>k.

Refer to caption

Figure 12: Figure for Case 2a, where Ak={x1k,x3k}A^{k}=\{x_{1}^{k},x_{3}^{k}\}, Bk={x2k,x6k}B^{k}=\{x_{2}^{k},x_{6}^{k}\}, Ck={x4k,x5k}C^{k}=\{x_{4}^{k},x_{5}^{k}\}, 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset, s1k𝒞(Ak)s_{1}^{k}\in\mathcal{CI}(A^{k}), s2k𝒞(Ck)s_{2}^{k}\in\mathcal{CI}(C^{k}), and s3k𝒞(Bk)s_{3}^{k}\in\mathcal{CI}(B^{k}).

Now consider Case 2a, where 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset, 𝒞(Ak)\mathcal{CI}(A^{k})\neq\emptyset, and 𝒞(Ck)\mathcal{CI}(C^{k})\neq\emptyset (see Figure 12). Here, Algorithm 1 places three vertex guards, viz. s1k𝒞(Ak)s_{1}^{k}\in\mathcal{CI}(A^{k}), s2k𝒞(Ck)s_{2}^{k}\in\mathcal{CI}(C^{k}), and s3k𝒞(Bk)s_{3}^{k}\in\mathcal{CI}(B^{k}) (in lines 21, 33 and 19 respectively). So, the three vertex guards placed by the algorithm together see all the vertices of 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}), and of course zkz_{k} itself. It is important to note that s1ks_{1}^{k} or s2ks_{2}^{k} may not belong to 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}), but s3ks_{3}^{k} must belong to 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}).

Lemma 9.

If 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset, 𝒞(Ak)\mathcal{CI}(A^{k})\neq\emptyset, and 𝒞(Ck)\mathcal{CI}(C^{k})\neq\emptyset, then all vertices belonging to 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) are visible from at least one of the three vertex guards placed at s1ks_{1}^{k}, s2ks_{2}^{k}, and s3ks_{3}^{k}. Therefore, no vertex xik𝒪𝒱𝒱(zk)x_{i}^{k}\in\mathcal{OVV}^{-}(z_{k}) can be a primary vertex zjz_{j} for any j>kj>k.

Refer to caption

Figure 13: Figure for Case 2b, where Ak={x1k,x3k}A^{k}=\{x_{1}^{k},x_{3}^{k}\}, Bk={x2k,x6k}B^{k}=\{x_{2}^{k},x_{6}^{k}\}, Ck={x4k,x5k}C^{k}=\{x_{4}^{k},x_{5}^{k}\}, 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset, 𝒞(Ak)=\mathcal{CI}(A^{k})=\emptyset, s2k𝒞(Ck)s_{2}^{k}\in\mathcal{CI}(C^{k}), and s3k𝒞(Bk)s_{3}^{k}\in\mathcal{CI}(B^{k}).

Consider Case 2b, where 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset, 𝒞(Ak)=\mathcal{CI}(A^{k})=\emptyset, and 𝒞(Ck)\mathcal{CI}(C^{k})\neq\emptyset (see Figure 13). Observe that a vertex of 𝒞(Ck)\mathcal{CI}(C^{k}) may not lie within 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}), but rather lie on bdcc(l(zk,v))bd_{cc}(l^{\prime}(z_{k},v)). The algorithm places two vertex guards, one at a vertex s2k𝒞(Ck)s_{2}^{k}\in\mathcal{CI}(C^{k}), and another one at a vertex s3k𝒞(Bk)s_{3}^{k}\in\mathcal{CI}(B^{k}). Note that s2ks_{2}^{k} or s3ks_{3}^{k} may see some of the vertices of AkA^{k}, which may get marked as a consequence. However, assuming that none of the vertices of AkA^{k} are marked due to the placement of s2ks_{2}^{k} and s3ks_{3}^{k} (in lines 33 and 19 respectively of Algorithm 1), a third vertex guard s1ks_{1}^{k} is also chosen to guard at least a subset of AkA^{k}, since 𝒞(Ak)=\mathcal{CI}(A^{k})=\emptyset. In order to choose the vertex guard s1ks_{1}^{k} for guarding a subset of AkA^{k}, 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}) is traversed counter-clockwise starting from f(zk)f(z_{k}), till a vertex yy is encountered such that there exists a vertex xikAkx_{i}^{k}\in A^{k} which is visible from yy but not from any subsequent vertex of 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}). So, this vertex y=t(xik)y=t(x_{i}^{k}) is chosen (in line 27 for Algorithm 1) as the vertex guard s1ks_{1}^{k}. It can be seen that once such a guard is placed at s1k=t(xik)s_{1}^{k}=t(x_{i}^{k}), some of the vertices in AkA^{k} are visible from xikx_{i}^{k}, and are therefore marked. Let us denote the remaining vertices of AkA^{k} that are still unmarked as A1kA^{k}_{1}. We have the following lemma.

Lemma 10.

If 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset, 𝒞(Ak)=\mathcal{CI}(A^{k})=\emptyset, and 𝒞(Ck)\mathcal{CI}(C^{k})\neq\emptyset, then all vertices belonging to 𝒪𝒱𝒱(zk)A1k\mathcal{OVV}^{-}(z_{k})\setminus A^{k}_{1} are visible from one of the vertex guards placed at s1ks_{1}^{k}, s2ks_{2}^{k}, and s3ks_{3}^{k}. Therefore, no vertex xik𝒪𝒱𝒱(zk)x_{i}^{k}\in\mathcal{OVV}^{-}(z_{k}) can be a primary vertex zjz_{j} for any j>kj>k unless xikA1kx_{i}^{k}\in A^{k}_{1}.

Refer to caption

Figure 14: Figure for Case 2c, where Ak={x1k,x3k}A^{k}=\{x_{1}^{k},x_{3}^{k}\}, Bk={x2k,x6k}B^{k}=\{x_{2}^{k},x_{6}^{k}\}, Ck={x4k,x5k}C^{k}=\{x_{4}^{k},x_{5}^{k}\}, 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset, s1k𝒞(Ak)s_{1}^{k}\in\mathcal{CI}(A^{k}), 𝒞(Ck)=\mathcal{CI}(C^{k})=\emptyset, and s3k𝒞(Bk)s_{3}^{k}\in\mathcal{CI}(B^{k}).

Consider Case 2c, where 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C_{k})=\emptyset, 𝒞(Ak)\mathcal{CI}(A^{k})\neq\emptyset, and 𝒞(Ck)=\mathcal{CI}(C^{k})=\emptyset (see Figure 14). Observe that a vertex of 𝒞(Ak)\mathcal{CI}(A^{k}) may not lie within 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}), but rather lie on bdcc(l(zk,v)bd_{cc}(l^{\prime}(z_{k},v). The algorithm places two vertex guards, one at a vertex s1k𝒞(Ak)s_{1}^{k}\in\mathcal{CI}(A^{k}), and another one at a vertex s3k𝒞(Bk)s_{3}^{k}\in\mathcal{CI}(B^{k}) (in lines 33 and 21 respectively of Algorithm 1). Note that s1ks_{1}^{k} or s3ks_{3}^{k} may see some of the vertices of CkC^{k}, which may get marked as a consequence. However, as a worst case, we assume that none of the vertices of CkC^{k} are marked due to the placement of s1ks_{1}^{k} and s3ks_{3}^{k}. In such a scenario, a third vertex guard s2ks_{2}^{k} is chosen to guard a subset of CkC^{k}, since 𝒞(Ck)=\mathcal{CI}(C^{k})=\emptyset. In order to choose s2ks_{2}^{k}, 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}) is traversed counter-clockwise, starting from f(zk)f(z_{k}), till a vertex yy is encountered such that there exists a vertex xikCkx_{i}^{k}\in C^{k} which is visible from yy but not from any subsequent vertex of 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}). So, this vertex yy, which is effectively the vertex of 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}) immediately preceding t(xik)t^{\prime}(x_{i}^{k}), and hence denoted by prev(t(xik))prev(t^{\prime}(x_{i}^{k})), is chosen (in line 39 of Algorithm 1) as the vertex guard s2ks_{2}^{k}. It can be seen that once a guard is placed at s2ks_{2}^{k}, a subset of the vertices in CkC^{k} are visible from xikx_{i}^{k}, and hence marked. Let us denote the remaining vertices of CkC^{k} that are still unmarked as C1kC^{k}_{1}. The following lemma summarizes Case 2c.

Lemma 11.

If 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset, 𝒞(Ak)\mathcal{CI}(A^{k})\neq\emptyset, and 𝒞(Ck)=\mathcal{CI}(C^{k})=\emptyset, then all vertices belonging to 𝒪𝒱𝒱(zk)C1k\mathcal{OVV}^{-}(z_{k})\setminus C^{k}_{1} are visible from one of the vertex guards placed at s1ks_{1}^{k}, s2ks_{2}^{k}, and s3ks_{3}^{k}. Therefore, a vertex xik𝒪𝒱𝒱(zk)x_{i}^{k}\in\mathcal{OVV}^{-}(z_{k}) cannot be a primary vertex zjz_{j} for any j>kj>k unless xikC1kx_{i}^{k}\in C^{k}_{1}.

Refer to caption

Figure 15: Figure for Case 2d, where Ak={x1k,x3k}A^{k}=\{x_{1}^{k},x_{3}^{k}\}, Bk={x2k,x6k}B^{k}=\{x_{2}^{k},x_{6}^{k}\}, Ck={x4k,x5k}C^{k}=\{x_{4}^{k},x_{5}^{k}\}, 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset, 𝒞(Ak)=\mathcal{CI}(A^{k})=\emptyset and 𝒞(Ck)=\mathcal{CI}(C^{k})=\emptyset, and s3k𝒞(Bk)s_{3}^{k}\in\mathcal{CI}(B^{k}).

Consider Case 2d, where 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset, 𝒞(Ak)=\mathcal{CI}(A^{k})=\emptyset, and 𝒞(Ck)=\mathcal{CI}(C^{k})=\emptyset (see Figure 15). The algorithm first places a guard at a vertex s3k𝒞(Bk)s_{3}^{k}\in\mathcal{CI}(B^{k}). Note that s3ks_{3}^{k} may see some of the vertices of AkA^{k} and CkC^{k}, which may get marked as a consequence. However, assuming that none of the vertices of AkA^{k} or CkC^{k} are marked due to the placement of s3ks_{3}^{k}, another vertex guard s2ks_{2}^{k} is chosen from 𝒞(Ck)\mathcal{CI}(C^{k}), following a procedure similar to that in Case 2c. Similarly, another vertex guard s1ks_{1}^{k} is chosen from 𝒞(Ak)\mathcal{CI}(A^{k}) following a procedure similar to that in Case 2b. It can be seen that once guards are placed at s1ks_{1}^{k} and s2ks_{2}^{k}, some subsets of AkA^{k} and CkC^{k} are visible from them, and hence marked. So, let us denote the yet unmarked vertices of AkA^{k} and CkC^{k} as A1kA^{k}_{1} and C1kC^{k}_{1}, respectively.

Lemma 12.

If 𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset, 𝒞(Ak)=\mathcal{CI}(A^{k})=\emptyset, and 𝒞(Ck)=\mathcal{CI}(C^{k})=\emptyset, then all vertices belonging to 𝒪𝒱𝒱(zk)(A1kC1k\mathcal{OVV}^{-}(z_{k})\setminus(A^{k}_{1}\cup C^{k}_{1}) are visible from one of the three vertex guards placed at s1ks_{1}^{k}, s2ks_{2}^{k}, and s3ks_{3}^{k}. Therefore, no vertex xik𝒪𝒱𝒱(zk)x_{i}^{k}\in\mathcal{OVV}^{-}(z_{k}) can be a primary vertex zjz_{j} for any j>kj>k unless xik(A1kC1k)x_{i}^{k}\in(A^{k}_{1}\cup C^{k}_{1}).

Lemma 13.

Let zkz_{k} and zjz_{j} be any two primary vertices, where j>kj>k. If zj𝒪𝒱𝒱(zk)z_{j}\notin\mathcal{OVV}^{-}(z_{k}), then GoptG_{opt} (=GoptL=G^{L}_{opt}) must require two distinct vertex guards for guarding both zkz_{k} and zjz_{j}.

Proof.

For the sake of contradiction, assume there exists a single guard gGopt(=GoptL)g\in G_{opt}(=G^{L}_{opt}) that can see both zkz_{k} and zjz_{j}. This is only possible if g(𝒱𝒱𝒫(zk)𝒱𝒱𝒫(zj))g\in(\mathcal{VVP}^{-}(z_{k})\cap\mathcal{VVP}^{-}(z_{j})), which in turn means that (𝒱𝒱𝒫(zk)𝒱𝒱𝒫(zj))(\mathcal{VVP}^{-}(z_{k})\cap\mathcal{VVP}^{-}(z_{j}))\neq\emptyset. Therefore, zj𝒪𝒱𝒱(zk)z_{j}\in\mathcal{OVV}^{-}(z_{k}) by the definition of 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}), a contradiction. ∎

Lemma 14.

Let zkz_{k} and zjz_{j} be any two primary vertices, where j>kj>k. Assume that A1kA^{k}_{1}\neq\emptyset and C1kC^{k}_{1}\neq\emptyset. If zj(A1kC1k)z_{j}\notin(A^{k}_{1}\cup C^{k}_{1}), then GoptG_{opt} (=GoptLG^{L}_{opt}) must require two distinct vertex guards for guarding both zkz_{k} and zjz_{j}.

Proof.

After the placement of guards for zkz_{k}, the only vertices of 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) that are still unmarked belong to A1kA^{k}_{1} or C1kC^{k}_{1}. Since zjz_{j} is unmarked when it is chosen as a primary vertex, zj(A1kC1k)z_{j}\notin(A^{k}_{1}\cup C^{k}_{1}) implies that zj𝒪𝒱𝒱(zk)z_{j}\notin\mathcal{OVV}^{-}(z_{k}). So, it follows directly from Lemma 13 that GoptG_{opt} (=GoptLG^{L}_{opt}) must require two distinct vertex guards for guarding both zkz_{k} and zjz_{j}. ∎

Lemma 15.

For every k{1,2,,|Z|1}k\in\{1,2,\dots,|Z|-1\}, assume that zj(A1kC1k)z_{j}\notin(A^{k}_{1}\cup C^{k}_{1}) for any jj, k<j|Z|k<j\leq|Z|. Then, |S|3|GoptL|=3|Gopt||S|\leq 3\cdot|G^{L}_{opt}|=3\cdot|G_{opt}|.

Proof.

We know from Lemma 14, that for any arbitrary pair zkz_{k} and zjz_{j}, where k,j{1,2,,|Z|}k,j\in\{1,2,\dots,|Z|\} and j>kj>k, GoptG_{opt} (=GoptLG^{L}_{opt}) requires two distinct vertex guards for guarding both zkz_{k} and zjz_{j}. Thus, applying Lemma 14 repeatedly over all such possible pairs shows that GoptG_{opt} requires as many guards as the number of primary vertices, i.e. |Z||Gopt||Z|\leq|G_{opt}|. Since at most three vertex guards s1ks_{1}^{k}, s2ks_{2}^{k}, and s3ks_{3}^{k} are placed corresponding to each primary vertex zkZz_{k}\in Z, |S|3|Z||S|\leq 3\cdot|Z|. So, combining the above two inequalities, we obtain |S|3|Z|3|Gopt||S|\leq 3\cdot|Z|\leq 3\cdot|G_{opt}|. ∎

So far we have assumed the special case where, for every kk, there is no j>kj>k such that a primary vertex zjz_{j} belongs to A1kC1kA^{k}_{1}\cup C^{k}_{1}. Therefore, we now focus on the general case where, for some j>kj>k, we have the primary vertex zjA1kC1kz_{j}\in A^{k}_{1}\cup C^{k}_{1}. Let Ak={a1,a2,a3,,am}A^{k}=\{a_{1},a_{2},a_{3},\dots,a_{m}\} where t(a1)t(a2)t(a3)t(am)t(a_{1})\prec t(a_{2})\prec t(a_{3})\prec\dots\prec t(a_{m}). Observe that, if we consider any two arbitrary vertices ai,ajAka_{i},a_{j}\in A^{k}, then these vertices may be overlapping, i.e. 𝒱𝒱𝒫(ai)𝒱𝒱𝒫(aj)\mathcal{VVP}^{-}(a_{i})\cap\mathcal{VVP}^{-}(a_{j})\neq\emptyset, or disjoint, i.e. 𝒱𝒱𝒫(ai)𝒱𝒱𝒫(aj)=\mathcal{VVP}^{-}(a_{i})\cap\mathcal{VVP}^{-}(a_{j})=\emptyset. So, it is possible to create a partition of AkA^{k}, such that each set in the partition consists of a particular vertex aia_{i}, called the leading vertex, and all the other vertices of AkA^{k} that are overlapping with aia_{i}. Obviously, two leading vertices belonging to different sets of such a partition are always disjoint. Therefore, if a subset of AkA^{k} is formed by choosing the leading vertex from each set of the partition, then we obtain a maximal disjoint subset of AkA^{k}, i.e. a maximal subset of AkA^{k} whose elements are all pairwise disjoint.

In the following, we first formally define maximum disjoint subsets of AkA^{k} and CkC^{k}, and establish various properties of these subsets in Lemmas 16 to 28, Using these properties, we establish a lower bound on |Gopt||G_{opt}|, which finally leads towards obtaining a constant approximation ratio.

Lemma 16.

Consider any two arbitrary vertices ai,ajAka_{i},a_{j}\in A^{k}, where t(ai)t(aj)t(a_{i})\prec t(a_{j}). If aia_{i} and aja_{j} are disjoint, i.e. if 𝒱𝒱𝒫(ai)𝒱𝒱𝒫(aj)=\mathcal{VVP}^{-}(a_{i})\cap\mathcal{VVP}^{-}(a_{j})=\emptyset, then 𝒱𝒱𝒫(aj)\mathcal{VVP}^{-}(a_{j}) is geometrically nested inside 𝒱𝒱𝒫(ai)\mathcal{VVP}^{-}(a_{i}), i.e. t(ai)f(aj)l(aj)t(ai)t(a_{i})\prec f(a_{j})\prec l(a_{j})\prec t^{\prime}(a_{i}).

Proof.

Since ai,ajAka_{i},a_{j}\in A^{k}, we must have t(ai)l(zk)t(ai)t(a_{i})\prec l(z_{k})\prec t^{\prime}(a_{i}) and also t(aj)l(zk)t(aj)t(a_{j})\prec l(z_{k})\prec t^{\prime}(a_{j}). Therefore, the only possibility is to have t(ai)t(aj)l(zk)t(aj)t(ai)t(a_{i})\prec t(a_{j})\prec l(z_{k})\prec t^{\prime}(a_{j})\prec t^{\prime}(a_{i}). Moreover, if f(aj)t(ai)f(a_{j})\prec t(a_{i}) or t(ai)l(aj)t^{\prime}(a_{i})\prec l(a_{j}), then 𝒱𝒱𝒫(ai)𝒱𝒱𝒫(aj)\mathcal{VVP}^{-}(a_{i})\cap\mathcal{VVP}^{-}(a_{j})\neq\emptyset, which contradicts that aia_{i} and aja_{j} are disjoint. Hence, we must have t(ai)f(aj)t(aj)l(zk)t(aj)l(aj)t(ai)t(a_{i})\prec f(a_{j})\prec t(a_{j})\prec l(z_{k})\prec t^{\prime}(a_{j})\prec l(a_{j})\prec t^{\prime}(a_{i}). So, 𝒱𝒱𝒫(aj)\mathcal{VVP}^{-}(a_{j}) is geometrically nested inside 𝒱𝒱𝒫(ai)\mathcal{VVP}^{-}(a_{i}). ∎

Lemma 17.

Consider any two arbitrary vertices ci,cjCkc_{i},c_{j}\in C^{k}, where t(ci)t(cj)t^{\prime}(c_{i})\prec t^{\prime}(c_{j}). If cic_{i} and cjc_{j} are disjoint, i.e. if 𝒱𝒱𝒫(ci)𝒱𝒱𝒫(cj)=\mathcal{VVP}^{-}(c_{i})\cap\mathcal{VVP}^{-}(c_{j})=\emptyset, then 𝒱𝒱𝒫(cj)\mathcal{VVP}^{-}(c_{j}) is geometrically nested inside 𝒱𝒱𝒫(ci)\mathcal{VVP}^{-}(c_{i}), i.e. t(ci)f(cj)l(cj)t(ci)t^{\prime}(c_{i})\prec f(c_{j})\prec l(c_{j})\prec t^{\prime}(c_{i}).

Proof.

Since ci,cjCkc_{i},c_{j}\in C^{k}, we must have t(ci)l(zk)t(ci)t^{\prime}(c_{i})\prec l(z_{k})\prec t(c_{i}) and also t(cj)l(zk)t(cj)t^{\prime}(c_{j})\prec l(z_{k})\prec t(c_{j}). Therefore, the only possibility is to have t(ci)t(cj)l(zk)t(cj)t(ci)t^{\prime}(c_{i})\prec t^{\prime}(c_{j})\prec l(z_{k})\prec t(c_{j})\prec t(c_{i}). Moreover, if f(cj)t(ci)f(c_{j})\prec t^{\prime}(c_{i}) or t(ci)l(cj)t(c_{i})\prec l(c_{j}), then 𝒱𝒱𝒫(ci)𝒱𝒱𝒫(cj)\mathcal{VVP}^{-}(c_{i})\cap\mathcal{VVP}^{-}(c_{j})\neq\emptyset, which contradicts that cic_{i} and cjc_{j} are disjoint. Hence, we must have t(ci)f(cj)t(cj)l(zk)t(cj)l(cj)t(ci)t^{\prime}(c_{i})\prec f(c_{j})\prec t^{\prime}(c_{j})\prec l(z_{k})\prec t(c_{j})\prec l(c_{j})\prec t(c_{i}). So, 𝒱𝒱𝒫(cj)\mathcal{VVP}^{-}(c_{j}) is geometrically nested inside 𝒱𝒱𝒫(ci)\mathcal{VVP}^{-}(c_{i}). ∎

Observe that the size of any maximal disjoint subset of AkA^{k} depends on the choice of the leading element for each set of the partition. We are interested in choosing the leading elements in such a way so as to construct a canonical partitioning of AkA^{k} corresponding to a particular maximum disjoint subset LkAkL^{k}\subseteq A^{k}, defined as follows. First include a1a_{1} in LkL^{k} and construct the set P1(Lk)P_{1}(L^{k}) consisting of all other vertices ajAka_{j}\in A^{k} such that 𝒱𝒱𝒫(a1)𝒱𝒱𝒫(aj)\mathcal{VVP}^{-}(a_{1})\cap\mathcal{VVP}^{-}(a_{j})\neq\emptyset. Note that a1P1(Lk)a_{1}\in P_{1}(L^{k}). Also note that, if AkP1(Lk)=A^{k}\setminus P_{1}(L^{k})=\emptyset, then P(Lk)={Ak}P(L^{k})=\{A^{k}\} (i.e. CI(Ak)CI(A^{k})\neq\emptyset, so this corresponds to cases 2a and 2c in Algorithm 1). Otherwise, for each i{2,3,}i\in\{2,3,\dots\}, pick the vertex aσ(i)Aka_{\sigma(i)}\in A^{k} where σ(i)\sigma(i) is the least index such that aσ(i)1j<iPj(Lk)a_{\sigma(i)}\notin\bigcup_{1\leq j<i}P_{j}(L^{k}), and include aσ(i)a_{\sigma(i)} in LkL^{k}. Construct the set Pi(Lk)={ajAk:𝒱𝒱𝒫(aσ(i))𝒱𝒱𝒫(aj)}P_{i}(L^{k})=\{a_{j}\in A^{k}:\mathcal{VVP}^{-}(a_{\sigma(i)})\cap\mathcal{VVP}^{-}(a_{j})\neq\emptyset\}. The process is repeated till j:ajLkPj(Lk)=Ak\bigcup_{j:a_{j}\in L^{k}}P_{j}(L^{k})=A^{k}. Thus, a canonical partition P(Lk)={Pi(Lk)Ak:1i|P(Lk)|m}P(L^{k})=\{P_{i}(L^{k})\subseteq A_{k}:1\leq i\leq|P(L^{k})|\leq m\} is constructed.

Analogously, a similar canonical partitioning of CkC^{k} corresponding to a maximum disjoint subset RkCkR^{k}\subseteq C^{k} is defined as follows. Let Ck={c1,c2,c3,,cm}C^{k}=\{c_{1},c_{2},c_{3},\dots,c_{m}\} where prev(t(c1))prev(t(a2))prev(t(a3))prev(t(am))prev(t^{\prime}(c_{1}))\prec prev(t^{\prime}(a_{2}))\prec prev(t^{\prime}(a_{3}))\prec\dots\prec prev(t^{\prime}(a_{m})). First include c1c_{1} in RkR^{k} and construct the set P1(Rk)P_{1}(R^{k}) consisting of all other vertices cjCkc_{j}\in C^{k} such that 𝒱𝒱𝒫(c1)𝒱𝒱𝒫(cj)\mathcal{VVP}^{-}(c_{1})\cap\mathcal{VVP}^{-}(c_{j})\neq\emptyset. Note that c1P1(Rk)c_{1}\in P_{1}(R^{k}). Also note that, if CkP1(Rk)=C^{k}\setminus P_{1}(R^{k})=\emptyset, then PRk={Ck}PR^{k}=\{C^{k}\} (i.e. CI(Ck)CI(C^{k})\neq\emptyset, so this corresponds to cases 2a and 2b in Algorithm 1). Otherwise, for each i{2,3,}i\in\{2,3,\dots\}, pick the vertex cσ(i)Ckc_{\sigma(i)}\in C^{k} where σ(i)\sigma(i) is the least index such that cσ(i)1j<iPj(Rk)c_{\sigma(i)}\notin\bigcup_{1\leq j<i}P_{j}(R^{k}), and include cσ(i)c_{\sigma(i)} in RkR^{k}. Construct the set Pi(Rk)={cjCk:𝒱𝒱𝒫(cσ(i))𝒱𝒱𝒫(cj)}P_{i}(R^{k})=\{c_{j}\in C^{k}:\mathcal{VVP}^{-}(c_{\sigma(i)})\cap\mathcal{VVP}^{-}(c_{j})\neq\emptyset\}. The process is repeated till j:cjRkPj(Rk)=Ck\bigcup_{j:c_{j}\in R^{k}}P_{j}(R^{k})=C^{k}. Thus, a canonical partition P(Rk)={Pi(Rk)Ck:1i|P(Rk)|m}P(R^{k})=\{P_{i}(R^{k})\subseteq C_{k}:1\leq i\leq|P(R^{k})|\leq m\} is constructed.

We now study the properties of LkL^{k} and RkR^{k} as constructed above. Firstly, it is easy to see that, by their very construction, LkL^{k} is a maximal disjoint subset of AkA^{k}, and RkR^{k} is a maximal disjoint subset of CkC^{k}. We show that LkL^{k} is also a maximum disjoint subset of AkA^{k}, using an interesting pairwise intersection property established in the following lemma.

Lemma 18.

For every Pi(Lk)P(Lk)P_{i}(L^{k})\in P(L^{k}) and for any two vertices a,aPi(Lk)a,a^{\prime}\in P_{i}(L^{k}), we have 𝒱𝒱𝒫(a)𝒱𝒱𝒫(a)\mathcal{VVP}^{-}(a)\cap\mathcal{VVP}^{-}(a^{\prime})\neq\emptyset.

Proof.

Without loss of generality let us assume that t(a)t(a)t(a)\prec t(a^{\prime}). For the sake of contradiction, suppose 𝒱𝒱𝒫(a)𝒱𝒱𝒫(a)=\mathcal{VVP}^{-}(a)\cap\mathcal{VVP}^{-}(a^{\prime})=\emptyset. This means t(a)f(a)t(a)\prec f(a^{\prime}) and l(a)t(a)l(a^{\prime})\prec t^{\prime}(a), i.e. 𝒱𝒱𝒫(a)\mathcal{VVP}^{-}(a^{\prime}) is geometrically nested within 𝒱𝒱𝒫(a)\mathcal{VVP}^{-}(a). On the other hand, we know that both aa and aa^{\prime} are overlapping with the leading vertex aσ(i)a_{\sigma(i)} of Pi(Lk)P_{i}(L^{k}). By the construction of Pi(Lk)P_{i}(L^{k}), we have t(aσ(i))t(a)t(a)t(aσ(i))t(a_{\sigma(i)})\prec t(a)\prec t^{\prime}(a)\prec t^{\prime}(a_{\sigma(i)}). Therefore, t(a)f(a)t(a)\prec f(a^{\prime}) implies t(aσ(i))f(a)t(a_{\sigma(i)})\prec f(a^{\prime}), and l(a)t(a)l(a^{\prime})\prec t^{\prime}(a) implies l(a)t(aσ(i))l(a^{\prime})\prec t^{\prime}(a_{\sigma(i)}). However, if both t(aσ(i))f(a)t(a_{\sigma(i)})\prec f(a^{\prime}) and l(a)t(aσ(i))l(a^{\prime})\prec t^{\prime}(a_{\sigma(i)}) are true, then 𝒱𝒱𝒫(aσ(i))𝒱𝒱𝒫(a)=\mathcal{VVP}^{-}(a_{\sigma(i)})\cap\mathcal{VVP}^{-}(a^{\prime})=\emptyset, contradicting the initial assumption that aPi(Lk)a^{\prime}\in P_{i}(L^{k}). ∎

Lemma 19.

LkL^{k} is a maximum disjoint subset of AkA^{k}.

Proof.

On the contrary, assume that there exists a larger maximal disjoint subset of AkA^{k}, say LkL^{\prime k}. Then, by the pigeonhole principle there exists at least two vertices a,aLka,a^{\prime}\in L^{\prime k} such that both belong to the same set Pi(Lk)P(Lk)P_{i}(L^{k})\in P(L^{k}). Thus, by Lemma 18, we have 𝒱𝒱𝒫(a)𝒱𝒱𝒫(a)\mathcal{VVP}^{-}(a)\cap\mathcal{VVP}^{-}(a^{\prime})\neq\emptyset, which contradicts the fact that LkL^{\prime k} is a disjoint subset of AkA^{k}. Hence, LkL^{k} is a maximum disjoint subset of AkA^{k}. ∎

In the following lemmas, we show in an analogous manner that RkR^{k} is also a maximum disjoint subset of CkC^{k}.

Lemma 20.

For every Pi(Rk)P(Rk)P_{i}(R^{k})\in P(R^{k}) and for any two vertices c,cPi(Rk)c,c^{\prime}\in P_{i}(R^{k}), we have 𝒱𝒱𝒫(c)𝒱𝒱𝒫(c)\mathcal{VVP}^{-}(c)\cap\mathcal{VVP}^{-}(c^{\prime})\neq\emptyset.

Proof.

Without loss of generality let us assume that prev(t(c))prev(t(c))prev(t^{\prime}(c))\prec prev(t^{\prime}(c^{\prime})). For the sake of contradiction, suppose 𝒱𝒱𝒫(c)𝒱𝒱𝒫(c)=\mathcal{VVP}^{-}(c)\cap\mathcal{VVP}^{-}(c^{\prime})=\emptyset. This means t(c)f(c)t^{\prime}(c)\prec f(c^{\prime}) and l(c)t(c)l(c^{\prime})\prec t(c), i.e. 𝒱𝒱𝒫(c)\mathcal{VVP}^{-}(c^{\prime}) is geometrically nested within 𝒱𝒱𝒫(c)\mathcal{VVP}^{-}(c). On the other hand, we know that both cc and cc^{\prime} are overlapping with the leading vertex cσ(i)c_{\sigma(i)} of Pi(Rk)P_{i}(R^{k}). By the construction of Pi(Rk)P_{i}(R^{k}), we have prev(t(cσ(i)))prev(t(c))t(c)t(cσ(i))prev(t^{\prime}(c_{\sigma(i)}))\prec prev(t^{\prime}(c))\prec t(c)\prec t(c_{\sigma(i)}). Therefore, t(c)f(c)t^{\prime}(c)\prec f(c^{\prime}) implies t(cσ(i))f(c)t^{\prime}(c_{\sigma(i)})\prec f(c^{\prime}), and l(c)t(c)l(c^{\prime})\prec t(c) implies l(c)t(cσ(i))l(c^{\prime})\prec t(c_{\sigma(i)}). However, if both t(cσ(i))f(c)t^{\prime}(c_{\sigma(i)})\prec f(c^{\prime}) and l(c)t(cσ(i))l(c^{\prime})\prec t(c_{\sigma(i)}) are true, then 𝒱𝒱𝒫(cσ(i))𝒱𝒱𝒫(c)=\mathcal{VVP}^{-}(c_{\sigma(i)})\cap\mathcal{VVP}^{-}(c^{\prime})=\emptyset, contradicting the initial assumption that cPi(Rk)c^{\prime}\in P_{i}(R^{k}). ∎

Lemma 21.

RkR^{k} is a maximum disjoint subset of CkC^{k}.

Proof.

On the contrary, assume that there exists a larger maximal disjoint subset of CkC^{k}, say RkR^{\prime k}. Then, by the pigeonhole principle there exists at least two vertices c,cRkc,c^{\prime}\in R^{\prime k} such that both belong to the same set Pi(Rk)P(Rk)P_{i}(R^{k})\in P(R^{k}). Thus, by Lemma 20, we have 𝒱𝒱𝒫(c)𝒱𝒱𝒫(c)\mathcal{VVP}^{-}(c)\cap\mathcal{VVP}^{-}(c^{\prime})\neq\emptyset, which contradicts the fact that RkR^{\prime k} is a disjoint subset of CkC^{k}. Hence, RkR^{k} is a maximum disjoint subset of CkC^{k}. ∎

Refer to caption

Figure 16: Figure showing a maximum disjoint subset {a1,a2,a3}=LkAk\{a_{1},a_{2},a_{3}\}=L^{k}\subseteq A^{k} such that f(a1)t(a1)f(a2)t(a2)f(a3)t(a3)t(a3)l(a3)t(a2)l(a2)t(a1)l(a1)f(a_{1})\prec t(a_{1})\prec f(a_{2})\prec t(a_{2})\prec f(a_{3})\prec t(a_{3})\prec t^{\prime}(a_{3})\prec l(a_{3})\prec t^{\prime}(a_{2})\prec l(a_{2})\prec t^{\prime}(a_{1})\prec l(a_{1}).

Refer to caption

Figure 17: Figure showing a maximum disjoint subset {c1,c2,c3}=RkCk\{c_{1},c_{2},c_{3}\}=R^{k}\subseteq C^{k} such that f(c1)t(c1)f(c2)t(c2)f(c3)t(c3)t(c3)l(c3)t(c2)l(c2)t(c1)l(c1)f(c_{1})\prec t^{\prime}(c_{1})\prec f(c_{2})\prec t^{\prime}(c_{2})\prec f(c_{3})\prec t^{\prime}(c_{3})\prec t(c_{3})\prec l(c_{3})\prec t(c_{2})\prec l(c_{2})\prec t(c_{1})\prec l(c_{1}).

The following lemmas are consequences of Lemmas 16 and 17.

Lemma 22.

For any k{1,2,,|Z|}k\in\{1,2,\dots,|Z|\}, any outward vertex guard placed on bdcc(u,v)bd_{cc}(u,v) can see at most one vertex of LkL^{k}.

Lemma 23.

For any k{1,2,,|Z|}k\in\{1,2,\dots,|Z|\}, any outward guard set requires at least |Lk||L^{k}| distinct vertex guards to guard all vertices of LkL^{k}.

Lemma 24.

For any k{1,2,,|Z|}k\in\{1,2,\dots,|Z|\}, any outward vertex guard placed on bdcc(u,v)bd_{cc}(u,v) can see at most one vertex of RkR^{k}.

Lemma 25.

For any k{1,2,,|Z|}k\in\{1,2,\dots,|Z|\}, any outward guard set requires at least |Rk||R^{k}| distinct vertex guards to guard all vertices of RkR^{k}.

Lemma 26.

For any k{1,2,,|Z|}k\in\{1,2,\dots,|Z|\}, any outward optimal guards gGoptLg\in G_{opt}^{L} placed on bdcc(u,v)bd_{cc}(u,v) can see at most one vertex of LkL^{k} and at most one vertex of RkR^{k}.

Proof.

Follows directly from Lemmas 22 and 24. ∎

For every set Pi(Lk)P_{i}(L^{k}) belonging to the partition P(Lk)P(L^{k}) of LkL^{k}, let us define the corresponding two sets Gi(Lk)G_{i}(L^{k}) and Zi(Lk)Z_{i}(L^{k}) as follows. We define Gi(Lk)GoptL(=Gopt)G_{i}(L^{k})\subseteq G^{L}_{opt}(=G_{opt}) to be a minimal subset of the optimal set GoptG_{opt} of guards required to guard all the vertices belonging to Pi(Lk)P_{i}(L^{k}). Similarly, we define Zi(Lk)ZL(=Z)Z_{i}(L^{k})\subseteq Z^{L}(=Z) to be the subset of primary vertices chosen by our algorithm from amongst the vertices of Pi(Lk)P_{i}(L^{k}). Now we are in a position to show that the cardinality of Gi(Lk)G_{i}(L^{k}) is lower bounded by |Zi(Lk)||Z_{i}(L^{k})|, which never exceeds two.

Lemma 27.

For every set Pi(Lk)P_{i}(L^{k}) belonging to the partition P(Lk)P(L^{k}) of AkA^{k}, |Zi(Lk)|=|Gi(Lk)|=1|Z_{i}(L^{k})|=|G_{i}(L^{k})|=1 or |Zi(Lk)|=2|Gi(Lk)||Z_{i}(L^{k})|=2\leq|G_{i}(L^{k})|, i.e. |Zi(Lk)|2|Z_{i}(L^{k})|\leq 2.

Proof.

First, let us consider the case where |Gi(Lk)|=1|G_{i}(L^{k})|=1. This implies that at least one of the conditions below holds: (i) f(a)t(aσ(i))f(a)\prec t(a_{\sigma(i)}) for every aPi(Lk)a\in P_{i}(L^{k}), or (ii) t(aσ(i))l(a)t^{\prime}(a_{\sigma(i)})\prec l(a) for every aPi(Lk)a\in P_{i}(L^{k}). Observe that, for any vertex aPi(Lk)a^{\prime}\in P_{i}(L^{k}), if aa^{\prime} is chosen by our algorithm as a later primary vertex zjz_{j}, where j>kj>k, then we have s1j=t(aσ(i))s^{j}_{1}=t(a_{\sigma(i)}) and s3j=l(a)s^{j}_{3}=l(a^{\prime}). If condition (i) is true, then the vertex guard s1j=t(aσ(i))s^{j}_{1}=t(a_{\sigma(i)}) sees all vertices belonging to Pi(Lk)P_{i}(L^{k}). If condition (ii) is true, then the vertex guard s3j=l(a)s^{j}_{3}=l(a^{\prime}) sees all vertices belonging to Pi(Lk)P_{i}(L^{k}). Thus, in either case, no further primary vertices will be chosen by our algorithm from Pi(Lk)P_{i}(L^{k}). So, when |Gi(Lk)|=1|G_{i}(L^{k})|=1, we also have |Zi(Lk)|=1|Z_{i}(L^{k})|=1.

Let us now consider the other case where |Gi(Lk)|>1|G_{i}(L^{k})|>1. It is possible that all the vertices belonging to Pi(Lk)P_{i}(L^{k}) are marked by vertex guards corresponding to primary vertices chosen from ZPi(Lk)Z\setminus P_{i}(L^{k}), in which case we have |Zi(Lk)|=0|Z_{i}(L^{k})|=0. Otherwise, let aPi(Lk)a^{\prime}\in P_{i}(L^{k}) be the first primary vertex zj=az_{j}=a^{\prime} chosen from Pi(Lk)P_{i}(L^{k}) (see Figure 18). Then, as before, we have s1j=t(aσ(i))s^{j}_{1}=t(a_{\sigma(i)}) and s3j=l(a)s^{j}_{3}=l(a^{\prime}). Observe that, for any vertex aPi(Lk)a\in P_{i}(L^{k}), if f(a)t(aσ(i))f(a)\prec t(a_{\sigma(i)}), then the vertex guard s1j=t(aσ(i))s^{j}_{1}=t(a_{\sigma(i)}) sees aa, and if t(a)l(a)t^{\prime}(a)\prec l(a^{\prime}), then the vertex guard s3j=l(a)s^{j}_{3}=l(a^{\prime}) sees aa. Therefore, if any vertex aPi(Lk)a\in P_{i}(L^{k}) is left unmarked even after the placement of vertex guards corresponding to zj=az_{j}=a^{\prime}, then t(aσ(i))f(a)t(a_{\sigma(i)})\prec f(a). Since aPi(Lk)a\in P_{i}(L^{k}), by the definition of Pi(Lk)P_{i}(L^{k}) we have 𝒱𝒱𝒫(aσ(i))𝒱𝒱𝒫(a)\mathcal{VVP}^{-}(a_{\sigma(i)})\cap\mathcal{VVP}^{-}(a)\neq\emptyset. So, the condition t(aσ(i))f(a)t(a_{\sigma(i)})\prec f(a) would force the condition t(aσ(i))l(a)t^{\prime}(a_{\sigma(i)})\prec l(a) for any vertex aPi(Lk)a\in P_{i}(L^{k}) that is left unmarked even after the placement of vertex guards corresponding to zj=az_{j}=a^{\prime}. Now, if zj=a′′z_{j^{\prime}}=a^{\prime\prime} be another primary vertex chosen from among the yet unmarked vertices of Pi(Lk)P_{i}(L^{k}), then t(a)t(aσ(i))l(a′′)l(a)t^{\prime}(a)\prec t^{\prime}(a_{\sigma(i)})\prec l(a^{\prime\prime})\prec l(a) for any other unmarked vertex aPi(Lk)a\in P_{i}(L^{k}), and hence s3j=l(a′′)s^{j^{\prime}}_{3}=l(a^{\prime\prime}) sees all the remaining unmarked vertices of Pi(Lk)P_{i}(L^{k}). So, when |Gi(Lk)|>1|G_{i}(L^{k})|>1, we have |Zi(Lk)|2|Z_{i}(L^{k})|\leq 2. Therefore, in general, we have |Zi(Lk)||Gi(Lk)||Z_{i}(L^{k})|\leq|G_{i}(L^{k})| and |Zi(Lk)|2|Z_{i}(L^{k})|\leq 2. ∎

Analogously, for every set Pi(Rk)P_{i}(R^{k}) belonging to the partition P(Rk)P(R^{k}) of RkR^{k}, let us define the corresponding two sets Gi(Rk)G_{i}(R^{k}) and Zi(Rk)Z_{i}(R^{k}) as follows. We define Gi(Rk)GoptL(=Gopt)G_{i}(R^{k})\subseteq G^{L}_{opt}(=G_{opt}) to be a minimal subset of the optimal set GoptG_{opt} of guards required to guard all the vertices belonging to Pi(Rk)P_{i}(R^{k}). Similarly, we define Zi(Rk)ZL(=Z)Z_{i}(R^{k})\subseteq Z^{L}(=Z) to be the subset of primary vertices chosen by our algorithm from amongst the vertices of Pi(Rk)P_{i}(R^{k}). Now we are in a position to show that the cardinality of Gi(Rk)G_{i}(R^{k}) is lower bounded by |Zi(Rk)||Z_{i}(R^{k})|, which never exceeds two.

Lemma 28.

For every set Pi(Rk)P_{i}(R^{k}) belonging to the partition P(Rk)P(R^{k}) of CkC^{k}, we have |Zi(Rk)|=|Gi(Rk)|=1|Z_{i}(R^{k})|=|G_{i}(R^{k})|=1 or |Zi(Rk)|=2|Gi(Rk)||Z_{i}(R^{k})|=2\leq|G_{i}(R^{k})|, i.e. |Zi(Rk)|2|Z_{i}(R^{k})|\leq 2.

Proof.

First, let us consider the case where |Gi(Rk)|=1|G_{i}(R^{k})|=1. This implies that at least one of the conditions below holds: (i) f(c)t(cσ(i))f(c)\prec t^{\prime}(c_{\sigma(i)}) for every cPi(Rk)c\in P_{i}(R^{k}), or (ii) t(cσ(i))l(c)t(c_{\sigma(i)})\prec l(c) for every cPi(Rk)c\in P_{i}(R^{k}). Observe that, for any vertex cPi(Rk)c^{\prime}\in P_{i}(R^{k}), if cc^{\prime} is chosen by our algorithm as a later primary vertex zjz_{j}, where j>kj>k, then we have s2j=prev(t(cσ(i)))s^{j}_{2}=prev(t^{\prime}(c_{\sigma(i)})) and s3j=l(c)s^{j}_{3}=l(c^{\prime}). If condition (i) is true, then the vertex guard s2j=prev(t(cσ(i)))s^{j}_{2}=prev(t^{\prime}(c_{\sigma(i)})) sees all vertices belonging to Pi(Rk)P_{i}(R^{k}). If condition (ii) is true, then the vertex guard s3j=l(c)s^{j}_{3}=l(c^{\prime}) sees all vertices belonging to Pi(Rk)P_{i}(R^{k}). Thus, in either case, no further primary vertices will be chosen by our algorithm from Pi(Rk)P_{i}(R^{k}). So, when |Gi(Rk)|=1|G_{i}(R^{k})|=1, we also have |Z(Rk)|=1|Z_{(}R^{k})|=1.

Let us now consider the other case where |Gi(Rk)|>1|G_{i}(R^{k})|>1. It is possible that all the vertices belonging to Pi(Rk)P_{i}(R^{k}) are marked by vertex guards corresponding to primary vertices chosen from ZPi(Rk)Z\setminus P_{i}(R^{k}), in which case we have |Z(Rk)|=0|Z_{(}R^{k})|=0. Otherwise, let cPi(Rk)c^{\prime}\in P_{i}(R^{k}) be the first primary vertex zj=cz_{j}=c^{\prime} chosen from Pi(Rk)P_{i}(R^{k}). Then, as before, we have s2j=prev(t(cσ(i)))s^{j}_{2}=prev(t^{\prime}(c_{\sigma(i)})) and s3j=l(c)s^{j}_{3}=l(c^{\prime}). Observe that, for any vertex cPi(Rk)c\in P_{i}(R^{k}), if f(c)prev(t(cσ(i)))f(c)\prec prev(t^{\prime}(c_{\sigma(i)})), then the vertex guard s2j=prev(t(cσ(i)))s^{j}_{2}=prev(t^{\prime}(c_{\sigma(i)})) sees cc, and if t(c)l(c)t(c)\prec l(c^{\prime}), then the vertex guard s3j=l(c)s^{j}_{3}=l(c^{\prime}) sees cc. Therefore, if any vertex cPi(Rk)c\in P_{i}(R^{k}) is left unmarked even after the placement of vertex guards corresponding to zj=cz_{j}=c^{\prime}, then t(cσ(i))f(c)t^{\prime}(c_{\sigma(i)})\prec f(c). Since cPi(Rk)c\in P_{i}(R^{k}), by the definition of Pi(Rk)P_{i}(R^{k}) we have 𝒱𝒱𝒫(cσ(i))𝒱𝒱𝒫(c)\mathcal{VVP}^{-}(c_{\sigma(i)})\cap\mathcal{VVP}^{-}(c)\neq\emptyset. So, the condition t(cσ(i))f(c)t^{\prime}(c_{\sigma(i)})\prec f(c) would force the condition t(cσ(i))l(c)t(c_{\sigma(i)})\prec l(c) for any vertex cPi(Rk)c\in P_{i}(R^{k}) that is left unmarked even after the placement of vertex guards corresponding to zj=cz_{j}=c^{\prime}. Now, if zj=c′′z_{j^{\prime}}=c^{\prime\prime} be another primary vertex chosen from among the yet unmarked vertices of Pi(Rk)P_{i}(R^{k}), then t(c)t(cσ(i))l(c′′)l(c)t(c)\prec t(c_{\sigma(i)})\prec l(c^{\prime\prime})\prec l(c) for any other unmarked vertex cPi(Rk)c\in P_{i}(R^{k}), and hence s3j=l(c′′)s^{j^{\prime}}_{3}=l(c^{\prime\prime}) sees all the remaining unmarked vertices of Pi(Rk)P_{i}(R^{k}). So, when |Gi(Rk)|>1|G_{i}(R^{k})|>1, we have |Z(Rk)|2|Z(R^{k})|\leq 2. Therefore, in general, we have |Zi(Rk)||Gi(Rk)||Z_{i}(R^{k})|\leq|G_{i}(R^{k})| and |Zi(Rk)|2|Z_{i}(R^{k})|\leq 2. ∎

Two special subsets of vertices of QUQ_{U} are constructed, where each subset consists of primary vertices having certain properties as well as some special vertices belonging to A=k{1,2,,|Z|}AkA=\bigcup_{k\in\{1,2,\dots,|Z|\}}A^{k} and C=k{1,2,,|Z|}CkC=\bigcup_{k\in\{1,2,\dots,|Z|\}}C^{k}. Then, lower bounds are established on the number of optimal guards required to guard just the vertices belonging to these subsets (see Lemmas 32 and 33), which ultimately leads us to a lower bound on |GoptL||G_{opt}^{L}|, which is equal to |Gopt||G_{opt}| in the current scenario.

Let ZAZ_{A} denote the subset of primary vertices such that AkA^{k} is non-empty for each zkZAz_{k}\in Z_{A}. Also, let ZAprevZ_{A}^{prev} denote the subset of primary vertices where each zkZAprevz_{k}\in Z_{A}^{prev} belongs to AjA^{j} for some previously chosen primary vertex zjZAz_{j}\in Z_{A}, where j<kj<k. In other words, we have ZA={zkZ:Ak}Z_{A}=\{z_{k}\in Z:A^{k}\neq\emptyset\}, and ZAprev={zkZ:zjZA such that j<k and zkAj}Z_{A}^{prev}=\{z_{k}\in Z:\exists z_{j}\in Z_{A}\mbox{ such that }j<k\mbox{ and }z_{k}\in A^{j}\}. Finally, for every zkZAz_{k}\in Z_{A}, if the corresponding guard s1ks^{k}_{1} is placed at t(a)t(a), then aAka\in A^{k} is denoted by t1(k)t1(k) and included in the set YAY_{A}, i.e YA=zkZA{t1(k)=aAk:(aAk)t(a)t(a)}Y_{A}=\bigcup_{z_{k}\in Z_{A}}\{t1(k)=a\in A^{k}:(\forall a^{\prime}\in A^{k})\hskip 2.84526ptt(a)\prec t(a^{\prime})\}. Observe that, for every vertex aYAa\in Y_{A}, aa is marked by s1ks^{k}_{1} placed due to the corresponding zkz_{k}, where aAka\in A^{k}. Also, YAY_{A} may be partitioned into the two sets YAprev=zk(ZAZAprev)t1(k)Y_{A}^{prev}=\bigcup_{z_{k}\in(Z_{A}\cap Z_{A}^{prev})}t1(k) and YAYAprevY_{A}\setminus Y_{A}^{prev}.

Similarly, let ZCZ_{C} denote the subset of primary vertices such that CkC^{k} is non-empty for each zkZCz_{k}\in Z_{C}. Also, let ZCprevZ_{C}^{prev} denote the subset of primary vertices where each zkZCprevz_{k}\in Z_{C}^{prev} belongs to CjC^{j} for some previously chosen primary vertex zjZCz_{j}\in Z_{C}, where j<kj<k. In other words, we have ZC={zkZ:Ck}Z_{C}=\{z_{k}\in Z:C^{k}\neq\emptyset\}, and ZCprev={zkZ:zjZC such that j<k and zkCj}Z_{C}^{prev}=\{z_{k}\in Z:\exists z_{j}\in Z_{C}\mbox{ such that }j<k\mbox{ and }z_{k}\in C^{j}\}. Finally, for every zkZCz_{k}\in Z_{C}, if the corresponding guard s2ks^{k}_{2} is placed at prev(t(c))prev(t^{\prime}(c)), then cCkc\in C^{k} is denoted by t1(k)t^{\prime}1(k) and included in the set YCY_{C}, i.e. YC=zkZC{t1(k)=cCk:(cCk)t(c)t(c)}Y_{C}=\bigcup_{z_{k}\in Z_{C}}\{t^{\prime}1(k)=c\in C^{k}:(\forall c^{\prime}\in C^{k})\hskip 2.84526ptt^{\prime}(c)\prec t^{\prime}(c^{\prime})\}. Observe that, for every vertex cYCc\in Y_{C}, cc is marked by the vertex guard s2ks^{k}_{2} placed due to the corresponding zkz_{k}, where cCkc\in C^{k}. Also, YCY_{C} may be partitioned into the two sets YCprev=zk(ZCZCprev)t1(k)Y_{C}^{prev}=\bigcup_{z_{k}\in(Z_{C}\cap Z_{C}^{prev})}t^{\prime}1(k) and YCYCprevY_{C}\setminus Y_{C}^{prev}.

Let ZB=Z(ZAZAprevZCZCprev)Z_{B}=Z\setminus(Z_{A}\cup Z_{A}^{prev}\cup Z_{C}\cup Z_{C}^{prev}), and let GBG_{B} denote the minimal subset of GoptLG_{opt}^{L} required to see all vertices of ZBZ_{B}.

Lemma 29.

|GB|=|ZB||G_{B}|=|Z_{B}|.

Proof.

Observe that, for each vertex zkZBz_{k}\in Z_{B}, Ak=A^{k}=\emptyset and Ck=C^{k}=\emptyset, i.e. 𝒪𝒱𝒱(zk)=Bk\mathcal{OVV}^{-}(z_{k})=B^{k}. Moreover, zkz_{k} does not belong to 𝒪𝒱𝒱(zj)\mathcal{OVV}^{-}(z_{j}) for any other zjZz_{j}\in Z where j<kj<k. Therefore, 𝒪𝒱𝒱(zk)𝒪𝒱𝒱(zj)=\mathcal{OVV}^{-}(z_{k})\cap\mathcal{OVV}^{-}(z_{j})=\emptyset for any other zjZz_{j}\in Z, and by Lemma 13, we know that a single distinct optimal guard is required for guarding each zkZBz_{k}\in Z_{B}. Hence, |GB|=|ZB||G_{B}|=|Z_{B}|. ∎

Let us define the minimal subsets GAprevGoptLG_{A}^{prev}\subseteq G_{opt}^{L} and GCprevGoptLG_{C}^{prev}\subseteq G_{opt}^{L} of optimal guards required for guarding all vertices belonging to ZAprevYAprevZ_{A}^{prev}\cup Y_{A}^{prev} and ZCprevYCprevZ_{C}^{prev}\cup Y_{C}^{prev} respectively. In the lemmas below, lower bounds are established on the sizes of the sets GAprevG_{A}^{prev} and GBprevG_{B}^{prev} respectively.

Lemma 30.

|GAprev||ZAprev||G_{A}^{prev}|\geq|Z_{A}^{prev}|.

Proof.

Assume that 𝒱𝒱𝒫(zj)𝒱𝒱𝒫(zj)=\mathcal{VVP}^{-}(z_{j})\cap\mathcal{VVP}^{-}(z_{j^{\prime}})=\emptyset for every pair zj,zjZAprevz_{j},z_{j^{\prime}}\in Z_{A}^{prev}. Then clearly a distinct optimal guard is required in GAprevG_{A}^{prev} for guarding each primary vertex in ZAprevZ_{A}^{prev}, and therefore |GAprev||ZAprev||G_{A}^{prev}|\geq|Z_{A}^{prev}|. However, as per Lemma 18, there may exist some pair zj,zjZAprevz_{j},z_{j^{\prime}}\in Z_{A}^{prev} for which 𝒱𝒱𝒫(zj)𝒱𝒱𝒫(zj)=\mathcal{VVP}^{-}(z_{j})\cap\mathcal{VVP}^{-}(z_{j^{\prime}})=\emptyset does not hold, and a single optimal guard in gGAprevg\in G_{A}^{prev} is sufficient to see both zjz_{j} and zjz_{j^{\prime}}. Then, both zjz_{j} and zjz_{j^{\prime}} belong to the same set Pi(Lk)P_{i}(L^{k}) in the partition P(Lk)P(L^{k}) of AkA^{k} corresponding to some zkZAz_{k}\in Z_{A} (see Figure 18). We prove below that, in such a situation, an additional guard for t1(j)YAprevt1(j)\in Y_{A}^{prev} is required in GAprevG_{A}^{prev} to compensate for the single optimal that sees two primary vertices in ZAprevZ_{A}^{prev}. Recall that two primary vertices in ZAprevZ_{A}^{prev} can be overlapping only if they both belong to the same set in P(Lk)P(L^{k}). Moreover, since we know from Lemma 27 that at most only two primary vertices can be chosen from any Pi(Lk)P_{i}(L^{k}), such compensation can be applied to every Pi(Lk)P_{i}(L^{k}) for which |Pi(Lk)ZAprev|=2|P_{i}(L^{k})\cap Z_{A}^{prev}|=2, and hence, |GAprev||ZAprev||G_{A}^{prev}|\geq|Z_{A}^{prev}| still holds.

Let aσ(i)Aka_{\sigma(i)}\in A^{k} be the leading vertex belonging to Pi(Lk)P_{i}(L^{k}). Let us assume without loss of generality that j<jj<j^{\prime}, i.e. zjz_{j} was chosen as a primary vertex earlier than zjz_{j^{\prime}} by Algorithm 1. Then, observe that t1(j)=aσ(i)t1(j)=a_{\sigma(i)}, and so aσ(i)YApreva_{\sigma(i)}\in Y_{A}^{prev}. As zjz_{j^{\prime}} is unmarked even after placement of s1j=t(aσ(i))s^{j}_{1}=t(a_{\sigma(i)}) and s3j=l(zj)s^{j}_{3}=l(z_{j}), we have t(aσ(i))f(zj)t(a_{\sigma(i)})\prec f(z_{j^{\prime}}) and l(zj)t(zj)l(z_{j})\prec t^{\prime}(z_{j^{\prime}}), and they can both be possible only if t(aσ(i))f(zj)t(zj)t(zj)t(zj)l(zj)t(zj)t(a_{\sigma(i)})\prec f(z_{j^{\prime}})\prec t(z_{j^{\prime}})\prec t(z_{j})\prec t^{\prime}(z_{j})\prec l(z_{j})\prec t^{\prime}(z_{j^{\prime}}). Thus, the common optimal guard gGAprevg\in G_{A}^{prev} that sees both zjz_{j} and zjz_{j^{\prime}} must lie on bdcc(f(zj),t(zj))bd_{cc}(f(z_{j^{\prime}}),t(z_{j^{\prime}})). But in that case, t(aσ(i))gt(aσ(i))t(a_{\sigma(i)})\prec g\prec t^{\prime}(a_{\sigma(i)}), which means that gg does not see aσ(i)=t1(j)a_{\sigma(i)}=t1(j), and so a separate optimal guard is required in GAprevG_{A}^{prev} for guarding aσ(i)=t1(j)a_{\sigma(i)}=t1(j). Thus, two distinct optimal guards are required to guard the three vertices zj,zjZAprevz_{j},z_{j^{\prime}}\in Z_{A}^{prev} and aσ(i)=t1(j)a_{\sigma(i)}=t1(j), whenever both zjz_{j} and zjz_{j^{\prime}} belong to the same set Pi(Lk)P_{i}(L^{k}). ∎

Refer to caption

Figure 18: Since both zj,zjAkz_{j},z_{j^{\prime}}\in A^{k} belong to Pi(Lk)P_{i}(L^{k}) in the partition P(Lk)P(L^{k}) of AkA^{k}, and k<j<jk<j<j^{\prime}, zjZAprev(k)z_{j}\in Z_{A}^{prev}(k) and zjZAprev(j)z_{j^{\prime}}\in Z_{A}^{prev}(j).
Lemma 31.

|GCprev||ZCprev||G_{C}^{prev}|\geq|Z_{C}^{prev}|.

Proof.

Assume that 𝒱𝒱𝒫(zj)𝒱𝒱𝒫(zj)=\mathcal{VVP}^{-}(z_{j})\cap\mathcal{VVP}^{-}(z_{j^{\prime}})=\emptyset for every pair zj,zjZCprevz_{j},z_{j^{\prime}}\in Z_{C}^{prev}. Then clearly a distinct optimal guard is required in GCprevG_{C}^{prev} for guarding each primary vertex in ZCprevZ_{C}^{prev}, and therefore |GCprev||ZCprev||G_{C}^{prev}|\geq|Z_{C}^{prev}|. However, as per Lemma 20, there may exist some pair zj,zjZCprevz_{j},z_{j^{\prime}}\in Z_{C}^{prev} for which 𝒱𝒱𝒫(zj)𝒱𝒱𝒫(zj)=\mathcal{VVP}^{-}(z_{j})\cap\mathcal{VVP}^{-}(z_{j^{\prime}})=\emptyset does not hold, and a single optimal guard in gGCprevg\in G_{C}^{prev} is sufficient to see both zjz_{j} and zjz_{j^{\prime}}. Then, both zjz_{j} and zjz_{j^{\prime}} belong to the same set Pi(Rk)P_{i}(R^{k}) in the partition P(Rk)P(R^{k}) of CkC^{k} corresponding to some zkZCz_{k}\in Z_{C}. We prove below that, in such a situation, an additional guard for t1(j)YCprevt1(j)\in Y_{C}^{prev} is required in GCprevG_{C}^{prev} to compensate for the single optimal that sees two primary vertices in ZCprevZ_{C}^{prev}. Recall that two primary vertices in ZCprevZ_{C}^{prev} can be overlapping only if they both belong to the same set in P(Rk)P(R^{k}). Moreover, since we know from Lemma 28 that at most only two primary vertices can be chosen from any Pi(Rk)P_{i}(R^{k}), such compensation can be applied to every Pi(Rk)P_{i}(R^{k}) for which |Pi(Rk)ZCprev|=2|P_{i}(R^{k})\cap Z_{C}^{prev}|=2, and hence, |GCprev||ZCprev||G_{C}^{prev}|\geq|Z_{C}^{prev}| still holds.

Let cσ(i)Ckc_{\sigma(i)}\in C^{k} be the leading vertex belonging to Pi(Rk)P_{i}(R^{k}). Let us assume without loss of generality that j<jj<j^{\prime}, i.e. zjz_{j} was chosen as a primary vertex earlier than zjz_{j^{\prime}} by Algorithm 1. Then, observe that t1(j)=cσ(i)t1(j)=c_{\sigma(i)}, and so cσ(i)YCprevc_{\sigma(i)}\in Y_{C}^{prev}. As zjz_{j^{\prime}} is unmarked even after placement of s2j=prev(t(cσ(i)))s^{j}_{2}=prev(t^{\prime}(c_{\sigma(i)})) and s3j=l(zj)s^{j}_{3}=l(z_{j}), we have t(cσ(i))f(zj)t^{\prime}(c_{\sigma(i)})\prec f(z_{j^{\prime}}) and l(zj)t(zj)l(z_{j})\prec t(z_{j^{\prime}}), and they can both be possible only if t(cσ(i))f(zj)t(zj)t(zj)t(zj)l(zj)t(zj)t^{\prime}(c_{\sigma(i)})\prec f(z_{j^{\prime}})\prec t^{\prime}(z_{j^{\prime}})\prec t^{\prime}(z_{j})\prec t(z_{j})\prec l(z_{j})\prec t(z_{j^{\prime}}). Thus, the common optimal guard gGCprevg\in G_{C}^{prev} that sees both zjz_{j} and zjz_{j^{\prime}} must lie on bdcc(f(zj),t(zj))bd_{cc}(f(z_{j^{\prime}}),t^{\prime}(z_{j^{\prime}})). But in that case, t(cσ(i))gt(cσ(i))t^{\prime}(c_{\sigma(i)})\prec g\prec t(c_{\sigma(i)}), which means that gg does not see cσ(i)=t1(j)c_{\sigma(i)}=t1(j), and so a separate optimal guard is required in GCprevG_{C}^{prev} for guarding cσ(i)=t1(j)c_{\sigma(i)}=t1(j). Thus, two distinct optimal guards are required to guard the three vertices zj,zjZCprevz_{j},z_{j^{\prime}}\in Z_{C}^{prev} and cσ(i)=t1(j)c_{\sigma(i)}=t1(j), whenever both zjz_{j} and zjz_{j^{\prime}} belong to the same set Pi(Rk)P_{i}(R^{k}). ∎

Consider the two sets ZAYAZAprevZ_{A}\cup Y_{A}\cup Z_{A}^{prev} and ZCYCZCprevZ_{C}\cup Y_{C}\cup Z_{C}^{prev} respectively. Let us denote by GAG_{A} the minimal subset of GoptLG_{opt}^{L} that see all vertices of ZAYAZAprevZ_{A}\cup Y_{A}\cup Z_{A}^{prev}, and similarly, let us denote by GCG_{C} the minimal subset of GoptLG_{opt}^{L} that see all vertices of ZAYCZCprevZ_{A}\cup Y_{C}\cup Z_{C}^{prev}. In order to obtain a lower bound on the number of optimal guards, we establish the following two lemmas.

Lemma 32.

|GA||ZAZAprev||G_{A}|\geq|Z_{A}\cup Z_{A}^{prev}|.

Proof.

Observe that GAGAprevG_{A}\supseteq G_{A}^{prev}, since GAG_{A} is also required to guard the vertices belonging to (ZAZAprev)(YAYAprev)(Z_{A}\setminus Z_{A}^{prev})\cup(Y_{A}\setminus Y_{A}^{prev}) in addition to those guarded by GAprevG_{A}^{prev}. We claim that, for every zkZAZAprevz_{k}\in Z_{A}\setminus Z_{A}^{prev}, there exists an optimal guard in GAG_{A} for guarding zkz_{k} or t1(k)t1(k) which is distinct from all the optimal guards already counted in GAprevG_{A}^{prev}. This is enough to prove the lemma, as it implies in conjunction with Lemma 30 that |GA||GAprev|+|ZAZAprev||ZAprev|+|ZAZAprev|=|ZAZAprev||G_{A}|\geq|G_{A}^{prev}|+|Z_{A}\setminus Z_{A}^{prev}|\geq|Z_{A}^{prev}|+|Z_{A}\setminus Z_{A}^{prev}|=|Z_{A}\cup Z_{A}^{prev}|. The above claim is proven below.

Let gkGAg_{k}\in G_{A} be an optimal guard that sees zkz_{k}. If gkg_{k} does not coincide with any of the optimal guards already counted in GAprevG_{A}^{prev}, then clearly our claim holds. Otherwise, let us consider the situation where gkg_{k} coincides with gjGAprevg_{j}\in G_{A}^{prev} that guards a primary vertex zj(ZAprevAk)z_{j}\in(Z_{A}^{prev}\cap A^{k}) or some vertex y(YAprevAk)y\in(Y_{A}^{prev}\cap A^{k}), or may be both. Let us first consider the subcase where gjg_{j} sees some primary vertex zj(ZAprevAk)z_{j}\in(Z_{A}^{prev}\cap A^{k}). If zjP1(Lk)z_{j}\notin P_{1}(L^{k}), then clearly gjg_{j} does not see t1(k)P1(Lk)t1(k)\in P_{1}(L^{k}). Thus, a separate optimal guard is required in GAG_{A} for guarding t1(k)YAYAprevt1(k)\in Y_{A}\setminus Y_{A}^{prev}, and our claim still holds. So, let us consider the other case where zjP1(Lk)z_{j}\in P_{1}(L^{k}) and gjGAprevg_{j}\in G_{A}^{prev} also sees t1(k)t1(k). Observe that, as gjg_{j} sees t1(k)t1(k), we have either gjt(t1(k))g_{j}\prec t(t1(k)) or t(t1(k))gjt^{\prime}(t1(k))\prec g_{j}. However, since gkg_{k} and gjg_{j} coincide, we must have gjl(zk)t(t1(k))g_{j}\prec l(z_{k})\prec t^{\prime}(t1(k)), which rules out the latter possibility. So, we must have gjt(t1(k))g_{j}\prec t(t1(k)), which in turn implies that f(zj)gjt(t1(k))t(zj)f(z_{j})\prec g_{j}\prec t(t1(k))\prec t(z_{j}). Note that, if s1k=t(t1(k))s^{k}_{1}=t(t1(k)) is not visible from zjz_{j} due to a right pocket, then either it means that t1(k)t1(k) belongs to BkB^{k} rather than AkA^{k}, or it contradicts the fact that t1(k)t1(k) is the leading vertex of P1(Lk)P_{1}(L^{k}). On the other hand, if s1k=t(t1(k))s^{k}_{1}=t(t1(k)) is not visible from zjz_{j} due to a left pocket, then again it means that zjz_{j} belongs to BkB^{k} or CkC^{k} rather than AkA^{k}. So, zjz_{j} must be visible from t(t1(k))t(t1(k)), and is thus marked by the placement of s1k=t(t1(k))s^{k}_{1}=t(t1(k)), which contradicts the assumption that zjZAprevz_{j}\in Z_{A}^{prev}.

Let us now consider the other subcase where gjg_{j} sees only a vertex y(YAprevAk)y\in(Y_{A}^{prev}\cap A^{k}), but gjg_{j} sees no primary vertex zj(ZAprevAk)z_{j}\in(Z_{A}^{prev}\cap A^{k}). Once again, if yP1(Lk)y\notin P_{1}(L^{k}), then clearly gjg_{j} does not see t1(k)P1(Lk)t1(k)\in P_{1}(L^{k}). So, let us consider the other case where yP1(Lk)y\in P_{1}(L^{k}) and gjGAprevg_{j}\in G_{A}^{prev} also sees t1(k)t1(k). Observe that, as gjg_{j} sees t1(k)t1(k), we have either gjt(t1(k))g_{j}\prec t(t1(k)) or t(t1(k))gjt^{\prime}(t1(k))\prec g_{j}. However, since gkg_{k} and gjg_{j} coincide, we must have gjl(zk)t(t1(k))g_{j}\prec l(z_{k})\prec t^{\prime}(t1(k)), which rules out the latter possibility. So, we must have gjt(t1(k))g_{j}\prec t(t1(k)), which in turn implies that f(y)gjt(t1(k))t(y)f(y)\prec g_{j}\prec t(t1(k))\prec t(y). Note that, if s1k=t(t1(k))s^{k}_{1}=t(t1(k)) is not visible from yy due to a right pocket, then either it means that t1(k)t1(k) belongs to BkB^{k} rather than AkA^{k}, or it contradicts the fact that t1(k)t1(k) is the leading vertex of P1(Lk)P_{1}(L^{k}). On the other hand, if s1k=t(t1(k))s^{k}_{1}=t(t1(k)) is not visible from yy due to a left pocket, then again it means that yy belongs to BkB^{k} or CkC^{k} rather than AkA^{k}. So, yy must be visible from t(t1(k))t(t1(k)), and is thus marked by the placement of s1k=t(t1(k))s^{k}_{1}=t(t1(k)), which contradicts the assumption that yYAprevy\in Y_{A}^{prev}. Hence, it is established that for every zkZAz_{k}\in Z_{A}, there exists an optimal guard in GAG_{A} for guarding zkz_{k} or t1(k)t1(k), which is distinct from all the optimal guards already counted in GAprevG_{A}^{prev}, and this completes our proof. ∎

Lemma 33.

|GC||ZCZCprev||G_{C}|\geq|Z_{C}\cup Z_{C}^{prev}|.

Proof.

Observe that GCGCprevG_{C}\supseteq G_{C}^{prev}, since GCG_{C} is also required to guard the vertices belonging to (ZCZCprev)(YCYCprev)(Z_{C}\setminus Z_{C}^{prev})\cup(Y_{C}\setminus Y_{C}^{prev}) in addition to those guarded by GCprevG_{C}^{prev}. We claim that, for every zkZCZCprevz_{k}\in Z_{C}\setminus Z_{C}^{prev}, there exists an optimal guard in GCG_{C} for guarding zkz_{k} or t1(k)t^{\prime}1(k) which is distinct from all the optimal guards already counted in GCprevG_{C}^{prev}. This is enough to prove the lemma, as it implies in conjunction with Lemma 31 that |GC||GCprev|+|ZCZCprev||ZCprev|+|ZCZCprev|=|ZCZCprev||G_{C}|\geq|G_{C}^{prev}|+|Z_{C}\setminus Z_{C}^{prev}|\geq|Z_{C}^{prev}|+|Z_{C}\setminus Z_{C}^{prev}|=|Z_{C}\cup Z_{C}^{prev}|. The above claim is proven below.

Let gkGCg_{k}\in G_{C} be an optimal guard that sees zkz_{k}. If gkg_{k} does not coincide with any of the optimal guards already counted in GCprevG_{C}^{prev}, then clearly our claim holds. Otherwise, let us consider the situation where gkg_{k} coincides with gjGCprevg_{j}\in G_{C}^{prev} that guards a primary vertex zj(ZCprevCk)z_{j}\in(Z_{C}^{prev}\cap C^{k}) or some vertex y(YCprevCk)y\in(Y_{C}^{prev}\cap C^{k}), or may be both. Let us first consider the subcase where gjg_{j} sees some primary vertex zj(ZCprevCk)z_{j}\in(Z_{C}^{prev}\cap C^{k}). If zjP1(Rk)z_{j}\notin P_{1}(R^{k}), then clearly gjg_{j} does not see t1(k)P1(Rk)t^{\prime}1(k)\in P_{1}(R^{k}). Thus, a separate optimal guard is required in GCG_{C} for guarding t1(k)YCYCprevt^{\prime}1(k)\in Y_{C}\setminus Y_{C}^{prev}, and our claim still holds. So, let us consider the other case where zjP1(Rk)z_{j}\in P_{1}(R^{k}) and gjGCprevg_{j}\in G_{C}^{prev} also sees t1(k)t^{\prime}1(k). Observe that, as gjg_{j} sees t1(k)t^{\prime}1(k), we have either gjt(t1(k))g_{j}\prec t^{\prime}(t^{\prime}1(k)) or t(t1(k))gjt(t^{\prime}1(k))\prec g_{j}. However, since gkg_{k} and gjg_{j} coincide, we must have gjl(zk)t(t1(k))g_{j}\prec l(z_{k})\prec t(t^{\prime}1(k)), which rules out the latter possibility. So, we must have gjt(t1(k))g_{j}\prec t^{\prime}(t^{\prime}1(k)), which in turn implies that f(zj)gjt(t1(k))t(zj)f(z_{j})\prec g_{j}\prec t^{\prime}(t^{\prime}1(k))\prec t^{\prime}(z_{j}). Note that, if s2k=prev(t(t1(k)))s^{k}_{2}=prev(t^{\prime}(t^{\prime}1(k))) is not visible from zjz_{j} due to a right pocket, then either it means that t1(k)t^{\prime}1(k) belongs to BkB^{k} rather than CkC^{k}, or it contradicts the fact that t1(k)t^{\prime}1(k) is the leading vertex of P1(Rk)P_{1}(R^{k}). On the other hand, if s2k=prev(t(t1(k)))s^{k}_{2}=prev(t^{\prime}(t^{\prime}1(k))) is not visible from zjz_{j} due to a left pocket, then again it means that zjz_{j} belongs to BkB^{k} or AkA^{k} rather than CkC^{k}. So, zjz_{j} must be visible from prev(t(t1(k)))prev(t^{\prime}(t^{\prime}1(k))), and is thus marked by the placement of s2k=prev(t(t1(k)))s^{k}_{2}=prev(t^{\prime}(t^{\prime}1(k))), which contradicts the assumption that zjZCprevz_{j}\in Z_{C}^{prev}.

Let us now consider the other subcase where gjg_{j} sees only a vertex y(YCprevCk)y\in(Y_{C}^{prev}\cap C^{k}), but gjg_{j} sees no primary vertex zj(ZCprevCk)z_{j}\in(Z_{C}^{prev}\cap C^{k}). Once again, if yP1(Rk)y\notin P_{1}(R^{k}), then clearly gjg_{j} does not see t1(k)P1(Rk)t^{\prime}1(k)\in P_{1}(R^{k}). So, let us consider the other case where yP1(Rk)y\in P_{1}(R^{k}) and gjGCprevg_{j}\in G_{C}^{prev} also sees t1(k)t^{\prime}1(k). Observe that, as gjg_{j} sees t1(k)t^{\prime}1(k), we have either gjt(t1(k))g_{j}\prec t^{\prime}(t^{\prime}1(k)) or t(t1(k))gjt(t^{\prime}1(k))\prec g_{j}. However, since gkg_{k} and gjg_{j} coincide, we must have gjl(zk)t(t1(k))g_{j}\prec l(z_{k})\prec t(t^{\prime}1(k)), which rules out the latter possibility. So, we must have gjt(t1(k))g_{j}\prec t^{\prime}(t^{\prime}1(k)), which in turn implies that f(y)gjt(t1(k))t(y)f(y)\prec g_{j}\prec t^{\prime}(t^{\prime}1(k))\prec t^{\prime}(y). Note that, if s2k=prev(t(t1(k)))s^{k}_{2}=prev(t^{\prime}(t^{\prime}1(k))) is not visible from yy due to a right pocket, then either it means that t1(k)t^{\prime}1(k) belongs to BkB^{k} rather than CkC^{k}, or it contradicts the fact that t1(k)t^{\prime}1(k) is the leading vertex of P1(Rk)P_{1}(R^{k}). On the other hand, if s2k=prev(t(t1(k)))s^{k}_{2}=prev(t^{\prime}(t^{\prime}1(k))) is not visible from zjz_{j} due to a left pocket, then again it means that zjz_{j} belongs to BkB^{k} or AkA^{k} rather than CkC^{k}. So, zjz_{j} must be visible from prev(t(t1(k)))prev(t^{\prime}(t^{\prime}1(k))), and is thus marked by the placement of s2k=prev(t(t1(k)))s^{k}_{2}=prev(t^{\prime}(t^{\prime}1(k))), which contradicts the assumption that yYAprevy\in Y_{A}^{prev}. Hence, it is established that for every zkZAz_{k}\in Z_{A}, there exists an optimal guard in GAG_{A} for guarding zkz_{k} or t1(k)t1(k), which is distinct from all the optimal guards already counted in GAprevG_{A}^{prev}, and this completes our proof. ∎

Lemma 34.

|GoptL||Z|/2|G_{opt}^{L}|\geq|Z|/2.

Proof.

Since GAG_{A} and GCG_{C} are both subsets of GoptLGBG_{opt}^{L}\setminus G_{B}, we know that |GoptLGB||GA||G_{opt}^{L}\setminus G_{B}|\geq|G_{A}| and |GoptLGB||GC||G_{opt}^{L}\setminus G_{B}|\geq|G_{C}|. By Lemma 26, we know that GAG_{A} and GCG_{C} need not necessarily be disjoint. Thus, |GoptLGB|max(|GA|,|GC|)(|GA|+|GC|)/2|G_{opt}^{L}\setminus G_{B}|\geq\max(|G_{A}|,|G_{C}|)\geq(|G_{A}|+|G_{C}|)/2. By using Lemmas 32 and 33, we have (|GA|+|GC|)/2(|ZAZAprev|+|ZCZCprev|)/2(|ZAZAprevZCZCprev|)/2=|ZZB|/2(|G_{A}|+|G_{C}|)/2\geq(|Z_{A}\cup Z_{A}^{prev}|+|Z_{C}\cup Z_{C}^{prev}|)/2\geq(|Z_{A}\cup Z_{A}^{prev}\cup Z_{C}\cup Z_{C}^{prev}|)/2=|Z\setminus Z_{B}|/2. Therefore, by using Lemma 29, |GoptL|=|GoptLGB|+|GB|(|GA|+|GC|)/2+|ZB||ZZB|/2+|ZB|(|ZZB|+|ZB|)/2=|Z|/2|G_{opt}^{L}|=|G_{opt}^{L}\setminus G_{B}|+|G_{B}|\geq(|G_{A}|+|G_{C}|)/2+|Z_{B}|\geq|Z\setminus Z_{B}|/2+|Z_{B}|\geq(|Z\setminus Z_{B}|+|Z_{B}|)/2=|Z|/2. ∎

Theorem 35.

Let ZZ be the set of primary vertices chosen by Algorithm 1. Then, the set SS of vertex guards computed by Algorithm 1 satisfies |S|6|GoptL||S|\leq 6\cdot|G_{opt}^{L}|.

Proof.

Since Algorithm 1 places at most three vertex guards s1ks^{k}_{1}, s2ks^{k}_{2} and s3ks^{k}_{3} corresponding to each primary vertex zkZz_{k}\in Z, we know that |S|3|Z||S|\leq 3\cdot|Z|. Also, from Lemma 34, we know that |Z|2|GoptL||Z|\leq 2\cdot|G_{opt}^{L}|. Therefore, |S|3|Z|6|GoptL||S|\leq 3\cdot|Z|\leq 6\cdot|G_{opt}^{L}|. ∎

Algorithm 1 An 𝒪(n4)\mathcal{O}(n^{4})-algorithm for computing a guard set SS for all vertices of QUQ_{U}
1:Initialize k0k\leftarrow 0 and SS\leftarrow\emptyset
2:Initialize all vertices of QUQ_{U} as unmarked
3:while  there exists an unmarked vertex in QUQ_{U} do
4:  Set kk+1k\leftarrow k+1 \triangleright Variable kk keeps count of the current iteration
5:  zkz_{k}\leftarrow the first unmarked vertex of bdc(u,v)bd_{c}(u,v) in clockwise order
6:  qzkq\leftarrow z_{k}
7:  while  qvq\neq v  do
8:   qq\leftarrow vertex next to qq in clockwise order on bdc(u,v)bd_{c}(u,v)
9:   if  qq is unmarked and l(q)l(zk)l^{\prime}(q)\prec l^{\prime}(z_{k})  then
10:     zkqz_{k}\leftarrow q \triangleright Update zkz_{k} to qq whenever qq is unmarked and l(q)l(zk)l^{\prime}(q)\prec l^{\prime}(z_{k})
11:   end if
12:  end while\triangleright Variable zkz_{k} is now the primary vertex for the current iteration
13:  Compute the ordered set 𝒪𝒱𝒱(zk)={x1k,x2k,,xm(k)k}\mathcal{OVV}^{-}(z_{k})=\{x^{k}_{1},x^{k}_{2},\ldots,x^{k}_{m(k)}\}
14:  Partition 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) into the sets AkA^{k}, BkB^{k} and CkC^{k}
15:  if  𝒞(AkBkCk)\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})\neq\emptyset  then
16:   s3ks_{3}^{k}\leftarrow any vertex belonging to 𝒞(AkBkCk)\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})
17:   Sk{s3k}S^{k}\leftarrow\{s_{3}^{k}\} \triangleright See Figure 8
18:  else
19:   s3kl(zk)s_{3}^{k}\leftarrow l(z_{k}) \triangleright See Figures 9, 10, 11 and 12
20:   if  𝒞(Ak)\mathcal{CI}(A^{k})\neq\emptyset  then
21:     s1ks_{1}^{k}\leftarrow any vertex belonging to 𝒞(Ak)\mathcal{CI}(A^{k}) \triangleright See Figures 9 and 11
22:   else
23:     qf(zk)q^{\prime}\leftarrow f(z_{k})
24:     while  ql(zk)q^{\prime}\neq l(z_{k})  do
25:      qq^{\prime}\leftarrow vertex next to qq^{\prime} in counter-clockwise order on 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k})
26:      if  q=t(xik)q^{\prime}=t(x_{i}^{k}) for some xikAkx_{i}^{k}\in A^{k}  then
27:        s1kqs_{1}^{k}\leftarrow q^{\prime} \triangleright See Figures 10 and 12
28:        break
29:      end if
30:     end while
31:   end if
32:   if  𝒞(Ck)\mathcal{CI}(C^{k})\neq\emptyset  then
33:     s2ks_{2}^{k}\leftarrow any vertex belonging to 𝒞(Ck)\mathcal{CI}(C^{k}) \triangleright See Figures 9 and 10
34:   else
35:     qf(zk)q^{\prime}\leftarrow f(z_{k})
36:     while  ql(zk)q^{\prime}\neq l(z_{k})  do
37:      qq^{\prime}\leftarrow vertex next to qq^{\prime} in counter-clockwise order on 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k})
38:      if  qq^{\prime} immediately precedes t(xjk)t^{\prime}(x_{j}^{k}) for some xjkCkx_{j}^{k}\in C^{k}  then
39:        s2kqs_{2}^{k}\leftarrow q^{\prime} \triangleright See Figures 11 and 12
40:        break
41:      end if
42:     end while
43:   end if
44:   Sk{s1k,s2k,s3k}S^{k}\leftarrow\{s_{1}^{k},s_{2}^{k},s_{3}^{k}\}
45:  end if
46:  SSSkS\leftarrow S\cup S^{k}
47:  Mark all vertices of QUQ_{U} visible from new guards
48:end while
49:return the guard set SS
Theorem 36.

Algorithm 1 has a worst-case time complexity of 𝒪(n4)\mathcal{O}(n^{4}).

5.4 Placement of guards in the general scenario

Let us consider the general scenario where GoptLGoptG^{L}_{opt}\subset G_{opt} and GoptUG^{U}_{opt}\neq\emptyset. If Algorithm 1 is executed in this scenario, there may exist a subset ZZZ^{\prime}\subseteq Z of primary vertices that are visible from an optimal guard belonging to GoptUG^{U}_{opt} (see Figure 19). Therefore, it is necessary to choose both inside and outside vertex guards corresponding to each primary vertex zkZz_{k}\in Z, so that it is ensured that distinct optimal guards are required for guarding every two primary vertices. So, keeping this in mind, let us modify Algorithm 1 so that, in addition to the three outside guards s1ks^{k}_{1}, s2ks^{k}_{2} and s3ks^{k}_{3} it also places at most three inside guards s4ks^{k}_{4}, s5ks^{k}_{5} and s6ks^{k}_{6} for every zkZz_{k}\in Z.

Refer to caption

Figure 19: A guard gg on bdc(u,v)bd_{c}(u,v) sees z1z_{1}, z2z_{2} and z3z_{3}, but three guards are necessary on bdcc(f(z1),l(z1))bd_{cc}(f(z_{1}),l(z_{1})), bdcc(f(z2),l(z2))bd_{cc}(f(z_{2}),l(z_{2})) and bdcc(f(z3),l(z3))bd_{cc}(f(z_{3}),l(z_{3})) respectively to see them.

For any primary vertex zkz_{k}, let us denote by 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}) the set of unmarked vertices of QUQ_{U} whose inward visible vertices overlap with those of zkz_{k}. In other words,

𝒪𝒱𝒱+(zk)={x𝒱(QU): x is unmarked, and 𝒱𝒱𝒫+(zk)𝒱𝒱𝒫+(x)}\mathcal{OVV}^{+}(z_{k})=\{x\in\mathcal{V}(Q_{U}):\mbox{ $x$ is unmarked, and }\mathcal{VVP}^{+}(z_{k})\cap\mathcal{VVP}^{+}(x)\neq\emptyset\}

Note that all vertices of bdc(p(u,zk),zk)bd_{c}(p(u,z_{k}),z_{k}) may not belong to 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}). Further, every vertex of 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}) is at a link distance of 1 from some vertex of 𝒱𝒱𝒫+(zk)\mathcal{VVP}^{+}(z_{k}) and at a link distance of 2 from zkz_{k}. In the modified algorithm, two inside guards s4ks_{4}^{k} and s5ks_{5}^{k} are placed at p(u,zk)p(u,z_{k}) and p(v,zk)p(v,z_{k}) respectively, for every primary vertex zkZz_{k}\in Z. For the placement of an additional inside guard s6ks^{k}_{6}, consider the following cases.

Case 1:

All vertices of 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}) are visible from s4ks^{k}_{4} or s5ks^{k}_{5}. So, placement of s6ks_{6}^{k} is not required.

Case 2:

If all vertices of 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}) are not visible from s4ks^{k}_{4} or s5ks^{k}_{5}, and there exists one common vertex that sees all vertices of 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}), then s6ks_{6}^{k} is placed on that common vertex.

Case 3:

If all vertices of 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}) are not visible from s4ks^{k}_{4} or s5ks^{k}_{5}, and there does not exist any common vertex that sees all vertices of 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}) (see Figure 21), then s6ks_{6}^{k} is placed as follows. The vertex guard s6ks_{6}^{k} is placed at the farthest vertex wkw_{k} of 𝒱𝒱𝒫+(zk)\mathcal{VVP}^{+}(z_{k}) in clockwise order, starting from p(u,zk)p(u,z_{k}), so that it can see all vertices of 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}) that are visible from any vertex of 𝒱𝒱𝒫+(zk)\mathcal{VVP}^{+}(z_{k}) lying on bdc(p(u,zk),wk)bd_{c}(p(u,z_{k}),w_{k}) (see Figure 23).

Let us discuss these cases in the presence of guards of GoptUG^{U}_{opt}. Assume that the current primary vertex zkz_{k} is visible from an optimal guard gGoptUg\in G^{U}_{opt}. So, zkZUz_{k}\in Z^{U} and g𝒱𝒱𝒫+(zk)g\in\mathcal{VVP}^{+}(z_{k}). Thus, if Case 1 true for zkz_{k}, then all visible vertices of 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}) from gg are also visible from s4ks_{4}^{k} and s5ks_{5}^{k}. Similarly, if Case 2 holds for zkz_{k}, then all visible vertices of 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}) from gg are also visible from s6ks_{6}^{k}, s4ks_{4}^{k} or s5ks_{5}^{k}. However, if Case 3 holds for zkz_{k}, then there exists a non-empty subset of vertices Uk𝒪𝒱𝒱+(zk)U^{k}\subset\mathcal{OVV}^{+}(z_{k}) that are visible from gg but not visible from s6ks_{6}^{k}, s4ks_{4}^{k} or s5ks_{5}^{k}. If yikUky_{i}^{k}\in U^{k} does not become a primary vertex later, then yiky_{i}^{k} is guarded by guards placed due to some other primary vertex. Moreover, if this happens for every yikUky_{i}^{k}\in U^{k}, then no additional inside guard on 𝒱𝒱𝒫+(zk)\mathcal{VVP}^{+}(z_{k}) is required.

Refer to caption


Figure 20: Vertices y1ky_{1}^{k} and y2ky_{2}^{k} can be guarded by an inside guard s6ks_{6}^{k}, but they are not visible from guards at s4k=p(u,zk)s_{4}^{k}=p(u,z_{k}) and s5k=p(v,zk)s_{5}^{k}=p(v,z_{k}).

Refer to caption


Figure 21: Vertices y1ky_{1}^{k} and y2ky_{2}^{k} cannot be guarded by inside guards at s4k=p(u,zk)s_{4}^{k}=p(u,z_{k}) and s5k=p(v,zk)s_{5}^{k}=p(v,z_{k}). Moreover, no single additional guard sk6s_{k}^{6} can see both of them.

Consider the other case where there exists two primary vertices zjz_{j} and zmz_{m}, where m>j>km>j>k, such that zj,zmUkz_{j},z_{m}\in U^{k}. Consider the other primary vertex zmz_{m}, where m>jm>j, such that zm𝒪𝒱𝒱+(zk)z_{m}\in\mathcal{OVV}^{+}(z_{k}). Since zjz_{j} and zmz_{m} are later primary vertices, we know that neither zjz_{j} nor zmz_{m} is visible from s6ks_{6}^{k}, s4ks_{4}^{k} or s5ks_{5}^{k}. If zjz_{j} is visible from gGoptUg\in G^{U}_{opt}, then gbdc(p(u,zj),p(v,zj))g\in bd_{c}(p(u,z_{j}),p(v,z_{j})) and g𝒱𝒱𝒫+(zj)g\in\mathcal{VVP}^{+}(z_{j}). Similarly, if zmz_{m} is visible from gg, then gbdc(p(u,zm),p(v,zm))g\in bd_{c}(p(u,z_{m}),p(v,z_{m})) and g𝒱𝒱𝒫+(zm)g\in\mathcal{VVP}^{+}(z_{m}). Now, if bdc(p(u,zj),p(v,zj))bd_{c}(p(u,z_{j}),p(v,z_{j})) and bdc(p(u,zm),p(v,zm))bd_{c}(p(u,z_{m}),p(v,z_{m})) are disjoint parts of bdc(p(u,zk),zk)bd_{c}(p(u,z_{k}),z_{k}) (see Figure 25), then gg cannot simultaneously belong to bdc(p(u,zj),p(v,zj))bd_{c}(p(u,z_{j}),p(v,z_{j})) and bdc(p(u,zm),p(v,zm))bd_{c}(p(u,z_{m}),p(v,z_{m})), and therefore needs another optimal gg^{\prime} lying on bdc(p(u,zk),zk)bd_{c}(p(u,z_{k}),z_{k}) in order to guard both. Consider the special case where p(u,zj)=p(v,zm)p(u,z_{j})=p(v,z_{m}), and so bdc(p(u,zj),p(v,zj))bd_{c}(p(u,z_{j}),p(v,z_{j})) and bdc(p(u,zm),p(v,zm))bd_{c}(p(u,z_{m}),p(v,z_{m})) are not totally disjoint (see Figure 23). In this case, if gg has to simultaneously belong to bdc(p(u,zj),p(v,zj))bd_{c}(p(u,z_{j}),p(v,z_{j})) and bdc(p(u,zj),p(v,zj))bd_{c}(p(u,z_{j}),p(v,z_{j})), then the only possibility for gg is to lie on p(u,zj)=p(v,zm)p(u,z_{j})=p(v,z_{m}). But in this case, zmz_{m} cannot be a primary vertex later, since it becomes visible from s4j=p(u,zj)s_{4}^{j}=p(u,z_{j}), and hence marked. Finally, consider the case where bdc(p(u,zm),p(v,zm))bd_{c}(p(u,z_{m}),p(v,z_{m})) is a part of bdc(p(u,zj),zj)bd_{c}(p(u,z_{j}),z_{j}) (see Figure 25). Even in this case, there exists no vertex on bdc(p(u,zm),p(v,zm))bd_{c}(p(u,z_{m}),p(v,z_{m})) which can see both zmz_{m} and zjz_{j}. Therefore, gg cannot simultaneously see both zjz_{j} and zmz_{m}. We summarize these observations in the following lemma.

Lemma 37.

If three primary vertices zkz_{k}, zjz_{j} and zmz_{m}, where k<j<mk<j<m, are such that bdc(p(u,zj),p(v,zj))bd_{c}(p(u,z_{j}),p(v,z_{j})) and bdc(p(u,zm),p(v,zm))bd_{c}(p(u,z_{m}),p(v,z_{m})) are both part of bdc(p(u,zk),zk)bd_{c}(p(u,z_{k}),z_{k}), then an optimal guard gGoptUg\in G^{U}_{opt} that sees zkz_{k} cannot also see both zjz_{j} and zmz_{m}.

Corollary 38.

Any optimal guard gGoptUg\in G^{U}_{opt} can see at most two primary vertices.

The above corollary leads to the following theorem.

Theorem 39.

For Algorithm 2, |S|6|ZU|12|GoptU||S|\leq 6\cdot|Z^{U}|\leq 12\cdot|G^{U}_{opt}|.

Algorithm 2 An 𝒪(n4)\mathcal{O}(n^{4})-algorithm for computing a guard set SS for all vertices of QUQ_{U}
1:Initialize k0k\leftarrow 0 and SS\leftarrow\emptyset
2:Initialize all vertices of QUQ_{U} as unmarked
3:Compute SPT(u)SPT(u) and SPT(v)SPT(v)
4:while  there exists an unmarked vertex in QUQ_{U} do
5:  Set kk+1k\leftarrow k+1 \triangleright Variable kk keeps count of the current iteration
6:  zkz_{k}\leftarrow the first unmarked vertex of bdc(u,v)bd_{c}(u,v) in clockwise order
7:  qzkq\leftarrow z_{k}
8:  while  qvq\neq v  do
9:   qq\leftarrow vertex next to qq in clockwise order on bdc(u,v)bd_{c}(u,v)
10:   if  qq is unmarked and l(q)l(zk)l^{\prime}(q)\prec l^{\prime}(z_{k})  then
11:     zkqz_{k}\leftarrow q \triangleright Update zkz_{k} to qq whenever qq is unmarked and l(q)l(zk)l^{\prime}(q)\prec l^{\prime}(z_{k})
12:   end if
13:  end while\triangleright Variable zkz_{k} is now the primary vertex for the current iteration
14:  s4kp(u,zk)s_{4}^{k}\leftarrow p(u,z_{k}), s5kp(v,zk)s_{5}^{k}\leftarrow p(v,z_{k}), Sk{s4k,s5k}S^{k}\leftarrow\{s_{4}^{k},s_{5}^{k}\} \triangleright See Figures 21 and 21
15:  Mark all vertices of QUQ_{U} visible from guards currently in SkS^{k}
16:  Compute the ordered set 𝒪𝒱𝒱+(zk)={y1k,y2k,,yn(k)k}\mathcal{OVV}^{+}(z_{k})=\{y^{k}_{1},y^{k}_{2},\ldots,y^{k}_{n(k)}\}
17:  if  𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k})\neq\emptyset  then
18:   if  𝒞(𝒪𝒱𝒱+(zk))\mathcal{CI}(\mathcal{OVV}^{+}(z_{k}))\neq\emptyset  then
19:     s6ks_{6}^{k}\leftarrow any vertex of 𝒞(𝒪𝒱𝒱+(zk))\mathcal{CI}(\mathcal{OVV}^{+}(z_{k})) \triangleright See Figure 21
20:   else\triangleright where 𝒞(𝒪𝒱𝒱+(zk))=\mathcal{CI}(\mathcal{OVV}^{+}(z_{k}))=\emptyset \triangleright See Figure 21
21:     qp(u,zk)q\leftarrow p(u,z_{k}), VSF=VSF=\emptyset
22:     while  (qzkq\neq z_{k}) and every vertex of VSFVSF is visible from qq  do
23:      s6kqs_{6}^{k}\leftarrow q
24:      qq\leftarrow vertex of 𝒱𝒱𝒫+(zk)\mathcal{VVP}^{+}(z_{k}) next to qq in clockwise order on bdc(u,v)bd_{c}(u,v)
25:      VSFVSF(𝒱𝒫(s6k)𝒪𝒱𝒱+(zk))VSF\leftarrow VSF\cup(\mathcal{VP}(s_{6}^{k})\cap\mathcal{OVV}^{+}(z_{k})) \triangleright See Figures 23, 25 and 25
26:     end while
27:   end if
28:   SkSk{s6k}S^{k}\leftarrow S^{k}\cup\{s_{6}^{k}\}
29:  end if
30:  Mark all vertices of QUQ_{U} visible from guards currently in SkS^{k}
31:  Compute the ordered set 𝒪𝒱𝒱(zk)={x1k,x2k,,xm(k)k}\mathcal{OVV}^{-}(z_{k})=\{x^{k}_{1},x^{k}_{2},\ldots,x^{k}_{m(k)}\}
32:  Partition 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) into the sets AkA^{k}, BkB^{k} and CkC^{k}
33:  Compute s1ks_{1}^{k}, s2ks_{2}^{k}, and s3ks_{3}^{k} as per Algorithm 1
34:  SkSk{s1k,s2k,s3k}S^{k}\leftarrow S^{k}\cup\{s_{1}^{k},s_{2}^{k},s_{3}^{k}\}
35:  Mark all vertices of QUQ_{U} visible from guards currently in SkS^{k}
36:  SSSkS\leftarrow S\cup S^{k}
37:end while
38:return the guard set SS
Theorem 40.

For Algorithm 2, |S|6|Z|12|Gopt||S|\leq 6\cdot|Z|\leq 12\cdot|G_{opt}|.

Proof.

From Theorem 35, we know that |ZL|2|GoptL||Z^{L}|\leq 2\cdot|G^{L}_{opt}|. Similarly, from Theorem 39, we know that |ZU|2|GoptU||Z^{U}|\leq 2\cdot|G^{U}_{opt}|. Further, we know that a maximum of 6 vertex guards, viz. s1ks_{1}^{k}, s2ks_{2}^{k}, s3ks_{3}^{k}, s4ks_{4}^{k}, s5ks_{5}^{k} and s6ks_{6}^{k}, are chosen for each primary vertex zkZz_{k}\in Z, and so |S|6|Z||S|\leq 6\cdot|Z|. Combining all the above inequalities, we obtain: |S|6|Z|6(|ZU|+|ZL|)12(|GoptU|+|GoptL|)12|Gopt||S|\leq 6\cdot|Z|\leq 6\cdot(|Z^{U}|+|Z^{L}|)\leq 12\cdot(|G^{U}_{opt}|+|G^{L}_{opt}|)\leq 12\cdot|G_{opt}|

Refer to caption

Figure 22: The guard s6ks_{6}^{k} is placed at the farthest vertex from p(u,zk)p(u,z_{k}) beyond which it cannot move without losing the visibility of y2k𝒪𝒱𝒱+(zk)y_{2}^{k}\in\mathcal{OVV}^{+}(z_{k}).

Refer to caption

Figure 23: The two boundaries bdc(p(u,zm),p(v,zm))bd_{c}(p(u,z_{m}),p(v,z_{m})) and bdc(p(u,zj),p(v,zj))bd_{c}(p(u,z_{j}),p(v,z_{j})), that are both a part of bdc(p(u,zk),zk)bd_{c}(p(u,z_{k}),z_{k}), share only one vertex p(u,zj)=p(v,zm)=g=s4jp(u,z_{j})=p(v,z_{m})=g=s_{4}^{j}.

Refer to caption

Figure 24: Boundaries bdc(p(u,zm),p(v,zm))bd_{c}(p(u,z_{m}),p(v,z_{m})) & bdc(p(u,zj),p(v,zj))bd_{c}(p(u,z_{j}),p(v,z_{j})) are disjoint parts of bdc(p(u,zk),zk)bd_{c}(p(u,z_{k}),z_{k}).

Refer to caption

Figure 25: Boundary bdc(p(u,zm),p(v,zm))bd_{c}(p(u,z_{m}),p(v,z_{m})) is contained in bdc(p(u,zj),p(v,zj))bd_{c}(p(u,z_{j}),p(v,z_{j})), which in turn is contained in bdc(p(u,zk),zk)bd_{c}(p(u,z_{k}),z_{k}).
Theorem 41.

The running time for Algorithm 2 is 𝒪(n4)\mathcal{O}(n^{4}).

Proof.

While executing Algorithm 2 as stated, we need to precompute SPT(u)SPT(u) and SPT(v)SPT(v) respectively. Also, for every vertex zz belonging to QUQ_{U}, we need to precompute 𝒱𝒱𝒫+(z)\mathcal{VVP}^{+}(z), 𝒱𝒱𝒫(z)\mathcal{VVP}^{-}(z), which we can do by constructing the visibility graph of zz in 𝒪(n2)\mathcal{O}(n^{2}) using the algorithm by Ghosh and Mount [16]. Note that 𝒪(n)\mathcal{O}(n) vertices are chosen in total. Therefore, in order to get the overall running time for Algorithm 2, let us consider the running times for all the operations performed by Algorithm 2 in the outer while-loop corresponding to each primary vertex zkZz_{k}\in Z.

Since SPT(u)SPT(u) and SPT(v)SPT(v) are precomputed, it takes only 𝒪(1)\mathcal{O}(1) time to choose the guards s4k=p(u,zk)s_{4}^{k}=p(u,z_{k}) and s5k=p(v,zk)s_{5}^{k}=p(v,z_{k}). For choosing the guard s6ks_{6}^{k}, it is required to compute 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}) and then 𝒞(𝒪𝒱𝒱+(zk))\mathcal{CI}(\mathcal{OVV}^{+}(z_{k})). The former operation takes 𝒪(n2)\mathcal{O}(n^{2}) time, since 𝒱𝒱𝒫+(z)\mathcal{VVP}^{+}(z) is precomputed. For the latter operation, it is required to compute |𝒪𝒱𝒱+(zk)|=𝒪(n)|\mathcal{OVV}^{+}(z_{k})|=\mathcal{O}(n) intersections, and since each intersection takes 𝒪(n2)\mathcal{O}(n^{2}) time, the total time required for the operation is 𝒪(n3)\mathcal{O}(n^{3}). If 𝒞(𝒪𝒱𝒱+(zk))\mathcal{CI}(\mathcal{OVV}^{+}(z_{k})) is non-empty, then the choice of s6ks_{6}^{k} requires only 𝒪(1)\mathcal{O}(1) additional time. Otherwise, the choice of s6ks_{6}^{k} requires a linear scan along bdc(u,v)bd_{c}(u,v), which takes 𝒪(n)\mathcal{O}(n) time. Since 𝒱𝒱𝒫(z)\mathcal{VVP}^{-}(z) is precomputed, it takes only 𝒪(1)\mathcal{O}(1) time to choose the guard s3k=l(zk)s_{3}^{k}=l(z_{k}). However, for choosing the guards s1ks_{1}^{k} and s2ks_{2}^{k}, it is required to compute 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}), which takes 𝒪(n)\mathcal{O}(n) time, and then partition 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) into the sets AkA^{k}, BkB^{k} and CkC^{k}, which takes a further 𝒪(n2)\mathcal{O}(n^{2}) amount of time. Finally, the the choice of s1ks_{1}^{k} (and similarly s2ks_{2}^{k}) requires a linear scan along bdcc(u,v)bd_{cc}(u,v), which takes 𝒪(n)\mathcal{O}(n) time.

From the discussion above, it is clear that all the operations corresponding to a single primary vertex zkZz_{k}\in Z are completed by Algorithm 2 in 𝒪(n3)\mathcal{O}(n^{3}) time in the worst case. Since at most 𝒪(n)\mathcal{O}(n) primary vertices are chosen, the overall worst case running time of Algorithm 2 is 𝒪(n4)\mathcal{O}(n^{4}). ∎

5.5 Guarding all interior points of a polygon

In the previous subsection, we have presented an algorithm (see Algorithm 2) that returns a guard set SS such that all vertices of QUQ_{U} are visible from guards in SS. Recall that the art gallery problem demands that SS must see all interior points of QUQ_{U} as well. However, it may not always be true that the guards in SS see all interior points of QUQ_{U}. Consider the polygon shown in Figure 27. Assume that Algorithm 2 places guards at p(u,zk)p(u,z_{k}) and p(v,zk)p(v,z_{k}), and all vertices of bdc(p(u,zk),p(v,zk))bd_{c}(p(u,z_{k}),p(v,z_{k})) become visible from p(u,zk)p(u,z_{k}) or p(v,zk)p(v,z_{k}). However, the triangular region QU(VP(p(u,zk)))VP(p(v,zk))Q_{U}\setminus(VP(p(u,z_{k})))\cup VP(p(v,z_{k})), bounded by the segments x1x2x_{1}x_{2}, x2x3x_{2}x_{3} and x3x1x_{3}x_{1}, is not visible from p(u,zk)p(u,z_{k}) or p(v,zk)p(v,z_{k}). Also, one of the sides x1x2x_{1}x_{2} of the triangle x1x2x3x_{1}x_{2}x_{3} is a part of the polygonal edge a1a2a_{1}a_{2}.

Suppose there exists another guard gg lying on bdc(p(u,zk),p(v,zk))bd_{c}(p(u,z_{k}),p(v,z_{k})) (see Figure 27) that sees the part of the triangle x1x2x3x_{1}x_{2}x_{3} containing the side x1x2x_{1}x_{2}, but does not see the other part containing x3x_{3}. In that case, such a vertex gg cannot be weakly visible from uvuv, which is a contradiction. Hence, for any such region invisible from guards s4k,s5kSks_{4}^{k},s_{5}^{k}\in S^{k} corresponding to some zkZz_{k}\in Z, henceforth referred to as an invisible cell, one of the sides must always be a part of a polygonal edge. The polygonal edge which contributes as a side to the invisible cell is referred to as its corresponding partially invisible edge.

Observe that s4ks_{4}^{k} and s5ks_{5}^{k} can in fact create several invisible cells, as shown in Figure 27. Each invisible cell must be wholly contained within the intersection region (which is a triangle) of a left pocket and a right pocket. For example, in Figure 27, the invisible cell x1x2x3x_{1}x_{2}x_{3} is actually the entire intersection region of the left pocket of VP(s4k)VP(s_{4}^{k}) and the right pocket of VP(s5k)VP(s_{5}^{k}). In general, where VP(s4k)VP(s_{4}^{k}) has several left pockets and VP(s5k)VP(s_{5}^{k}) has several right pockets which intersect pairwise to create multiple invisible cells (as shown in Figure 27), every such cell can be seen by placing guards on the common vertices between adjacent pairs of cells. Further, if GoptG_{opt} is also constrained to guard these invisible cells using only inward guards from QUQ_{U}, then the number of such additional guards required can be at most twice of GoptG_{opt}, as shown by Bhattacharya et al. [4]. However, in the absence of any constraint on placing guards, GoptG_{opt} may place an outside guard in QLQ_{L} that sees several such invisible cells. So, it is natural to explore the possibility of being able to guard all such invisible cells by using additional guards from QLQ_{L}, in combination with guards from QUQ_{U}.

We present a modified algorithm that ensures that all partially invisible edges are guarded completely, and therefore the entire bdc(u,v)bd_{c}(u,v) is guarded. For every pair of visible vertices in QQ, extend the visible segment connecting them till they intersect the boundary of QUQ_{U}. These intersection points partition the boundary of QUQ_{U} into distinct intervals called minimal visible intervals. We have the following lemmas.

Lemma 42.

Every minimal visible interval on the boundary of QUQ_{U} is either entirely visible from a vertex or totally not visible from that vertex.

Proof.

Let abab be a minimal visible interval. If abab is partially visible from a vertex gg, then there must exist another vertex gg^{\prime} such that the extension of the segment gggg^{\prime} intersects abab at some point, which contradicts the fact that abab is a minimal visible interval. ∎

Corollary 43.

If a minimal visible interval abab is entirely visible from a vertex gg of QQ, then the entire triangle gabgab lies totally inside QQ.

The modified Algorithm 3 first computes all minimal visible intervals and chooses one internal representative point from each minimal visible interval on the boundary of QUQ_{U}. These representative points are referred to as pseudo-vertices. Alongside the original polygonal vertices of QQ, all pseudo-vertices are introduced on the boundary of QUQ_{U}, and the modified polygon is denoted by QQ^{\prime}. Note that the endpoints of minimal visible intervals are not introduced in QQ^{\prime}. In Algorithm 3, the pseudo-vertices of QQ^{\prime} are treated in almost the same manner as the original vertices. We compute 𝒱𝒱𝒫+(z)\mathcal{VVP}^{+}(z) and 𝒱𝒱𝒫(z)\mathcal{VVP}^{-}(z) for all vertices of QQ^{\prime}, irrespective of whether it is a pseudo-vertex, and some of the psuedo-vertices may even be chosen as primary vertices. However, while computing 𝒱𝒱𝒫+(z)\mathcal{VVP}^{+}(z) for any vertex zz of QQ^{\prime}, no pseudo-vertices are included in 𝒱𝒱𝒫+(z)\mathcal{VVP}^{+}(z), since they cannot be vertex guards in any case.

Algorithm 3 An 𝒪(n5)\mathcal{O}(n^{5})-algorithm for computing a guard set SS for all vertices of QUQ_{U}
1:Initialize k0k\leftarrow 0 and SS\leftarrow\emptyset
2:Compute SPT(u)SPT(u) and SPT(v)SPT(v)
3:Compute all minimal visible intervals on boundary of QUQ_{U}
4:Introduce representative points from each minimal visible interval as pseudo-vertices
5:Initialize all vertices and pseudo-vertices of QUQ_{U} as unmarked
6:while  there exists an unmarked vertex or pseudo-vertex on QUQ_{U} do
7:  Set kk+1k\leftarrow k+1
8:  Choose the current primary vertex zkz_{k} as per Algorithm 2
9:  s4kp(u,zk)s_{4}^{k}\leftarrow p(u,z_{k}), s5kp(v,zk)s_{5}^{k}\leftarrow p(v,z_{k}), Sk{s4k,s5k}S^{k}\leftarrow\{s_{4}^{k},s_{5}^{k}\}
10:  Choose the inside guard s6ks_{6}^{k} (if required) as per Algorithm 2
11:  SkSk{s6k}S^{k}\leftarrow S^{k}\cup\{s_{6}^{k}\}
12:  Compute s1ks_{1}^{k}, s2ks_{2}^{k}, and s3ks_{3}^{k} as per Algorithm 1
13:  SkSk{s1k,s2k,s3k}S^{k}\leftarrow S^{k}\cup\{s_{1}^{k},s_{2}^{k},s_{3}^{k}\}
14:  Mark all vertices of QUQ_{U} visible from guards currently in SkS^{k}
15:  SSSkS\leftarrow S\cup S^{k}
16:end while
17:return the guard set SS

Suppose an invisible cell is created by the guards placed on the parents of some primary vertex. This implies that there exists a pseudo-vertex on the partially invisible edge contained in the invisible cell which has been left unmarked. So, either this pseudo-vertex is marked due to the guards chosen for some later primary vertex, or else it is eventually chosen as a primary vertex itself. If a pseudo-vertex on a partially invisible edge is chosen as a primary vertex zkz_{k} by Algorithm 3, then the entire invisible cell containing the partially invisible edge must be visible from s4ks_{4}^{k} and s5ks_{5}^{k}. Moreover, if the adjacent invisible cell to the left or right shares a parent, then s4ks_{4}^{k} or s5ks_{5}^{k} also sees both invisible cells. Therefore, if all invisible cells are guarded by guards in GoptUG^{U}_{opt}, then the number of pseudo-vertices that are chosen as primary vertices is at most twice of the number of guards in GoptUG^{U}_{opt} [4].

Observe that several invisible cells may be seen by a few outside guards belonging to GoptLG^{L}_{opt}, unlike GoptUG^{U}_{opt} which can see only two such cells at the most. Assume that a pseudo-vertex is chosen as a primary vertex zkz_{k}. Every vertex and pseudo-vertex belonging to BkB^{k} is marked due to the placement of the guard at s3ks_{3}^{k}, and therefore no additional guards are introduced for guarding the vertices or pseudo-vertices in BkB^{k}. Consider the outside guards introduced due to AkA^{k}. Assume that AkA^{k} has pseudo-vertices. If LkL^{k} does not have pseudo-vertices, then the pseudo-vertices do not create new disjoint right pockets, and therefore guards placed to guard vertices of LkL^{k} are enough to guard pseudo-vertices in AkA^{k}. If LkL^{k} contains a pseudo-vertex, then a new disjoint right pocket is created, and therefore guards placed for other disjoint right pockets cannot see this pseudo-vertex. So, an additional outside guard is required, as well as an additional optimal guard in GoptLG^{L}_{opt}. The same argument holds for CkC^{k} and RkR^{k}. Thus Lemmas 16 to 34, Lemma 37 and Corollary 38, and Theorems 35 and 39 hold even after the introduction of pseudo-vertices, and so the overall bound remains |S|12|Gopt||S|\leq 12\cdot|G_{opt}|, as in Theorem 40. We state this result in Theorem 44.

Theorem 44.

For the guard set SS computed by Algorithm 3, |S|6|Z|12|Gopt||S|\leq 6\cdot|Z|\leq 12\cdot|G_{opt}|.

Theorem 45.

The running time of Algorithm 3 is 𝒪(n5)\mathcal{O}(n^{5}).

Proof.

While executing Algorithm 3 as stated, the precomputation of SPT(u)SPT(u) and SPT(v)SPT(v) requires 𝒪(n2)\mathcal{O}(n^{2}) time as the number of pseudo-vertices is 𝒪(n2)\mathcal{O}(n^{2}). Also, for every vertex (or pseudo-vertex) zz belonging to QQ^{\prime}, the precomputation of 𝒱𝒱𝒫+(z)\mathcal{VVP}^{+}(z) and 𝒱𝒱𝒫(z)\mathcal{VVP}^{-}(z) can be done by constructing the visibility graph using the output-sensitive algorithm of Ghosh and Mount [16]. Since the total number of vertices (including pseudo-vertices) in QQ^{\prime} is 𝒪(n2)\mathcal{O}(n^{2}), and the visibility edges are not computed between pseudo-vertices, the size of the visibility graph for QQ^{\prime} is 𝒪(n3)\mathcal{O}(n^{3}), and thus 𝒪(n3)\mathcal{O}(n^{3}) time is required to precompute 𝒱𝒱𝒫+(z)\mathcal{VVP}^{+}(z) and 𝒱𝒱𝒫(z)\mathcal{VVP}^{-}(z). Note that, while each of the original vertices of QUQ_{U} may be chosen as primary vertices, only at most one of the pseudo-vertices belonging to a single edge may be chosen as a primary vertex, which means that there can be at most 2n=𝒪(n)2n=\mathcal{O}(n) primary vertices chosen by Algorithm 3. Therefore, in order to get the overall running time for Algorithm 2, let us consider the running times for all the operations performed by Algorithm 2 in the outer while-loop (see lines …) corresponding to each primary vertex zkZz_{k}\in Z.

Since SPT(u)SPT(u) and SPT(v)SPT(v) are precomputed, it takes only 𝒪(1)\mathcal{O}(1) time to choose the guards s4k=p(u,zk)s_{4}^{k}=p(u,z_{k}) and s5k=p(v,zk)s_{5}^{k}=p(v,z_{k}). For choosing the guard s6ks_{6}^{k}, it is necessary to compute 𝒪𝒱𝒱+(zk)\mathcal{OVV}^{+}(z_{k}) and then 𝒞(𝒪𝒱𝒱+(zk))\mathcal{CI}(\mathcal{OVV}^{+}(z_{k})). The former operation takes 𝒪(n2)\mathcal{O}(n^{2}) time, since 𝒱𝒱𝒫+(z)\mathcal{VVP}^{+}(z) is precomputed. For the latter operation, |𝒪𝒱𝒱+(zk)|=𝒪(n2)|\mathcal{OVV}^{+}(z_{k})|=\mathcal{O}(n^{2}) intersections are computed; since each intersection takes 𝒪(n2)\mathcal{O}(n^{2}) time, the total time required for the operation is 𝒪(n4)\mathcal{O}(n^{4}). If 𝒞(𝒪𝒱𝒱+(zk))\mathcal{CI}(\mathcal{OVV}^{+}(z_{k})) is non-empty, then the choice of s6ks_{6}^{k} requires only 𝒪(1)\mathcal{O}(1) additional time. Otherwise, the choice of s6ks_{6}^{k} requires a linear scan along bdc(u,v)bd_{c}(u,v), which takes 𝒪(n2)\mathcal{O}(n^{2}) time. Since 𝒱𝒱𝒫(z)\mathcal{VVP}^{-}(z) is precomputed, it takes only 𝒪(1)\mathcal{O}(1) time to choose the guard s3k=l(zk)s_{3}^{k}=l(z_{k}). However, for choosing the guards s1ks_{1}^{k} and s2ks_{2}^{k}, it is required to compute 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}), which takes 𝒪(n)\mathcal{O}(n) time, and then the partition of 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) into the sets AkA^{k}, BkB^{k} and CkC^{k} requires a further 𝒪(n3)\mathcal{O}(n^{3}) amount of time. Finally, the the choice of s1ks_{1}^{k} (and similarly s2ks_{2}^{k}) requires a linear scan along bdcc(u,v)bd_{cc}(u,v), which takes 𝒪(n2)\mathcal{O}(n^{2}) time.

From the discussion above, it is clear that all the operations corresponding to a single primary vertex zkZz_{k}\in Z are completed by Algorithm 2 in 𝒪(n4)\mathcal{O}(n^{4}) time in the worst case, and since at most 𝒪(n)\mathcal{O}(n) primary vertices are chosen, the overall worst case running time of Algorithm 2 is 𝒪(n5)\mathcal{O}(n^{5}). ∎

Refer to caption

Figure 26: All vertices are visible from p(u,zk)p(u,z_{k}) or p(v,zk)p(v,z_{k}), but the triangle x1x2x3x_{1}x_{2}x_{3} is invisible.

Refer to caption

Figure 27: Multiple invisible cells exist within the polygon that are not visible from the guards placed at p(u,zk)p(u,z_{k}) and p(v,zk)p(v,z_{k}).

Algorithm 3 chooses a guard set SS that ensures no partially invisible edge in QUQ_{U}. However, there is no guarantee that SS sees the entire interior of QUQ_{U}, as there may remain residual invisible cells in the interior of QUQ_{U} (see Figure 29). Consider a residual invisible cell that is a part of an invisible cell x1x2x3x_{1}x_{2}x_{3}, where x1x2x_{1}x_{2} is contained in a partially invisible edge. For such a residual invisible cell, there exists a pseudo-vertex on x1x2x_{1}x_{2} whose parents can see the entire cell x1x2x3x_{1}x_{2}x_{3}, as discussed earlier in the context of placing inside guards for guarding entire visibility cell. So, placing a guard at an appropriate parent, such as zkz_{k} in Figure 29, guarantees that the residual invisible cell is totally visible. Since such an additional inside guard on QUQ_{U} corresponds to an unique outward guard in QLQ_{L}, the additional number of inside guards can be at most the number of outside guards. This amounts to placing at most (3+3)=6 inside guards and 3 outside guards corresponding to each primary vertex, while the number of primary vertices chosen remains at most 2|Gopt|2\cdot|G_{opt}|. We summarize the result in the following theorem.

Theorem 46.

Let QQ be a polygon of nn vertices that is weakly visible from an internal chord uvuv. Then, a vertex guard set SS can be computed in 𝒪(n5)\mathcal{O}(n^{5}) time, and |S|18×|Gopt||S|\leq 18\times|G_{opt}|, where GoptG_{opt} is a an optimal vertex guard cover for the entire boundary of PP.

6 Final Results

In Section 5, we have presented an approximation algorithm for guarding a polygon QQ weakly visible from a chord uvuv. This algorithm chooses primary vertices zkz_{k} according to the ordering of their last visible point l(zk)l^{\prime}(z_{k}). So the algorithm does not depend on a chord of the weak visibility polygon. Therefore, if this algorithm is executed on the union of overlapping weak visibility polygons QQ, then it chooses primary vertices in the same way irrespective of chords in QQ, producing a guard set that sees the entire union QQ. So, if this algorithm is used for every overlapping weak visibility polygon in PP, then the entire polygon PP can be guarded by the union of the guard sets produced for guarding these overlapping weak visibility polygons. Note that there is no increase in running time for this overall algorithm, since each vertex can appear in at most 2 weak visibility polygons from the hierarchy WW.

Let gGoptg\in G_{opt} be an optimal guard in Vi,jV_{i,j}. It can be seen that gg is either a guard in GoptUG^{U}_{opt} in the weak visibility polygon QQ whose chord uvuv is the constructed edge between Vi,jV_{i,j} and its parent (say Vi1,jV_{i-1,j^{\prime}}), or a guard in GoptLG^{L}_{opt} for the overlapping weak visibility polygon QQ^{\prime} whose chords are constructed edges that separate Vi,jV_{i,j} from its children. Let gQQg\in Q\cap Q^{\prime}. So gg is a guard in GoptLG^{L}_{opt} in QQ^{\prime} or a guard in GoptUG^{U}_{opt} in QQ. Consider the case where gg belongs to GoptLG^{L}_{opt} in QQ^{\prime}. Observe that all vertices of QUQ_{U}^{\prime} that are visible from any such gGoptLg\in G^{L}_{opt} in QQ^{\prime} are guarded by s1ks_{1}^{k}, s2ks_{2}^{k}, s3ks_{3}^{k} for all primary vertices zkQUz_{k}\in Q_{U}^{\prime}. Therefore, the approximation bound for Algorithm 3 run on QQ^{\prime} does not change in this case.

Refer to caption

Figure 28: Two outside guards gg and gg^{\prime} can create a residual invisible cell that is a part of the triangle x1x2x3x_{1}x_{2}x_{3}.

Refer to caption

Figure 29: The vertex yQLQUy\in Q_{L}\cap Q_{U}^{\prime} is visible from gGoptUg\in G^{U}_{opt} in QUQ_{U}, but it is not visible from any of the guards s31s_{3}^{1}, s41s_{4}^{1}, s51s_{5}^{1}, s32s_{3}^{2}, s42s_{4}^{2} or s52s_{5}^{2} placed in QQ.

Consider the other case where gGoptUg\in G^{U}_{opt} in QQ. Observe that all vertices of QUQ_{U} that are visible from any such gGoptUg\in G^{U}_{opt} in QQ are guarded by s4ks_{4}^{k}, s5ks_{5}^{k}, s6ks_{6}^{k} for all primary vertices zkQUz_{k}\in Q_{U}. However, all vertices of QLQ_{L} that are visible from any such gGoptUg\in G^{U}_{opt} in QQ may not necessarily be guarded by s1ks_{1}^{k}, s2ks_{2}^{k}, s3ks_{3}^{k},s4ks_{4}^{k}, s5ks_{5}^{k}, s6ks_{6}^{k} for all primary vertices zkQUz_{k}\in Q_{U} (see Figure 29), since the guards chosen by Algorithm 3 are not meant for guarding vertices in QLQ_{L}.

Let yQLQUy\in Q_{L}\cap Q_{U}^{\prime} be a vertex that is visible from gGoptUg\in G^{U}_{opt} on QQ, but not visible from any of the guards placed in QQ by Algorithm 3. Since yy remains unmarked, yy can be chosen as a primary vertex during the execution of 3 on QQ^{\prime}. Then, the guards placed on the parents see not only yy, but also see all other such vertices yy^{\prime} visible from gg (see Figure 29) due to cross-visibility across two adjacent weak visibility polygons in the partition hierarchy WW. So, this amounts to choosing an extra primary vertex in QQ, and thus the number of primary vertices visible from gQoptUg\in Q^{U}_{opt} also increases by at most 1. Since there could be at most one extra primary corresponding to every gGoptUg\in G^{U}_{opt}, for counting purposes, we can attribute these to QUQ_{U} as an extra primary vertex. So, |Z|2|Gopt||Z|\leq 2\cdot|G_{opt}| is replaced by |Z|3|Gopt||Z|\leq 3\cdot|G_{opt}| in our bound for all such QU=Vi,jQ_{U}=V_{i,j}. We have the following results.

Theorem 47.

Let PP be a simple polygon of nn vertices. Then, a vertex guard set SS for guarding all vertices of PP can be computed in 𝒪(n4)\mathcal{O}(n^{4}) time, and |S|18×|Gopt||S|\leq 18\times|G_{opt}|, where GoptG_{opt} is a an optimal vertex guard cover for all vertices of PP.

Theorem 48.

Let PP be a simple polygon of nn vertices. Then, a vertex guard set SS for guarding the entire boundary of PP can be computed in 𝒪(n5)\mathcal{O}(n^{5}) time, and |S|18×|Gopt||S|\leq 18\times|G_{opt}|, where GoptG_{opt} is a an optimal vertex guard cover for the entire boundary of PP.

Theorem 49.

Let PP be a simple polygon of nn vertices. Then, a vertex guard set SS for guarding interior and boundary points of PP can be computed in 𝒪(n5)\mathcal{O}(n^{5}) time, and |S|27×|Gopt||S|\leq 27\times|G_{opt}|, where GoptG_{opt} is a an optimal vertex guard cover for the entire interior and boundary of PP.

7 Algorithms for Polygon Guarding using Edge Guards

Let us consider a slightly different version of the art gallery problem, where edge guards rather than vertex guards are used for guarding a simple nn-sided polygon PP. The hierarchical partitioning method used is almost exactly the same as Algorithm 1 (presented in Section 3), where we guard the polygon using vertex guards. While using edge guards instead, the only modification to Algorithm 1 is that now we initially choose an arbitrary edge v1v2v_{1}v_{2} instead of a vertex, and compute V1,1=𝒱𝒫(v1v2)V_{1,1}=\mathcal{VP}(v_{1}v_{2}) (compare with Lines 1-2 of Algorithm 1). As before, each weak visibility polygon in the hierarchy is used to generate one weak visibility polygon in the next level corresponding to each of its constructed edges.

As discussed in Section 5, let QQ denote a simple polygon that is weakly visible from an internal chord uvuv, i.e. we have 𝒱𝒫(uv)=Q\mathcal{VP}(uv)=Q, and observe that the chord uvuv similarly splits QQ into two sub-polygons QUQ_{U} and QLQ_{L}. Suppose we wish to guard an arbitrary vertex zz of QUQ_{U} using an edge guard. Then, a guard must be placed at an edge of QQ that belongs fully or even partially to 𝒱𝒫(z)\mathcal{VP}(z). Henceforth, let 𝒱𝒫(z)\mathcal{EVP}(z) denote the set of all polygonal edges that contain at least one point belonging to 𝒱𝒫(z)\mathcal{VP}(z). Further, let us define the inward visible edges and the outward visible edges of zz, denoted by 𝒱𝒫+(z)\mathcal{EVP}^{+}(z) and 𝒱𝒫(z)\mathcal{EVP}^{-}(z) respectively, as follows.

𝒱𝒫+(z)={e𝒱𝒫(z)\mathcal{EVP}^{+}(z)=\{e\in\mathcal{EVP}(z): for any point xex\in e, the segment zxzx does not intersect uvuv}

𝒱𝒫(z)={e𝒱𝒫(z)\mathcal{EVP}^{-}(z)=\{e\in\mathcal{EVP}(z) : for any point xex\in e, the segment zxzx intersects uvuv}

We shall henceforth refer to the vertex guards belonging to 𝒱𝒫+(z)\mathcal{EVP}^{+}(z) and 𝒱𝒫(z)\mathcal{EVP}^{-}(z) as inside guards and outside guards for zz respectively.

Observe that, for any vertex zkZz_{k}\in Z, both 𝒱𝒫+(zk)\mathcal{EVP}^{+}(z_{k}) and 𝒱𝒫(zk)\mathcal{EVP}^{-}(z_{k}) may be considered to be ordered sets by taking into account the natural ordering of the visible edges of QQ in clockwise order along bdc(u,v)bd_{c}(u,v) and in counter-clockwise order along bdcc(u,v)bd_{cc}(u,v) respectively. Let us denote the first visible edge and the last visible edge belonging to the ordered set 𝒱𝒫(zk)\mathcal{EVP}^{-}(z_{k}) by f(zk)f(z_{k}) and l(zk)l(z_{k}) respectively (see Figure 9). Also, we denote by l(zk)l^{\prime}(z_{k}) the last visible point from zkz_{k}, which is obtained by extending the ray zkp(v,zk)\overrightarrow{z_{k}p(v,z_{k})} till it touches bdcc(u,v)bd_{cc}(u,v).

As in Section 5, our algorithm selects a subset ZZ of vertices of QUQ_{U}, and places a fixed number of both inside and outside edge guards corresponding to each of them, so that these edge guards together see the entire QUQ_{U}. As before, we refer to this subset of special vertices as primary vertices, and denote it by ZZ. Moreover, the choice of primary vertices is also made in a manner identical to that discussed in Section 5.

Once again, a natural idea is to place outside edge guards in a greedy manner so that they lie in the common intersection of outward visible edges of as many vertices of QUQ_{U} as possible. For any primary vertex zkz_{k}, let us denote by 𝒪𝒱(zk)\mathcal{OEV}^{-}(z_{k}) the set of unmarked vertices of QUQ_{U} whose outward visible edges overlap with those of zkz_{k}. In other words,

𝒪𝒱(zk)={x𝒱(QU): x is unmarked, and 𝒱𝒫(zk)𝒱𝒫(x)}\mathcal{OEV}^{-}(z_{k})=\{x\in\mathcal{V}(Q_{U}):\mbox{ $x$ is unmarked, and }\mathcal{EVP}^{-}(z_{k})\cap\mathcal{EVP}^{-}(x)\neq\emptyset\}

So, each vertex of QUQ_{U} belonging to 𝒪𝒱(zk)\mathcal{OEV}^{-}(z_{k}) is visible from at least one edge of 𝒱𝒫(zk)\mathcal{EVP}^{-}(z_{k}). Further, 𝒪𝒱(zk)\mathcal{OEV}^{-}(z_{k}) can be considered to be an ordered set, where for any pair of elements x1,x2𝒪𝒱(zk)x_{1},x_{2}\in\mathcal{OEV}^{-}(z_{k}), we define x1x2x_{1}\prec x_{2} if and only if l(x1)l^{\prime}(x_{1}) precedes l(x2)l^{\prime}(x_{2}) in counter-clockwise order on bdcc(u,v)bd_{cc}(u,v). For the current primary vertex zkz_{k}, let us assume without loss of generality that 𝒪𝒱(zk)={x1k,x2k,x3k,xm(k)k}\mathcal{OEV}^{-}(z_{k})=\{x^{k}_{1},x^{k}_{2},x^{k}_{3},\dots\,x^{k}_{m(k)}\} such that l(x1k)l(x2k)l(xm(k)k)l^{\prime}(x^{k}_{1})\prec l^{\prime}(x^{k}_{2})\prec\dots\prec l^{\prime}(x^{k}_{m(k)}) in counter-clockwise order on bdcc(u,v)bd_{cc}(u,v).

Just as we partitioned 𝒪𝒱𝒱(zk)\mathcal{OVV}^{-}(z_{k}) while guarding the polygon using vertex guards, let us partition the vertices belonging to 𝒪𝒱(zk)\mathcal{OEV}^{-}(z_{k}) into 3 sets, viz. AkA^{k}, BkB^{k} and CkC^{k}, in the following manner. Consider any vertex xik𝒪𝒱(zk)x^{k}_{i}\in\mathcal{OEV}^{-}(z_{k}), such that 𝒱𝒫(xik)\mathcal{EVP}^{-}(x^{k}_{i}) creates a constructed edge t(xik)t(xik)t(x^{k}_{i})t^{\prime}(x^{k}_{i}), where t(xik)𝒱(QL)t(x^{k}_{i})\in\mathcal{V}(Q_{L}) is a polygonal vertex and t(xik)t^{\prime}(x^{k}_{i}) is the point where xikt(xik)\overrightarrow{x^{k}_{i}t(x^{k}_{i})} first intersects bdcc(u,v)bd_{cc}(u,v). Every vertex of 𝒪𝒱(zk)\mathcal{OEV}^{-}(z_{k}) visible from l(zk)l(z_{k}) is included in BkB^{k}. Observe that, by definition zkBkz^{k}\in B^{k}. Obviously, for each vertex xik𝒪𝒱(zk)Bkx^{k}_{i}\in\mathcal{OEV}^{-}(z_{k})\setminus B^{k}, xikx^{k}_{i} is not visible from l(zk)l(z_{k}) due to the presence of some constructed edge. The vertices of 𝒪𝒱(zk)Bk\mathcal{OEV}^{-}(z_{k})\setminus B^{k} are categorized into AkA^{k} and CkC^{k} based on whether this constructed edge creates a right pocket or a left pocket. Suppose xik𝒪𝒱(zk)Bkx^{k}_{i}\in\mathcal{OEV}^{-}(z_{k})\setminus B^{k} is a vertex such that 𝒱𝒫(xik)\mathcal{VP}(x^{k}_{i}) creates a constructed edge t(xik)t(xik)t(x^{k}_{i})t^{\prime}(x^{k}_{i}), where t(xik)𝒱(QL)t(x^{k}_{i})\in\mathcal{V}(Q_{L}) is a polygonal vertex and t(xik)t^{\prime}(x^{k}_{i}) is the point where xikt(xik)\overrightarrow{x^{k}_{i}t(x^{k}_{i})} first intersects bdcc(u,v)bd_{cc}(u,v). If t(xik)t(x^{k}_{i}) lies on bdcc(f(zk),l(zk))bd_{cc}(f^{\prime}(z_{k}),l^{\prime}(z_{k})) and t(xik)t^{\prime}(x^{k}_{i}) lies on bdcc(l(zk),v)bd_{cc}(l(z_{k}),v), i.e. if f(zk)t(xik)l(zk)f(z_{k})\prec t(x^{k}_{i})\prec l^{\prime}(z_{k}) and l(zk)t(xik)vl(z_{k})\prec t^{\prime}(x^{k}_{i})\prec v, then xikx^{k}_{i} is included in AkA^{k}. For instance, in Figure 11, x12A2x_{1}^{2}\in A^{2} due to the constructed edge t(x12)t(x12)t(x_{1}^{2})t^{\prime}(x_{1}^{2}). On the other hand, if t(xik)t(x^{k}_{i}) lies on bdcc(l(zk),v)bd_{cc}(l^{\prime}(z_{k}),v) and t(xik)t^{\prime}(x^{k}_{i}) lies on bdcc(f(zk),l(zk))bd_{cc}(f(z_{k}),l^{\prime}(z_{k})), i.e. if l(zk)t(xik)vl^{\prime}(z_{k})\prec t(x^{k}_{i})\prec v and f(zk)t(xik)l(zk)f(z_{k})\prec t^{\prime}(x^{k}_{i})\prec l^{\prime}(z_{k}), then xikx^{k}_{i} is included in CkC^{k}. For instance, in Figure 11, x32C2x_{3}^{2}\in C^{2} due to the constructed edge t(x32)t(x32)t(x_{3}^{2})t^{\prime}(x_{3}^{2}). Observe that, all vertices of AkA^{k} must lie on bdc(u,zk)bd_{c}(u,z_{k}), whereas all vertices of CkC^{k} must lie on bdc(zk,v)bd_{c}(z_{k},v). We have the following lemma, whose proof is similar to the proof of Lemma 4.

Lemma 50.

The edge l(zk)l(z_{k}) sees all vertices belonging to BkB^{k}.

Depending on the vertices in AkA^{k}, BkB^{k} and CkC^{k}, we have the following cases, just as in Section 5.3.

Case 1 -

𝒞(AkBkCk)\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})\neq\emptyset (see Figure 11)

Case 2 -

𝒞(AkBkCk)=\mathcal{CI}(A^{k}\cup B^{k}\cup C^{k})=\emptyset and 𝒞(Bk)\mathcal{CI}(B^{k})\neq\emptyset

     Case 2a -

𝒞(Ak)\mathcal{CI}(A^{k})\neq\emptyset and 𝒞(Ck)\mathcal{CI}(C^{k})\neq\emptyset (see Figure 12)

     Case 2b -

𝒞(Ak)=\mathcal{CI}(A^{k})=\emptyset and 𝒞(Ck)\mathcal{CI}(C^{k})\neq\emptyset (see Figure 13)

     Case 2c -

𝒞(Ak)\mathcal{CI}(A^{k})\neq\emptyset and 𝒞(Ck)=\mathcal{CI}(C^{k})=\emptyset (see Figure 14)

     Case 2d -

𝒞(Ak)=\mathcal{CI}(A^{k})=\emptyset and 𝒞(Ck)=\mathcal{CI}(C^{k})=\emptyset (see Figure 15)

In each of the above cases, we also proceed to choose the three outside edge guards s1ks^{k}_{1}, s2ks^{k}_{2} and s3ks^{k}_{3} in a similar manner as was done in Section 5.3, with the only difference being that here we use the new definitions of 𝒱𝒫(zk)\mathcal{EVP}(z_{k}) and 𝒪𝒱(zk)\mathcal{OEV}(z_{k}) instead of 𝒱𝒱𝒫(zk)\mathcal{VVP}(z_{k}) and 𝒪𝒱𝒱(zk)\mathcal{OVV}(z_{k}) respectively. To elaborate further, we choose the edge guard s3k=l(zk)s_{3}^{k}=l(z_{k}); if the guards s1ks^{k}_{1} and s2ks^{k}_{2} are chosen from a common intersection region, then we use 𝒱𝒫(zk)\mathcal{EVP}^{-}(z_{k}) rather than 𝒱𝒱𝒫(zk)\mathcal{VVP}^{-}(z_{k}); if the guards s1ks^{k}_{1} and s2ks^{k}_{2} are chosen greedily, then we use the last edge along the traversal after which some vertex belonging to AkA^{k} and CkC^{k} respectively is no longer visible. We can establish lemmas similar to Lemmas 8 to 35 (in Section 5.3) from these choices of edge guards.

As far as the choice of inside edge guards is concerned, we again choose them following the same case analysis (see Figures 23, 25 and 25) as described in Section 5.4. To elaborate further, we choose the edge guards s4ks^{k}_{4} and s5ks^{k}_{5} to be the edges adjacent to p(u,zk)p(u,z_{k}) and p(v,zk)p(v,z_{k}) respectively that lie on bdc(p(u,zk),p(v,zk))bd_{c}(p(u,z_{k}),p(v,z_{k})), whereas for the greedily chosen guard s6ks^{k}_{6} (if required at all) we use the last edge along the traversal after which some vertex belonging to 𝒪𝒱+(zk)\mathcal{OEV}^{+}(z_{k}) is no longer visible. Again, we can establish lemmas similar to Lemmas 37 to 40 (in Section 5.4) from these choices of edge guards. As a consequence, we obtain the following theorems.

Theorem 51.

Let ZZ be the set of primary vertices chosen by our modified algorithm, and let SS be the set of all edge guards placed by it. Then, |S|6|Z|12|Gopt||S|\leq 6\cdot|Z|\leq 12\cdot|G_{opt}|.

Theorem 52.

It is possible to compute in 𝒪(n4)\mathcal{O}(n^{4}) time a set of inside and outside edge guards for guarding all vertices of a weak visibility polygon QUQ_{U} such that the number of edge guards chosen is at most 12|Gopt|12\cdot|G_{opt}|, where GoptG_{opt} is an optimal edge guard cover for all vertices of QUQ_{U}.

In Theorem 52, we established the existence of an approximation algorithm for guarding a polygon QQ weakly visible from a chord uvuv. If this same algorithm is executed on the union of overlapping weak visibility polygons QQ, then it chooses primary vertices in the same way irrespective of chords in QQ, thereby producing a set of edge guards that sees the entire union QQ. So, if this algorithm is used for every overlapping weak visibility polygon in PP, then the entire polygon PP can be guarded by the union of the guard sets produced for guarding these overlapping weak visibility polygons. Note that there is no increase in running time for this overall algorithm. Moreover, since each vertex can appear in at most two weak visibility polygons from the hierarchy WW, we obtain the following theorem.

Theorem 53.

Let PP be a simple polygon having nn vertices. Then, an edge guard set SS for guarding all vertices of PP can be computed in 𝒪(n4)\mathcal{O}(n^{4}) time, such that |S|18×|Gopt||S|\leq 18\times|G_{opt}|, where GoptG_{opt} is an optimal edge guard cover for all vertices of PP.

However, it may not always be true that the guards in SS see all interior points of QUQ_{U}. Consider the polygon shown in Figure 31. Assume that our previous algorithms places guards at s4ks_{4}^{k} and s5ks_{5}^{k}, and all vertices of bdc(p(u,zk),p(v,zk))bd_{c}(p(u,z_{k}),p(v,z_{k})) become visible from s4ks_{4}^{k} or s5ks_{5}^{k}. However, the triangular region QU(VP(p(u,zk)))VP(p(v,zk))Q_{U}\setminus(VP(p(u,z_{k})))\cup VP(p(v,z_{k})), bounded by the segments x1x2x_{1}x_{2}, x2x3x_{2}x_{3} and x3x1x_{3}x_{1}, is not visible from s4ks_{4}^{k} or s5ks_{5}^{k}. Also, one of the sides x1x2x_{1}x_{2} of the triangle x1x2x3x_{1}x_{2}x_{3} is a part of the polygonal edge a1a2a_{1}a_{2}. In fact, for any such region invisible from edge guards s4k,s5kSks_{4}^{k},s_{5}^{k}\in S^{k} corresponding to some zkZz_{k}\in Z, henceforth referred to as an invisible cell, one of the sides must always be a part of a polygonal edge. The polygonal edge which contributes as a side to the invisible cell is referred to as its corresponding partially invisible edge.

Observe that s4ks_{4}^{k} and s5ks_{5}^{k} can in fact create several invisible cells, in a manner very similar to that shown in Figure 27. Each invisible cell must be wholly contained within the intersection region (which is a triangle) of a left pocket and a right pocket. For example, in Figure 31, the invisible cell x1x2x3x_{1}x_{2}x_{3} is actually the entire intersection region of the left pocket of VP(s4k)VP(s_{4}^{k}) and the right pocket of VP(s5k)VP(s_{5}^{k}). In general, where VP(s4k)VP(s_{4}^{k}) has several left pockets and VP(s5k)VP(s_{5}^{k}) has several right pockets which intersect pairwise to create multiple invisible cells (as shown in Figure 27), every such cell can be seen by placing guards on the common vertices between adjacent pairs of cells. Further, if GoptG_{opt} is also constrained to guard these invisible cells using only inward guards from QUQ_{U}, then the number of such additional guards required can be at most twice of GoptG_{opt}, as shown by Bhattacharya et al. [4]. However, in the absence of any constraint on placing guards, GoptG_{opt} may place an outside guard in QLQ_{L} that sees several such invisible cells. So, it is natural to explore the possibility of being able to guard all such invisible cells by using additional edge guards from QLQ_{L}, in combination with guards from QUQ_{U}.

Just as in Section 5.5, we present a modified algorithm that ensures that all partially invisible edges are guarded completely, and therefore the entire bdc(u,v)bd_{c}(u,v) is guarded. Let us compute the weak visibility polygons corresponding to every edge of PP. Then, the non-vertex endpoints of all the constructed edges belonging to these weak visibility polygons partition the boundary of QUQ_{U} into distinct intervals called minimal visible intervals. We have the following lemmas.

Lemma 54.

Every minimal visible interval on the boundary of QUQ_{U} is either entirely visible from an edge or totally not visible from that edge.

The modified algorithm first computes all minimal visible intervals and chooses one internal representative point from each minimal visible interval on the boundary of QUQ_{U}. These representative points are referred to as pseudo-vertices. Alongside the original polygonal vertices of QQ, all pseudo-vertices are introduced on the boundary of QUQ_{U}, and the modified polygon is denoted by QQ^{\prime}. Note that the endpoints of minimal visible intervals are not introduced in QQ^{\prime}. In the modified algorithm, the pseudo-vertices of QQ^{\prime} are treated in the same manner as the original vertices. We compute 𝒱𝒫+(z)\mathcal{EVP}^{+}(z) and 𝒱𝒫(z)\mathcal{EVP}^{-}(z) for all vertices of QQ^{\prime}, irrespective of whether it is a pseudo-vertex, and some of the psuedo-vertices may even be chosen as primary vertices.

Theorem 55.

For the edge guard set SS computed by our modified algorithm with pseudo-vertices, |S|6|Z|12|Gopt||S|\leq 6\cdot|Z|\leq 12\cdot|G_{opt}|, where GoptG_{opt} is an optimal edge guard cover for the entire boundary of QUQ_{U}.

Theorem 56.

Let PP be a simple polygon having nn vertices. Then, an edge guard set SS for guarding the entire boundary of PP can be computed in 𝒪(n5)\mathcal{O}(n^{5}) time, such that |S|18×|Gopt||S|\leq 18\times|G_{opt}|, where GoptG_{opt} is an optimal edge guard cover for the entire boundary of PP.

Proof.

This result follows directly from Theorem 55. The running time bound of 𝒪(n5)\mathcal{O}(n^{5}) can be established through arguments very similar to those in the proof of Theorem 45. The only difference lies in the computation of 𝒱𝒫(zk)\mathcal{EVP}(z_{k}) and 𝒪𝒱(zk)\mathcal{OEV}(z_{k}), in place of 𝒱𝒱𝒫(zk)\mathcal{VVP}(z_{k}) and 𝒪𝒱𝒱(zk)\mathcal{OVV}(z_{k}) respectively, for every primary vertex zkZz_{k}\in Z, but the time complexity of these computations are also same. ∎

Refer to caption
Figure 30: All vertices are visible from edge guards s4ks^{k}_{4} or s5ks^{k}_{5}, but the triangle x1x2x3x_{1}x_{2}x_{3} is invisible.
Refer to caption
Figure 31: Two outside edge guards gg and gg^{\prime} can create a residual invisible cell that is a part of x1x2x3x_{1}x_{2}x_{3}.

However, there is no guarantee that SS sees the entire interior of QUQ_{U}, as there may remain residual invisible cells in the interior of QUQ_{U} (see Figure 29). Consider a residual invisible cell that is a part of an invisible cell x1x2x3x_{1}x_{2}x_{3}, where x1x2x_{1}x_{2} is contained in a partially invisible edge. For such a residual invisible cell, there exists a pseudo-vertex on x1x2x_{1}x_{2} whose parents can see the entire cell x1x2x3x_{1}x_{2}x_{3}, as discussed earlier in the context of placing inside guards for guarding entire visibility cell. So, placing a guard at an appropriate parent, such as the parent zkz_{k} for the pseudo-vertex that will be placed on the minimal visible interval x1x2x_{1}x_{2} in Figure 29, guarantees that the residual invisible cell is totally visible. Since such an additional inside guard on QUQ_{U} corresponds to an unique outward guard in QLQ_{L}, the additional number of inside guards can be at most the number of outside guards. This amounts to placing at most (3+3)=6 inside guards and 3 outside guards corresponding to each primary vertex, while the number of primary vertices chosen remains at most 2|Gopt|2\cdot|G_{opt}|. We summarize the result in the following theorem.

Theorem 57.

Let PP be a simple polygon having nn vertices. Then, an edge guard set SS for guarding the entire interior and boundary points of PP can be computed in 𝒪(n5)\mathcal{O}(n^{5}) time, such that |S|27×|Gopt||S|\leq 27\times|G_{opt}|, where GoptG_{opt} is a an optimal edge guard cover for the entire interior and boundary of PP.

8 Concluding Remarks

We have presented three approximation algorithms for guarding simple polygons using vertex guards. We have also shown how these algorithms can be modified to obtain similar approximation bounds while using edge guards. Though the approximation ratios for our algorithms are slightly on the higher side, they do successfully settle the long-standing conjecture by Ghosh by providing constant-factor approximation algorithms for this problem. We feel that, in practice, our algorithms will provide guard sets that are much closer in size to an optimal solution. This can be further ensured by introducing a redundancy check after the placement of each new guard, which removes each (inside or outside) guard placed previously by the algorithm that does not see at least one vertex of QUQ_{U} not seen by any other guard placed so far. By incorporating such a redundancy check, we conjecture that our analysis of the approximation bound can be tightened further, and the existence of smaller approximation ratios can be proven for these three variations of the polygon guarding problem. Our algorithms exploit several deep visibility structures of simple polygons which are interesting in their own right.

References

  • [1] Mikkel Abrahamsen, Anna Adamaszek, and Tillmann Miltzow. The art gallery problem is \existsR-complete. CoRR, abs/1704.06969, 2017.
  • [2] Alok Aggarwal. The art gallery theorem: its variations, applications and algorithmic aspects. PhD thesis, The Johns Hopkins University, Baltimore, Maryland, 1984.
  • [3] Pritam Bhattacharya, Subir Kumar Ghosh, and Bodhayan Roy. Vertex Guarding in Weak Visibility Polygons. In Proceedings of the 1st International Conference on Algorithms and Discrete Applied Mathematics (CALDAM 2015), volume 8959 of Lecture Notes in Computer Science (LNCS), pages 45–57. Springer, 2015.
  • [4] Pritam Bhattacharya, Subir Kumar Ghosh, and Bodhayan Roy. Approximability of guarding weak visibility polygons. Discrete Applied Mathematics, 228:109 – 129, 2017.
  • [5] Édouard Bonnet and Tillmann Miltzow. An Approximation Algorithm for the Art Gallery Problem. In Boris Aronov and Matthew J. Katz, editors, 33rd International Symposium on Computational Geometry (SoCG 2017), volume 77 of Leibniz International Proceedings in Informatics (LIPIcs), pages 20:1–20:15, Dagstuhl, Germany, 2017. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik.
  • [6] Václav Chvátal. A combinatorial theorem in plane geometry. Journal of Combinatorial Theory, Series B, 18(1):39–41, 1975.
  • [7] Ajay Deshpande, Taejung Kim, Erik D. Demaine, and Sanjay E. Sarma. A pseudopolynomial time o(log n)-approximation algorithm for art gallery problems. In WADS, pages 163–174, 2007.
  • [8] Alon Efrat and Sariel Har-Peled. Guarding galleries and terrains. Information Processing Letters, 100(6):238–245, 2006.
  • [9] Stephan Eidenbenz, Christoph Stamm, and Peter Widmayer. Inapproximability of some art gallery problems. Canadian Conference on Computational Geometry, pages 1–11, 1998.
  • [10] Stephan Eidenbenz, Christoph Stamm, and Peter Widmayer. Inapproximability results for guarding polygons and terrains. Algorithmica, 31(1):79–113, 2001.
  • [11] Steve Fisk. A short proof of Chvátal’s watchman theorem. Journal of Combinatorial Theory, Series B, 24(3):374, 1978.
  • [12] Subir Kumar Ghosh. Approximation algorithms for art gallery problems. In Proceedings of Canadian Information Processing Society Congress, page 429–434. Canadian Information Processing Society, 1987.
  • [13] Subir Kumar Ghosh. Visibility Algorithms in the Plane. Cambridge University Press, 2007.
  • [14] Subir Kumar Ghosh. Approximation algorithms for art gallery problems in polygons. Discrete Applied Mathematics, 158(6):718–722, 2010.
  • [15] Subir Kumar Ghosh. Approximation algorithms for art gallery problems in polygons and terrains. WALCOM: Algorithms and Computation, pages 21–34, 2010.
  • [16] Subir Kumar Ghosh and David M. Mount. An output-sensitive algorithm for computing visibility graphs. SIAM Journal of Computing, 20(5):888–910, 1991.
  • [17] John Hershberger. An optimal visibility graph algorithm for triangulated simple polygons. Algorithmica, 4(1):141–155, 1989.
  • [18] J. Kahn, M. Klawe, and D. Kleitman. Traditional galleries require fewer watchmen. SIAM Journal of Algebraic and Discrete Methods, 4(2):194–206, 1983.
  • [19] Matthew J Katz. A PTAS for vertex guarding weakly-visible polygons. arXiv preprint arXiv:1803.02160, 2018.
  • [20] Matthew J. Katz and Gabriel S. Roisman. On guarding the vertices of rectilinear domains. Computational Geometry, 39(3):219–228, 2008.
  • [21] James King and David G. Kirkpatrick. Improved approximation for guarding simple galleries from the perimeter. Discrete & Computational Geometry, 46(2):252–269, 2011.
  • [22] David G. Kirkpatrick. An o(lg lg opt)-approximation algorithm for multi-guarding galleries. Discrete & Computational Geometry, 53(2):327–343, 2015.
  • [23] Erik A Krohn and Bengt J Nilsson. Approximate Guarding of Monotone and Rectilinear Polygons. Algorithmica, 66:564–594, 2013.
  • [24] D.T. Lee and A. Lin. Computational complexity of art gallery problems. IEEE Transactions on Information Theory, 32(2):276–282, 1986.
  • [25] Joseph O’Rourke. An alternative proof of the rectilinear art gallery theorem. Journal of Geometry, 211:118–130, 1983.
  • [26] Joseph O’Rourke. Art gallery theorems and algorithms. Oxford University Press, London, 1987.
  • [27] Joseph O’Rourke and Kenneth J. Supowit. Some NP-hard polygon decomposition problems. IEEE Transactions on Information Theory, 29(2):181–189, 1983.
  • [28] Dietmar Schuchardt and Hans-Dietrich Hecker. Two NP-Hard Art-Gallery Problems for Ortho-Polygons. Mathematical Logic Quarterly, 41:261–267, 1995.
  • [29] Subhash Suri. A linear time algorithm with minimum link paths inside a simple polygon. Comput. Vision Graph. Image Process., 35(1):99–110, July 1986.
  • [30] Subhash Suri. Minimum link paths in polygons and related problems. PhD thesis, The Johns Hopkins University, Baltimore, Maryland, 1987.