On Guarding Orthogonal Polygons with Bounded Treewidth

# On Guarding Orthogonal Polygons with Bounded Treewidth

Therese Biedl and Saeed Mehrabi
Cheriton School of Computer Science, University of Waterloo, Waterloo, Canada. {biedl,smehrabi}@uwaterloo.ca
###### Abstract

There exist many variants of guarding an orthogonal polygon in an orthogonal fashion: sometimes a guard can see an entire rectangle, or along a staircase, or along a orthogonal path with at most bends. In this paper, we study all these guarding models in the special case of orthogonal polygons that have bounded treewidth in some sense. Exploiting algorithms for graphs of bounded treewidth, we show that the problem of finding the minimum number of guards in these models becomes linear-time solvable in polygons of bounded treewidth.

## 1 Introduction

In this paper, we study orthogonal variants of the well-known art gallery problem. In the standard art gallery problem, we are given a polygon and we want to guard with the minimum number of point guards, where a guard sees a point if the line segment lies entirely inside . This problem was introduced by Klee in 1973 [22] and has received much attention since. guards are always sufficient and sometimes necessary [6], minimizing the number of guards is NP-hard on arbitrary polygons [17], orthogonal polygons [24], and even on simple monotone polygons [16]. The problem is APX-hard on simple polygons [11] and several approximation algorithms have been developed [13, 16].

Since the problem is hard, attention has focused on restricting the type of guards, their visibility or the shape of the polygon. In this paper, we consider several models of “orthogonal visibility”, and study orthogonal polygons that have bounded treewidth in some sense. Treewidth (defined in Section 2.1) is normally a parameter of a graph, but we can define it for a polygon as follows. Obtain the standard pixelation of by extending a horizontal and a vertical ray inward at every reflex vertex until it hits the boundary of (see also Figure 1). We can interpret this subdivision into rectangles as a planar straight-line graph by placing a vertex at any place incident to at least two segments, and define the treewidth of a polygon to be the treewidth of the graph of the standard pixelation.

#### Motivation.

One previously studied special case of the art gallery problem concerns thin polygons, defined to be orthogonal polygons for which every vertex of the standard pixelation lies on the boundary of the polygon. Thus a polygon is simple and thin if and only if the standard pixelation is an outer-planar graph. Tomás [26] showed that the (non-orthogonal) art gallery problem is NP-hard even for simple thin polygons if guards must be at vertices of the polygon. Naturally, one wonders whether this NP-hardness can be transferred to orthogonal guarding models. This is not true, for example -guarding (defined below) is polynomial on polygons whose standard pixelation is outer-planar, because it is polynomial on any simple polygon [27]. But, what can be said about polygons that are “close” to being thin? Since outer-planar graphs have treewidth 2, this motivates the question of polygons where the standard pixelation has bounded treewidth.

The goal of this paper is to solve orthogonal guarding problem for polygons of bounded treewidth. There are many variants of what “orthogonal guarding” might mean; we list below the ones considered in this paper:

• Rectangular-guarding (-guarding). A point guard -guards a point if the minimum axis-aligned rectangle containing and is a subset of . This model was introduced in 1986 by Keil [15] who gave an -time algorithm for horizontally convex orthogonal polygons. -guarding is NP-hard in orthogonal polygons with holes [4], but is solvable in time in simple orthogonal polygons [27]. There are also linear-time approximation algorithms [18] as well as algorithms for special cases [9, 15, 23].

• Staircase-guarding (-guarding). A point guard -guards any point that can be reached from by a staircase, i.e., an orthogonal path inside that is both -monotone and -monotone. This was introduced by Motwani et al. [20] who proved that -guarding is polynomial on simple orthogonal polygons. See also [21].

• Periscope-guarding. A periscope guard can see all points in which some orthogonal path inside connects to and has at most one bend. This was introduced by Gewali and Ntafos [12], who showed NP-hardness in 3D and gave positive results for special types of grids (i.e., sets of orthogonal line segments).

A natural generalization of periscope-guards are -periscope guards in which a point guard can see all points that are connected via an orthogonal path inside with at most bends. (In contrast to -guards, monotonicity of the path is not required.) This was also studied by Gewali and Ntafos [12], and is an orthogonalized version of -visibility guards where a guard can see along a path (not necessarily orthogonal) with up to segments [25].

Another variant is to consider length rather than number of bends. Thus, an -distance guard (for some fixed distance-bound ) can see all points for which some orthogonal path from to inside has length at most .111We use “” to emphasize that this path must be orthogonal; the concept would make sense for non-orthogonal paths but we do not have any results for them. We are not aware of previous results for this type of guard.

• Sliding cameras. Recently there has been much interest in mobile guards, where a guard can walk along a line segment inside polygon , and can see all points that it can see from some point along the line segment. In an orthogonal setting, this type of guards becomes a sliding camera, i.e., an axis-aligned line segment inside that can see a point if the perpendicular from onto lies inside . The sliding cameras model of visibility was introduced in 2011 by Katz and Morgenstern [14]. It is NP-hard in polygons with holes [10] (see also [19]); its complexity in simple polygons is open.

#### Related results.

We showed in an earlier paper that -guarding a polygon with bounded treewidth can be solved in linear time [4]. We briefly sketch here how this worked, so that we can explain why it does not transfer to -guarding. The main idea was to express -guarding as a restricted-distance-2 dominating set problem in a suitably defined auxiliary graph. This graph has vertices for all possible guards, all points that need watching, and as “intermediaries” all maximal axis-aligned rectangles inside , with point adjacent to rectangle if and only if . The crucial argument is that with this choice of intermediary any point of belongs to intermediaries, where is the treewidth of the polygon and is a suitable function. Therefore, one can argue that the auxiliary graph has bounded treewidth if the polygon does, and so restricted-distance-2 dominating set can be solved. A similar (and even simpler) approach works for sliding cameras [3]; here the “intermediaries” are maximal orthogonal line segments.

#### Our results.

This main goal of this paper is to solve the -guarding problem in polygons of bounded treewidth. We first attempted an approach similar to the one used for -guarding, i.e., to find suitably intermediaries and use restricted-distance-2 dominating set. We were unsuccessful, and suspect that due to the arbitrary number of bends in staircases, no intermediaries can exist for which any point belongs to intermediaries. Instead, we develop an entirely different approach. Note that the above guarding-models (except -guarding) are defined as “there exists an orthogonal path from to that satisfies some property”. One can argue (see Lemma 2.1) that we may assume the path to run along edges of the pixelation. The guarding problem then becomes the problem of reachability in a directed graph derived from the pixelation. This problem is polynomial in graphs of bounded treewidth, and we hence can solve the guarding problem for -guards, -periscope-guards, sliding cameras, and a special case of -distance-guards, presuming the polygon has bounded treewidth.

One crucial ingredient (similarly used in [3, 4]) is that we can usually reduce the (infinite) set of possible guards to a finite set of “candidate guards”, and the (infinite) set of points that need to be guarded to a finite set of “watch points” while maintaining an equivalent problem. This is not trivial (and in fact, false for some guarding-types), and may be of independent interest since it does not require the polygon to have bounded treewidth. We discuss this in Section 2.

To explain the construction for -guarding, we first solve (in Section 3.1) a subproblem in which an -guard can only see along a staircase in north-eastern direction. We then combine four of the obtained constructions to solve -guarding (Section 3.2). In Section 4, we modify the construction to solve several other orthogonal guarding variants. We conclude in Section 5.

## 2 Preliminaries

Throughout the paper, let denote an orthogonal polygon (possibly with holes) with vertices. We already defined -guards (for periscope, etc.). The -guarding problem consists of finding the minimum set of -guards that can see all points in . We solve a more general problem that allows to restrict the set of guards and points to be guarded. Thus, the --guarding problem, for some (possibly infinite) sets and , consists of finding a minimum subset of such that all points in are -guarded by some point in , or reporting that no such set exists. Note that with this, we can for example restrict guards to be only at polygon-vertices or at the polygon-boundary, if so desired. The standard -guarding problem is the same as the --guarding problem.

Recall that the standard pixelation of is obtained by extending a horizontal and a vertical ray inward from any reflex vertex until they hit the boundary. This is one method of obtaining a pixelation of , i.e., a partition of the polygon into axis-aligned rectangles (pixels) such that any pixel-corner is either on the boundary of or incident to four pixels. The 1-refinement of a pixelation is the result of partitioning every pixel into four equal-sized rectangles. See Figure 1.

A pixelation can be seen as planar straight-line graph, with vertices at pixel-corners and edges along pixel-sides. For ease of notation we do not distinguish between the geometric construct (pixel/pixel-corner/pixel-side) and its equivalent in the graph (face/vertex/edge). To solve guarding problems, it usually suffices to study this graph due to the following:

###### Lemma 2.1.

Let be a polygon with a pixelation . Let be an orthogonal path inside that connects two vertices of . Then there exists a path from to along edges of that satisfies

• is monotone if was,

• has no more bends than ,

• is no longer than .

###### Proof.

Let be the segments of , in order from to . Let be minimal such that does not run along pixel-edges. Observe that since and are pixel-corners and so their incident segments are on pixel-edges. Shift in parallel by shortening until the shifted segment resides on a pixel-edge. (This must happen at the latest when has shrunk to nothing, since the other end of is a pixel-corner by choice of .) We shorten or lengthen as needed to maintain a path. Throughout the shift, segment remains within the same pixels by choice of shift, and so it remains within . One easily verifies that the path obtained after the shift satisfies the conditions: we do not change the directions of segments, we do not add bends (and perhaps remove some if shrinks to nothing), and we do not add length (any increase of corresponds to a decrease of ). After the shift resides on pixel-edges, and sufficient repetition gives the result. ∎

### 2.1 Tree decompositions

A tree decomposition of a graph is a tree and an assignment of bags to the nodes of such that (i) for any vertex of , the bags containing form a connected subtree of and (ii) for any edge of , some bag contains both and . The width of such a decomposition is , and the treewidth of is the minimum width over all tree decompositions of .

We aim to prove results for polygons where the standard pixelation has bounded treewidth. Because we sometimes use the 1-refinement of instead, we need:

###### Observation 2.1.

Let be a polygon with a pixelation of treewidth . Then the 1-refinement of has treewidth .

###### Proof.

Let denote a tree decomposition of width of . Let be a bag in , which contains vertices of the standard pixelation. Obtain a bag by adding to it, for every , the (up to) 8 vertices of the 1-refinement such that some pixel of the 1-refinement contains both and . Let be the tree decomposition consisting of these bags , with the same adjacency structure as for . Clearly, this tree decomposition has width , and one can easily verify that it indeed is a tree decomposition of the 1-refinement. ∎

The standard pixelation of an -vertex polygon may well have vertices in general, but not for polygons of bounded treewidth.

###### Lemma 2.2.

Let be a polygon with vertices and treewidth . Then the standard pixelation of has vertices.

###### Proof.

First observe that there are boundary-corners, i.e., pixel-corners that lie on the boundary of . This holds because any boundary-corner is either a vertex of or results when a ray from a reflex vertex hits the boundary, but there are only two such rays per reflex vertex and each hits the boundary only once.

Now consider for each boundary-corner the pixel-corners that are within (graph-theoretic) distance from . There can be only many such pixel-corners per boundary-corner , since pixel-vertices have maximum degree 4. 222One may be tempted to think that there are only such vertices, since they form a grid-like structure. However, it is possible for one vertex to have neighbours of distance , e.g. if the graph contains a complete ternary tree of height (which can be drawn orthogonally without bends). In all constructions that we tried, the overall number of vertices is still , but proving this remains open. Thus, there are pixel-corners within distance of the boundary.

So, we are done unless there exists a pixel-corner that is not within distance of the boundary. Then for any pixel-corner that is within distance of , all four possible neighbours in the pixelation exist. In consequence, the vertices of distance up to of form a diamond-shape that lies within rows and columns of the pixelation; see also Figure 2.

The midpoints of the four diagonals of this diamond hence form the four corners of a grid with at least rows and columns. Such a grid is well-known to have treewidth , a contradiction. So, no such pixel-corner exists and has vertices. ∎

The 1-refinement has asymptotically the same number of vertices as the pixelation, hence it also has vertices.

### 2.2 Reducing the problem size

In the standard guarding problem, guards can be at an infinite number of points inside , and we must guard the infinite number of all points inside . To reduce the guarding problem to a graph problem, we must argue that it suffices to consider a finite set of guards (we call them candidate guards) and to check that a finite set of points is guarded (we call them watch points). Such reductions are known for -guarding [4] and sliding cameras [3]. Rather than re-proving it for each guarding type individually, we give here a general condition under which such a reduction is possible.

We need a few notations. First, all our guarding models (with the exception of sliding cameras) use point guards, i.e., guards are points that belong to . Also, all guarding models are symmetric; i.e., point guards point if and only if guards . We say that two guarding problems and are equivalent if given the solution of one of them, we can obtain the solution of the other one in linear time.

###### Lemma 2.3.

Let be an orthogonal polygon with a pixelation . Consider a guarding-model that uses point guards, is symmetric, and satisfies the following:

• For any pixel and any point , if -guards one point in the interior of , then it -guards all points in .

• For any edge of a pixel and any point , if -guards one point in the interior of , then it -guards all points on .

Then for any (possibly infinite) sets there exist (finite) sets such that --guarding and --guarding are equivalent. Moreover, and consist of vertices of the 1-refinement of .

###### Proof.

Let be the vertices of the pixelation and be the vertices of the 1-refinement. We repeatedly need the following “shifting”-operation that shifts a point to the nearest point in that act the same with respect to pixels. Formally, for any , if then . If , but lies on an edge of the standard pixelation, then let be the midpoint of . If lies on neither vertex nor edge of the standard pixelation, then it belongs to the interior of a pixel ; let be the center of . We have in all cases. For , define , and note that is finite even if is not.

Observe that some point guards a point if and only if guards the point . This is obvious if , since then . If , then it is either on an edge of a pixel (then is the midpoint of that edge), or it is in the interior of a pixel (then is the center of that pixel). By the assumption on -guarding, therefore guards if and only if it guards the entire edge/pixel, which it does if and only if guards . So we can shift watch-points without affecting whether they are guarded. By symmetry of -guarding, we can also shift guards. Namely, guards if and only if guards , if and only if guards , if and only if guards .

We claim that using and gives the result. To see this, let be solutions to the --guarding and --guarding problem, respectively. Consider the set , which guards since does. Therefore also guards , and it is a solution to the --guarding problem. So .

For the other inequality, define a new set as follows. For every guard , let be a guard with (breaking ties arbitrarily), and add to . Then , and so guards since does. By , therefore guards . So is a solution to the --guarding problem, and .

Putting it together, we have , and we can obtain one from the other via a shifting operation or its inverse. Therefore, the two problems are equivalent. ∎

It is easy to see that the conditions of Lemma 2.3 are satisfied for -guarding, -guarding and -periscope guarding (for any ). For completeness’ sake we give here the argument for -guards and only for the first condition; the proof is similar for the second condition and all other guarding models.

###### Claim 2.1.

In the standard pixelation, for any pixel and any point , if -guards one point in the interior of , then it -guards all points in .

###### Proof.

Consider the staircase from to , and assume that it is a NW-staircase, all other cases are symmetric. Let and be the maximal segment within through the right and bottom side of , respectively. Assume first that crosses both and , and let be the first point (while walking from to ) that lies on one of them, say is on ; see Figure 3(a). Since is a NW-staircase, point must be below . We can then guard any point in by walking from to along , then along to the south-east corner of , and from there with at most one bend to any point in .

Now, assume that does not cross, say, (see Figure 3(b)). Since is a NW-staircase, therefore the entire path stays within the pixels directly to the right of . These form a rectangle inside , and any two points within a rectangle can -guard each other. So -guards all points in . ∎

## 3 Algorithm for (Γ,X)-s-guarding

In this section, we give a linear-time algorithm for the --guarding problem on any orthogonal polygon with bounded treewidth. By Lemma 2.3, we may assume that and consist of vertices of the 1-refinement of the standard pixelation. As argued earlier, the 1-refinement also has bounded treewidth. Thus, it suffices to solve the --guarding where and are vertices of some pixelation that has bounded treewidth.

### 3.1 (Γ,X)-Ne-Guarding

For ease of explanation, we first solve a special case where guards can look in only two of the four directions and then show how to generalize it to -guarding. We say that a point NE-guards a point if there exists an orthogonal path inside from to that goes alternately north and east; we call a NE-path. Define NW-, SE- and SW-guarding analogously.

Note that NE-guarding does not satisfy the conditions of Lemma 2.3; see e.g. Figure 4 where all crosses are needed to NE-guard all circles. So, we cannot solve the NE-guarding problem in general, but we can solve -NE-guarding since we already know that and are vertices of the pixelation.

#### Constructing an auxiliary graph H.

Define graph to be the graph of the pixelation of and direct each edge of toward north or east; see Figure 5 for an example. By assumption and .

By Lemma 2.1, there exists an NE-path from guard to point if and only if there exists one along pixelation-edges. With our choice of edge-directions for , hence there exists such a NE-path if and only if there exists a directed path from to in . Thus, -NE-guarding reduces to the following problem which we call reachability-cover: given a directed graph and vertex sets and , find a minimum set such that for any there exists an with a directed path from to . -NE-guarding is equivalent to reachability-cover in graph using and .

Reachability-cover is NP-hard because set cover can easily be expressed in it. We now argue that reachability-cover can be solved in graphs of bounded treewidth, by appealing to monadic second order logic or MSOL (see [8] for an overview). Briefly, this means that the desired graph property can be expressed as a logical formula that may have quantifications, but only on variables and sets. Courcelle’s theorem states that any problem expressible in MSOL can be solved in linear time on graphs of bounded treewidth [7]. (Courcelle’s original result was only for decision problems, but it can easily be generalized to minimization problems.) Define Reachability to be the property that there exists a directed path from to in a directed graph . This can be expressed in MSOL [8]. Consequently, the -NE-guarding problem can be expressed in MSOL as follows:

 ∃S⊆Γ:∀p∈X:∃g∈S:Reachability(g,p,H).

So, we can solve the -NE-guarding problem if and are vertices of a given pixelation that has bounded treewidth.

### 3.2 (Γ,X)-s-guarding

Solving the --guarding problem now becomes very simple, by exploiting that a guard -guards a point if only if -guards for some {NE, NW, SE, SW}. We can solve the --guarding problem for similarly as in the previous section, by directing the auxiliary graph according to the directions we wish to take. Let be the four copies of graph (directed in four different ways) that we get. Define a new auxiliary graph as follows (see also Figure 6): initially, let . For each , add to a new vertex and the directed edges where (for {NE, NW, SE, SW}) is the vertex in corresponding to . Similarly, for each , add to a new vertex and the directed edges for {NE, NW, SE, SW}).

If some guard -guards a point , then there exists a -path from to inside for some {NE, NW, SE, SW}. We can turn this path into a -path along pixelation-edges by Lemma 2.1, and therefore find a path from to by going to and following the path within it. Vice versa, any directed path from to must stay inside for some {NE, NW, SE, SW} since is a source and is a sink. Therefore, --guarding is the same as reachability-cover in with respect to the sets and .

It remains to argue that has bounded treewidth. To do so, take a tree decomposition of of the pixelation. For each bag , create a new bag by replacing with the four copies , as well as if and if . Clearly is tree decomposition of whose width is proportional to the one of .

Now, we put it all together. Assume has bounded treewidth, hence its standard pixelation has bounded treewidth and edges, and so does its 1-refinement. This is the pixelation we use to obtain , therefore also has bounded treewidth and edges. We can apply Courcelle’s theorem to solve reachability-cover in and obtain:

###### Theorem 3.1.

Let be an orthogonal polygon with bounded treewidth. Then, there exists an linear-time algorithm for the --guarding problem on .

Our result as stated is of mostly theoretical interest, since the dependence of the run-time on the treewidth is not clear (and in general, may be quite high if applying Courcelle’s theorem). However, it is not hard to solve the reachability-cover problem directly, via dynamic programming in a tree decomposition, in time for a graph with treewidth . (We leave the details to the reader; see for example [5] for other examples of such dynamic programming algorithms.) As such, the algorithm should be quite feasible to implement for small values of .

## 4 Other Guarding Types

In this section, we show how similar methods apply to other types of orthogonal guarding. The main difference is that we need edge-weights on the auxiliary graph. To solve the guarding problem, we hence use a version of reachability-cover defined as follows. The -bounded-reachability-cover problem has as input an edge-weighted directed graph , two vertex sets and , and a length-bound . The objective is to find a minimum-cardinality set such that for any there exists an with a directed path from to that has length at most . We need to argue that this problem is solvable if has bounded treewidth, at least if is sufficiently small. Recall that reachability-cover can be expressed in monadic second-order logic. Arnborg et al. [1] introduced the class of extended monadic second-order problems which allow integer weights on the input. They showed that problems expressible in extended monadic second-order logic can be solved on graphs of bounded treewidth, with a run-time that is polynomial in the graph-size and the maximum weight.

### 4.1 L1-distance guarding

We first study the -distance guarding problem. Recall that this means that a guard can see (for a given upper bound ) all points for which there exists an orthogonal path of length at most . Our approach works only under some restrictions, but is so simple that we will describe it anyway.

We have not been able to solve the -distance guarding problem for all polygons of bounded treewidth, for two reasons. First, the -distance does not satisfy the conditions of Lemma 2.3. (For example, if there is a candidate guard at the top-right corner of the pixel in Figure 4, then for a suitable value of it can see all the circle-points but none of the cross-points.) Thus we only consider the --distance guarding problem where and are vertices of a pixelation that has bounded treewidth. The second problem is that the bounded-reachability-cover problem is solved in run-time that depends on the maximum weight. For this to be polynomial, we must assume that all edges of the input-polygon have integer length that is polynomial in .

Let and be subsets of the vertices of some pixelation of . Let be the auxiliary graph obtained from the pixelation graph by making all edges bi-directional. Set the weight of each edge to be its length. If a guard sees a point in the -distance guarding model (with distance-bound ), then there exists a path from to that has length at most . By Lemma 2.1, we may assume that runs along pixel-edges. Hence gives rise to a directed path in of length less than . Vice versa, any such path in means that can -distance-guard . In consequence, the --distance guarding problem is the same as the -bounded-reachability-cover problem, and we have:

###### Theorem 4.1.

The --distance guarding problem can be solved in a polygon with polynomial integral edge-lengths, presuming that has a pixelation of bounded treewidth that has and at its vertices.

### 4.2 k-periscope guarding

Next we turn to -periscope guards, where guard can see a point if there exists an orthogonal path from to with at most bends. Similarly as for -guards, one can show that -periscope guards satisfy the conditions of Lemma 2.3, so we can simplify any input to use a discrete set of candidate guards and watch points that are vertices of the 1-refinement of the standard pixelation. Any path from such a candidate guard to such a watch point can be assumed to reside on pixel-edges by Lemma 2.1.

For -periscope guarding, we define an auxiliary graph based on the graph of the pixelation, but modify it near each vertex and add weights to encode the number of bends, rather than the length, of a path. If is a vertex of the pixelation, then replace it with a as shown in Figure 7. We denote this copy of by , and let its four vertices be and according to compass directions. For a vertex on the boundary of we omit those vertices in that would fall outside . We connect copies and of a pixel-edge in the natural way, e.g. if was vertical with below , then we connect to . All edges are bidirectional.

For any , define a new vertex and add edges from it to all of that exist in the graph. For any , define a new vertex and add edges from all of to . Set all edge weights to 0, except for the “diagonal” edges between consecutive vertices of a , which have weight 1 as shown Figure 7.

Clearly, can see (in the -periscope guarding model) if and only if there is a directed path from to in the constructed graph that uses at most diagonal edges, i.e., that has length at most . Thus the -periscope guarding model reduces to bounded-reachability-cover.

We may assume that , since any guard can see the entire polygon in the -periscope guard model. Therefore the parameters in the bounded-reachability-cover problem are polynomial in . We can hence solve the -periscope guarding problem in polynomial time in any polygon of bounded treewidth. Note that the run-time depends polynomially on , so need not be a constant. We conclude:

###### Theorem 4.2.

-periscope guarding is polynomial in polygons of bounded treewidth.

### 4.3 Sliding cameras

It was already known that the sliding camera problem is polynomial in polygons of bounded treewidth [3]. However, using much the same auxiliary graph as in the previous subsection we can get a second (and in our opinion, easier) method of obtaining this result.

We solve the -sliding camera guarding problem, for some set of sliding cameras (which are segments inside ) and watch points . It was argued in [3] that we may assume to be a finite set of maximal segments that lie along the standard pixelation; in particular the endpoints of candidate guards are pixel-vertices. As for , we cannot apply Lemma 2.3 directly, since sliding cameras are not point guards and hence not symmetric. But sliding cameras do satisfy conditions (a) and (b) of Lemma 2.3. As one can easily verify by following the proof, we may therefore assume to consist of pixel-vertices of the 1-refinement. (A similar result was also argued in [3].)

We build an auxiliary graph almost exactly as in the previous subsection. Thus, start with the graph of the 1-refinement of the standard pixelation. Replace every vertex by a , weighted as before. (All other edges receive weight 0.) For each , define a new vertex and connect it as in the previous subsection, i.e., add edges from to . For any sliding camera , add a new vertex . The only new thing is how these vertices get connected. If is horizontal, then add an edge from to , where is the left endpoint of . If is vertical, then add an edge from to , where is the top endpoint of .

###### Claim 4.3.

A sliding camera can see a point if and only if there exists a directed path from to with length at most 1.

###### Proof.

We assume that is horizontal, the other case is symmetric. If can see , then there exists some point such that the vertical line segment is inside . Let be the left endpoint of . Then the orthogonal path from to to lies inside . Using the corresponding path from to to or in , we obtain the desired directed path which has length 1 if and length 0 otherwise.

Vice versa, if there exists a directed path from to with length at most 1 then there exists a path from to or that uses at most one diagonal edge. The part of before this diagonal edge corresponds to horizontal edges along the line through ; all such horizontal edges belong to since is a maximal segment. Thus the diagonal edge belongs to a point . The part of after this diagonal edge corresponds to vertical edges along the line through , and hence (after possible shortening of the path) goes along the line segment , which hence must be inside . So, can see . ∎

Therefore the sliding camera problem reduces to a bounded-reachability-cover problem where all weights are at most 1; this can be solved in polynomial (in fact, linear) time if the polygon has bounded treewidth. We conclude:

Sliding camera guarding is polynomial in polygons of bounded treewidth.

## 5 Conclusion

In this paper, we gave algorithms for guarding orthogonal polygons of bounded treewidth. We considered various models of orthogonal guarding, and solved the guarding problem on such polygons for -guards, -periscope guards, and sliding cameras, and some other related guarding types.

As for open problems, the main question is whether these results could be used to obtain better approximation algorithms. Baker’s method [2] yields a PTAS for many problems in planar graphs by splitting the graph into graphs of bounded treewidth and combining solutions suitably. However, this requires the problems to be “local” in some sense, and the guarding problems considered here are not local in that a guard may see a point whose distance in the graph of the pixelation is very far, which seems to make Baker’s approach infeasible. Are these guarding problems APX-hard in polygons with holes?

## References

• [1] S. Arnborg, J. Lagergren, and D. Seese. Easy problems for tree-decomposable graphs. J. Algorithms, 12(2):308–340, 1991.
• [2] B. Baker. Approximation algorithms for NP-complete problems on planar graphs. J. ACM, 41(1):153–180, 1994.
• [3] T. Biedl, T. M. Chan, S. Lee, S. Mehrabi, F. Montecchiani, and H. Vosoughpour. On guarding orthogonal polygons with sliding cameras. In International Conference and Workshops on Algorithms and Computation (WALCOM 2017), volume 10167 of LNCS, pages 54–65. Springer, 2017.
• [4] T. Biedl and S. Mehrabi. On r-guarding thin orthogonal polygons. In International Symposium on Algorithms and Computation (ISAAC 2016), volume 64 of LIPIcs, pages 17:1–17:13, 2016.
• [5] H. Bodlaender and A. Koster. Combinatorial optimization on graphs of bounded treewidth. The Computer Journal, 51(3):255–269, 2008.
• [6] V. Chvátal. A combinatorial theorem in plane geometry. Journal of Combinatorial Theory, Series B, 18:39–41, 1975.
• [7] B. Courcelle. The monadic second-order logic of graphs. I. Recognizable sets of finite graphs. Inf. Comput., 85(1):12–75, 1990.
• [8] B. Courcelle. On the expression of graph properties in some fragments of monadic second-order logic. In DIAMCS Workshop on Descriptive Complexity and Finite Models, pages 33–57. American Mathematical Society, 1997.
• [9] J. Culberson and R. A. Reckhow. Orthogonally convex coverings of orthogonal polygons without holes. Journal of Computer and System Sciences, 39(2):166 – 204, 1989.
• [10] S. Durocher and S. Mehrabi. Guarding orthogonal art galleries using sliding cameras: algorithmic and hardness results. In Mathematical Foundations of Computer Science (MFCS 2013), volume 8087 of LNCS, pages 314–324, 2013.
• [11] S. Eidenbenz, C. Stamm, and P. Widmayer. Inapproximability results for guarding polygons and terrains. Algorithmica, 31(1):79–113, 2001.
• [12] L. Gewali and S. C. Ntafos. Covering grids and orthogonal polygons with periscope guards. Comput. Geom., 2:309–334, 1992.
• [13] S. K. Ghosh. Approximation algorithms for art gallery problems in polygons. Disc. App. Math., 158(6):718–722, 2010.
• [14] M. J. Katz and G. Morgenstern. Guarding orthogonal art galleries with sliding cameras. International J. Computational Geometry & Applications, 21(2):241–250, 2011.
• [15] J. M. Keil. Minimally covering a horizontally convex orthogonal polygon. In ACM Symposium on Computational Geometry (SoCG 1986), pages 43–51, 1986.
• [16] E. Krohn and B. J. Nilsson. Approximate guarding of monotone and rectilinear polygons. Algorithmica, 66(3):564–594, 2013.
• [17] D. T. Lee and A. K. Lin. Computational complexity of art gallery problems. IEEE Transactions on Information Theory, 32(2):276–282, 1986.
• [18] A. Lingas, A. Wasylewicz, and P. Zylinski. Linear-time 3-approximation algorithm for the r-star covering problem. International J. Computational Geometry & applications, 22(2):103–142, 2012.
• [19] Saeed Mehrabi. Geometric optimization problems on orthogonal polygons: hardness results and approximation algorithms. PhD thesis, University of Manitoba, Winnipeg, Canada, August 2015.
• [20] R. Motwani, A. Raghunathan, and H. Saran. Covering orthogonal polygons with star polygons: The perfect graph approach. In ACM Symposium on Computational Geometry (SoCG 1988), pages 211–223, 1988.
• [21] R. Motwani, A. Raghunathan, and H. Saran. Covering orthogonal polygons with star polygons: The perfect graph approach. J. Comput. Syst. Sci., 40(1):19–48, 1990.
• [22] J. O’Rourke. Art Gallery Theorems and Algorithms. Oxford University Press, New York, NY, 1987.
• [23] L. Palios and P. Tzimas. Minimum r-star cover of class-3 orthogonal polygons. In International Workshop on Combinatorial Algorithms (IWOCA 2014), volume 8986 of LNCS, pages 286–297. Springer, 2014.
• [24] D. Schuchardt and H.-D. Hecker. Two NP-hard art-gallery problems for ortho-polygons. Mathematical Logic Quarterly, 41(2):261–267, 1995.
• [25] T. Shermer. Covering and guarding polygons using -sets. Geometriae Dedicata, 37:183–203, 1991.
• [26] A. P. Tomás. Guarding thin orthogonal polygons is hard. In Fundamentals of Computation Theory (FCT 2013), volume 8070 of LNCS, pages 305–316, 2013.
• [27] C. Worman and J. M. Keil. Polygon decomposition and the orthogonal art gallery problem. Int. J. Comput. Geometry Appl., 17(2):105–138, 2007.
You are adding the first comment!
How to quickly get a good reply:
• Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
• Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
• Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
The feedback must be of minimum 40 characters and the title a minimum of 5 characters