Guarding Offices with Maximum Dispersion
Abstract
We investigate the Dispersive Art Gallery Problem with vertex guards and rectangular visibility (-visibility) for a class of orthogonal polygons that reflect the properties of real-world floor plans: these office-like polygons consist of rectangular rooms and corridors. In the dispersive variant of the Art Gallery Problem, the objective is not to minimize the number of guards but to maximize the minimum geodesic -distance between any two guards, called the dispersion distance.
Our main contributions are as follows. We prove that determining whether a vertex guard set can achieve a dispersion distance of in office-like polygons is -complete, where vertices of the polygon are restricted to integer coordinates. Additionally, we present a simple worst-case optimal algorithm that guarantees a dispersion distance of in polynomial time. Our complexity result extends to polyominoes, resolving an open question posed by Rieck and Scheffer [27]. When vertex coordinates are allowed to be rational, we establish analogous results, proving that achieving a dispersion distance of is -hard for any , while the classic Art Gallery Problem remains solvable in polynomial time for this class of polygons. Furthermore, we give a straightforward polynomial-time algorithm that computes worst-case optimal solutions with a dispersion distance .
On the other hand, for the more restricted class of hole-free independent office-like polygons, we propose a dynamic programming approach that computes optimal solutions. Moreover, we demonstrate that the problem is practically tractable for arbitrary orthogonal polygons. To this end, we compare solvers based on SAT, CP, and MIP formulations. Notably, SAT solvers efficiently compute optimal solutions for randomly generated instances with up to vertices in under .
Keywords and phrases:
Dispersive Art Gallery Problem, vertex guards, office-like polygons, orthogonal polygons, polyominoes, -completeness, worst-case optimality, dynamic programming, SAT solverCopyright and License:
2012 ACM Subject Classification:
Theory of computation Computational geometrySupplementary Material:
Software (Source Code): https://github.com/KaiKobbe/dispersive_agp_solver [22]archived at
swh:1:dir:f655f369c667ab3b9b7b7afff427303919d67cdc
Funding:
Work from TU Braunschweig was partially supported by the German Research Foundation (DFG), project “CG:SHOP”, FE 407/21-1. Joseph Mitchell was partially supported by the National Science Foundation (CCF-2007275). Christian Rieck was partially supported by DFG grant 522790373.Editors:
Paweł Gawrychowski, Filip Mazowiecki, and Michał SkrzypczakSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
The Art Gallery Problem (AGP) is a widely studied problem in computational geometry. Given a polygonal region, the objective is to select a minimum number of points (guards) such that every point within the region is visible from at least one guard, with visibility defined by an unobstructed line segment that does not intersect the polygon boundary. Since its introduction, numerous variants of the problem have been studied [26, 29, 31].
A relevant application arises in the deployment of sensors across a designated area, for which the challenge is to balance sensor spacing and signal coverage. On one hand, ensuring sufficient distance between sensors helps mitigate interference, preserving data integrity. On the other hand, it is essential to guarantee full coverage, ensuring continuous and reliable signal transmission across the entire area. This trade-off is captured by the Dispersive Art Gallery Problem, which is defined as follows: Given a polygon and a rational number , determine whether there exists a guard set for such that the geodesic distances between any two guards in are at least . Notably, this formulation focuses solely on pairwise distances between guards rather than minimizing their total number.
In this paper, we investigate the theoretical and practical tractability of this problem in the context of vertex guards within a class of orthogonal polygons that model key structural properties of real-world floor plans or rectangular galleries [10], consisting of orthogonal rooms and corridors, called office-like polygons111This class of polygons was originally introduced by Cruz and Tomás [10] using the Portuguese expression SCOT for salas e corredores ortogonais, i.e., orthogonal rooms and corridors.; see Figure 1 for an example.
1.1 Our contributions
We present results for the Dispersive AGP with vertex guards in orthogonal polygons, including general, polyominoes, and office-like polygons, under -visibility and -geodesics. Without loss of generality, we assume a minimum distance of between any pair of vertices.222This assumption serves purely to simplify the statements; alternatively, setting the minimum distance to would generalize all results proportionally.
-
We show that the ratio between the cardinality of a maximally dispersed guard set and the smallest possible guard set can be arbitrarily large, even in histograms.
-
We present polynomial-time algorithms that compute worst-case optimal guard sets for office-like polygons. Specifically, the algorithms achieve dispersion distances of when vertices are restricted to integer coordinates, and otherwise. These bounds are tight, as demonstrated by corresponding lower-bound constructions.
-
Deciding whether a given office-like polygon allows a guard set with a dispersion distance of is -complete when vertices are restricted to integer coordinates; the same result holds for polyominoes (and with minor modifications even for thin polyominoes), thereby resolving an open question from [27] on -hardness in that setting. If vertex coordinates are allowed to be rational, deciding whether a dispersion distance of at least can be achieved for any is already hard; see Theorems 5, 6, and 7.
-
For independent hole-free office-like polygons, we provide a dynamic programming approach to compute guard sets with maximum dispersion in polynomial time; see Theorem 8.
-
We evaluate practical tractability by utilizing SAT, CP, and MIP techniques. Our experiments show that instances with up to vertices can be solved in under .
Note that the assumption on the minimum distance between any pair of vertices is not needed in both the practical evaluation as well as the dynamic programming. However, we adopt this assumption throughout the paper to improve clarity and readability. Due to space restrictions, details for statements marked with () can be found in the full version [16].
1.2 Previous work
The Art Gallery Problem (AGP) has been a cornerstone of computational geometry, inspiring extensive research. For an overview, see the previously mentioned book by O’Rourke [26] or the surveys by Shermer [29] and Urrutia [31].
For a long time, it was known that the classic AGP is -hard in several fundamental variants [23, 28]. Abrahamsen, Adamaszek, and Miltzow [1] were the first to show that, even in monotone polygons, “irrational guards are sometimes needed”. They subsequently established -completeness [2]. Meijer and Miltzow [25] construct a polygon that can be guarded by two guards, both of which must have irrational coordinates. When considering -visibility (where two points and see each other if and only if the rectangle described by and lies completely within the polygonal region) instead of the classic line visibility, the AGP remains -hard for polygons with holes [21], whereas optimal guard sets can be computed in polynomial time for hole-free (orthogonal) polygons [32]. Recently, Cruz and Tomás [10] introduced a family of orthogonal polygons designed to mimic properties of real-world buildings. We will refer to these polygons as office-like polygons. These polygons consist of multiple rectangular rooms connected by rectangular corridors, with each corridor being narrower than both of its incident rooms. Using -visibility, they obtained several results. They introduced a simple greedy algorithm that computes optimal guard placements using the minimum number of guards for simple office-like polygonal environments. They also proved that efficient algorithms exist for the subclass of -independent office-like polygons (i.e., office-like polygons in which the extensions of all pairs of adjacent corridors with the same direction are either coincident or disjoint), utilizing matching and flow techniques. However, guarding general office-like polygons under -visibility remains -hard.
All of the aforementioned results focus on minimizing the number of guards required for coverage. However, some variants relax this constraint and shift the focus to alternative objectives or other factors. One such example is the Chromatic AGP [12, 13, 14, 20], with each guard being assigned a color. The goal is to minimize the number of colors used so that no two guards of the same color class have overlapping visibility regions while ensuring full coverage of the domain. In the Conflict-free Chromatic AGP [3, 4, 19], the aforementioned overlapping constraint is relaxed, requiring that every point in the domain must see at least one guard whose color is unique among all guards visible from that point.
Under the current definition of the dispersive variant, the cardinality of a guard set is not considered relevant either. Rieck and Scheffer [27] studied the Dispersive AGP for vertex guards in polyominoes, assuming geodesics and -visibility. They proved that deciding whether a given thin polyomino allows a guard set with a dispersion distance of is -complete. Additionally, they provided a linear-time algorithm that produces a worst-case optimal solution for simple polyominoes, ensuring a guard set with a dispersion distance of . Fekete et al. [15] extended this to vertex guards in polygons. They demonstrated that determining whether a guard set with a dispersion distance of exists in polygons with holes is -complete. Furthermore, they showed that a dispersion distance of is sometimes unavoidable even in hole-free polygons and proposed an algorithm to generate such sets.
Dispersion problems, which are closely related to packing problems, focus on arranging a set of objects to be as far apart as possible or selecting a subset whose elements are maximally separated. Such problems naturally arise in the context of the obnoxious facility location problem [7] and the problem of distant representatives [17]. Baur and Fekete [5] studied the problem of distributing a set of points within a polygonal domain to maximize dispersion. They established that this problem is -hard and ruled out the possibility of a for geometric dispersion problems unless =.
1.3 Preliminaries and first observations
Given any polygon , a subset of points is called a guard set for if every point is visible by at least one point . We restrict ourselves to vertex guards, i.e., guards are only placed on vertices of the domain. We adopt the r-visibility model, where two points and are said to see each other if the axis-aligned rectangle defined by and is entirely contained within . The visibility region of a point is the set of all points that are visible from . The size of a guard set is its number of guards. We measure the distance between two points as -geodesics. With this, the dispersion distance of a guard set is the minimum geodesic -distance between any pair of guards; we say that a guard set realizes a dispersion distance of , or is -realizing.
In this paper, we consider office-like polygons as well as polyominoes. Polyominoes are orthogonal polygons formed by joining unit squares edge to edge. An office-like polygon is a connected orthogonal polygon made up from a collection of rectangular rooms that are linked by a collection of rectangular corridors . A corridor connects two rooms if a side of the corridor is strictly contained in an edge of both rooms, i.e., the corridor is narrower than the rooms, and none of the vertices of a room coincides with a vertex of a corridor. An example of an office-like polygon with several rooms and corridors, as well as a set of guards is depicted in Figures 1 and 3(b). Each corridor connects exactly two rooms. A corridor is horizontal if it links rooms to its left and right; otherwise, it is vertical. Two corridors and are independent if no guard placed on a vertex of also guards . If every pair of corridors is independent, then the polygon is independent.
Fekete et al. [15] showed that optimal solutions for the Dispersive AGP when considering arbitrary simple polygonal domains may contain many guards, even if the domain can be covered by a small number of guards. In particular, they obtained a family of polygons in which the ratio between the sizes of the respective guard sets is unbounded. We strengthen this by observing that this is true even for histograms, as visualized in Figure 2.
In the case of office-like polygons, it appears that the situation may differ. However, we can construct a family of these polygons for which this ratio asymptotically approaches ; the construction is given in the full version [16].
2 Worst-case optimality
In this section, we discuss worst-case optimal algorithms for the Dispersive AGP in office-like polygons. We begin by examining them with vertices at integer coordinates. Afterward, we extend our analysis to present similar results for the unrestricted case.
2.1 Office-like polygons with vertices at integer coordinates
We establish the following worst-case bound.
Theorem 1 ().
For office-like polygons with holes and vertices at integer coordinates, there always exists a guard set with dispersion distance at least , which is sometimes optimal.
As a first observation, it is easy to construct instances in which every guard set has a dispersion distance of at most ; an example is visualized in Figure 3(a). In this polygon, at least one guard is required in each of the three unit-square corridors, but then at least one pair of guards must be in distance of one another. Notably, this polygon can serve as some kind of building block, as it can be extended arbitrarily along the black arrows.
We now outline the high-level idea of a polynomial-time algorithm that computes guard sets with a dispersion distance of , thereby ensuring optimal solutions in the worst-case. Our approach consists of three phases. In each phase, we place a set of guards, guaranteeing that no guard is positioned less than units away from any previously placed guard.
- Phase (1):
-
Place guards on vertices of corridors connecting two rooms vertically to ensure that these corridors are properly guarded.
- Phase (2):
-
Place guards similarly on the vertices of corridors connecting rooms horizontally.
- Phase (3):
-
Place guards in any remaining rooms that are not yet covered.
An example illustrating the guard placements made by our algorithm is shown in Figure 3(b). Red guards are placed during the first phase, blue guards during the second phase, and green guards during the final phase.
In each phase, our approach ensures that every new guard is placed at least 3 units away from all previously placed guards. Essentially, in the first two phases, we place guards either on the left side of vertical corridors or on the bottom side of horizontal corridors. Moreover, it is easy to see that in every room that is not covered by the first two phases, there is at least one vertex that is in distance at least to a guard placed in an incident corridor.
2.2 Office-like polygons with vertices at arbitrary rational coordinates
We now investigate worst-case optimal solutions in case that vertices of the polygon are not restricted to integer coordinates. The primary challenge in achieving large dispersion distances arises in corridors that are independent but have a minimal horizontal or vertical separation. We refer to such arrangements of corridors as densely packed; an example is depicted in Figure 4(a).
Our main theorem for these polygons is the following.
Theorem 2.
For office-like polygons with holes, there always exists a guard set with a dispersion distance of at least . Furthermore, for every rational , there is such a polygon in which a dispersion distance of is best possible.
We begin with observing that arrangements of densely packed corridors enforce small dispersion distances.
Lemma 3 ().
For every and , there exists an office-like polygon with at least vertices such that every guard set has a dispersion distance that is smaller than .
Consider the polygon shown in Figure 4(a). All corridors (depicted in dark gray) are unit squares, the rooms (represented as horizontal bars in light gray) have a height of , and the red rectangles have a width of for any .
We now give the idea that any guard set contains a guard in corridor only if its dispersion distance is smaller than . Clearly, every guard set must contain such a guard, as otherwise the corridor is not guarded. Every guard set with a dispersion distance of at least that contains a guard at the bottom-left (top-left) vertex of must contain all guards depicted in green (blue). However, this leads to a contradiction, as no guard can be placed with sufficient distance in (or ), i.e., there is no -realizing guard set. Incoming arcs indicate that a previously placed guard enforces a guard position (because no other option in the respective corridor is possible). Due to symmetry, a guard set with adequate dispersion distance cannot contain a guard at either the bottom-right or top-right vertex of . Moreover, this instance can easily be extended along the black arrows, to obtain office-like polygons with an arbitrary number of vertices.
We now prove that a dispersion distance of is always realizable.
Lemma 4.
Every office-like polygon allows a guard set with dispersion distance at least .
Proof.
Our construction of a guard set with a dispersion distance of at least is as follows. In every room, we walk in clockwise direction along the boundary from the bottom-left to the top-right vertex, and place a guard at every other vertex, see Figure 4(b).
This routine clearly yields a guard set. Moreover, within each room guards are placed in geodesic distance at least . We ensure that guards placed in different but adjacent rooms have at least a geodesic distance of by only placing guards at the left and top part of each room, meaning that, in particular, no two guards are positioned within the same corridor.
Note that this result cannot be directly derived from [15], as it also holds for office-like polygons with holes, while the known result only holds for simple polygons without holes.
3 Computational complexity
In this section, we investigate the computational complexity of the respective decision problem. Our main result is the following:
Theorem 5.
Deciding whether there exists a guard set with a dispersion distance of in independent office-like polygons with holes and vertices on integer coordinates is -complete.
We highlight that the constructed polygon in our reduction is essentially a polyomino, thus, this result also answers an open question from Rieck and Scheffer [27]. Unfortunately, the gadgets are not thin, i.e., those that do not contain a square. Nevertheless, we can adjust all involved gadgets, showing that this result also holds true for thin polyominoes.
Corollary 6.
Deciding whether there exists a guard set with a dispersion distance of in (thin) polyominoes with holes is -complete.
By relaxing the constraint on the vertex positions to arbitrary (rational) coordinates, and slight modifications to all involved gadgets, we obtain the following.
Corollary 7.
Deciding whether there exists a guard set with a dispersion distance of for any rational in independent office-like polygons with holes is -complete.
Membership in is relatively straightforward: First, we can compute the -visibility polygon of a guard in polynomial time, see Section 5. Additionally, the union of two polygons can be computed in polynomial time as well [24]. Thus, we can efficiently verify that a given solution is indeed a guard set. Moreover, the distance between two guards can be computed in polynomial time [30]. By checking all pairwise distances between guards, we can verify whether the guard set realizes a certain dispersion distance. Hence, the problem is in .
We proceed with a high-level idea of the reduction showing -hardness, before moving on to a thorough explanation of the various gadgets that are utilized in the actual construction.
High-level idea of the reduction
We reduce from the -complete variant of Planar 3Sat where every variable occurs in exactly three clauses, denoted as Planar 3Sat with Exactly Three Occurrences per Variable (P3Sat) [6, 8, 18]. Without loss of generality, we can assume that each variable appears negated in two clauses and unnegated in one clause.
For any given Boolean formula representing an instance of P3Sat, we first compute a rectilinear embedding of the corresponding clause-variable incidence graph. Then, we replace each clause vertex with a clause gadget and each variable vertex with a variable gadget, connecting them accordingly. (In some variants of our problem, additional auxiliary gadgets are required to construct a valid office-like polygon.) We can then demonstrate that is satisfiable if and only if the respectively constructed polygon has a guard set of a certain dispersion distance.
Gadgets for office-like polygons with vertices at integer coordinates
A first observation is that the polygon, that is depicted in Figure 5, has the property that, if we want to realize a dispersion distance of , either the two blue or the two red guards need to be selected. More importantly, this implies that no other guard can be placed within distance of the vertices and .
Variable gadget.
The variable gadget is depicted in Figure 6. Banning-type gadgets on both sides prevent placing guards at the vertices and . As a result, no guard set consisting solely of vertices from the variable gadget can see into two consecutive corridors. In other words, there exist feasible guard sets that either guard both corridors labeled false, or the corridor labeled true, but never one corridor of each type. Therefore, this gadget can distinguish between true and false.
Clause gadget.
Because the problem from which we construct our reduction is solvable in polynomial time in the special case where all clauses contain three literals, we introduce clause gadgets that include both two- and three-literal clauses, as visualized in Figure 7.
In both cases, there exist guard sets with a dispersion distance of that guard all incoming corridors except for one. As a result, at least one of the corridors must be guarded by a guard placed on a vertex from another gadget, which implies that the clause is satisfied by the corresponding truth assignment.
To construct an office-like polygon from a given embedding of the clause-variable-incidence graph, it is essential to be able to make turns. As these polygons only permit straight corridors, turns can only be realized by auxiliary rooms. Note that the banning-type subpolygon in the two-literal clause gadget is necessary only to accommodate the bending of corridors; without it, the corridors would be too close together to provide enough room for the bending gadgets. For that reason, we now introduce the bending gadget.
Bending gadget.
The bending gadget is depicted in Figure 8. The banning-type subpolygon prevents placing a guard on the vertex labeled of the outgoing corridor. Additionally, the remaining vertex of the outgoing corridor is at a distance of from the two vertices incident to the incoming corridor. Therefore, we can only guard the outgoing corridor from vertices of the bending gadget if the incoming corridor does not need to be guarded, and vice versa, ensuring a feasible propagation of the truth assignment.
Gadgets for polyominoes
As previously noted, this reduction also applies to polyominoes. However, we can use even simpler gadgets to demonstrate that determining whether a guard set with a dispersion distance of 4 exists is -hard. Moreover, as these gadgets are thin, this result extends to thin polyominoes as visualized in Figure 9.
Gadgets for office-like polygons with vertices at arbitrary rational coordinates
Removing the requirement that vertices lie on integer coordinates provides more freedom, enabling a more intricate construction to show hardness distance for any . In particular, corridors can be placed in such a way that they remain independent, yet their vertical or horizontal distance can be arbitrarily small. The underlying structure of the gadgets for this variant is essentially the same as those in the integer variant, now combined with a polygon similar to the one shown in Figure 4(b). However, as the gadgets grow larger due to the minimum number of nested corridors required for the construction to work properly, an additional gadget is necessary. This gadget is used to stretch or widen the respective polygon, creating space for other gadgets.
While the proofs of Theorems 5 and 6 are straightforward, the proof of Corollary 7 is more involved; all technical details are provided in the full version [16].
4 Dynamic programming for hole-free independent office-like polygons
Computing optimal solutions for the Dispersive AGP turns out to be challenging. At present, the only non-trivial class of polygons known to admit a polynomial-time algorithm comprises polyominoes whose dual graph is a tree [27]. Additionally, the -hardness result implies that the existence of a polynomial-time algorithm is unlikely, even for office-like polygons that only contain independent corridors.
We now present a polynomial-time dynamic programming algorithm that computes the optimal solution for independent office-like polygons without holes. The main component of this approach is to solve geometric independent set problems.
Theorem 8 ().
For independent office-like polygons without holes, there exists a polynomial-time algorithm that computes guard sets with maximum dispersion.
The high-level idea of our approach is as follows: Consider a hole-free independent office-like polygon with vertices. We solve the decision problem whether a guard set with a dispersion distance of at least exists. Afterward, we do a binary search over the many possible dispersion distances (implied by the pairwise vertex distances in ) to solve the corresponding maximization problem, i.e., finding a guard set realizing a maximum dispersion distance by using our algorithm for the decision problem as a subroutine.
Let represent as follows: There is a node for each room of , and an edge if two rooms and are connected by a corridor . We now fix an arbitrary in-arborescence of , i.e., a directed tree with edges pointing towards a root, see Figure 10. For each node of , we define a subproblem and solve it only when all predecessor nodes are marked as processed.
We proceed with a high-level overview of the key terminology, followed by precise definitions of the associated subproblems and a detailed exposition of the core components of our algorithm. Subsequently, we provide a brief analysis of the algorithm’s runtime.
Preliminaries and subproblem definition
Consider a directed edge in and the maximal directed subtree of rooted at . The branch for consists of the corridor and all rooms and corridors corresponding to nodes and edges of . We refer to the two vertices shared by and as the gate vertices (or gate) of . For convenience, we define the branches rooted at as those for edges of the form . In Figure 10, the rooms and corridors outlined in red correspond to the branches and that are rooted at , with corresponding gate vertices marked in white.
A guard set for a branch consists of guards exclusively placed at vertices within , ensuring coverage of every room and corridor in . However, some guard sets for also cover (by placing a guard at a feasible gate vertex), while others do not. A set of configurations for is a collection of guard sets for , each with a dispersion distance of at least , satisfying the following property: Consider an arbitrary guard set for with a dispersion distance of at least . Let denote the guards that are placed at vertices within . Then, there always exists a configuration such that forms a guard set for with a dispersion distance of at least .
These definitions allow us to define a subproblem for each node in the in-arborescence : When processing the root of , we solve the entire decision problem. Every other node in , is handled as follows: Let denote the unique node such that there exists an edge from to in . The goal is to find a set of configurations for the branch of . Note that, by the time we process , all predecessor nodes have already been processed, and we therefore know a set of configurations for each branch rooted at . If, at some point, a computed configuration set is empty, we conclude that no guard set with a dispersion distance of at least exists for , not even within this branch.
Computing configuration sets
We now explain how we construct the configuration set for a branch belonging to an edge . Consider all feasible guard placements on the vertices of a single corridor and its incident room ; as an example, see the red guards in Figure 11. Note that the number of distinct feasible vertex guard sets in this combined region is clearly bounded by a constant.
Furthermore, some of these guard sets are not sensible, as, e.g., placing two guards at corners of a room is unnecessary, as both would have identical visibility polygons. Now, for every such placement , we aim to derive a configuration for by selecting the guards in along with one precomputed configuration for each branch rooted at . However, choosing such a combination requires careful consideration of the following aspects:
(1) As mentioned above, some configurations for branches rooted at do cover , while others do not. Therefore, if does not contain a guard in , an arbitrary choice of configurations may result in remaining uncovered. To address this issue, we fix a configuration (for some branch rooted at ) that places a guard at one of its gate vertices, and hence in . To ensure correctness, we probe every possible option.
(2) By definition, all pairs of guards within a single configuration maintain a minimum dispersion distance of ; however, this condition may be violated when considering interactions between guards in and those in . In such instances, the configuration is deemed invalid and consequently excluded from further consideration.
(3) When computing the configuration that contains the guard set , our goal is to ensure that whenever there exists a guard set for with a dispersion distance of at least that includes , then there also exists such a guard set that includes . Leveraging on the fact that is independent, we arrive at the following crucial observation.
Observation 9.
Consider two vertices in such that is inside, and is outside of a branch . Then, there always exists a shortest geodesic -path between and that passes through one of the gate vertices of .
An example for Observation 9 is highlighted by the blue paths in Figure 10. Moreover, again due to the assumption that is independent, at least one guard needs to be placed in every corridor, and hence in . Therefore, when considering a fixed placement , the following holds for one gate vertex of : when all guards in the chosen configuration maximize their minimum distance to , the distance to the other gate vertex of is maximized as well. For an exemplary illustration, consider the blue vertices in Figure 11. With Observation 9, this is best possible when using .
We now want to choose a configuration with these properties. To achieve this, we perform a binary search over the pairwise vertex distances in , aiming to find the choice of configurations for branches rooted at that maximizes the distance to . For each distance considered during the current step of the binary search, we discard all configurations of branches rooted at where a guard has a distance less than to .
(4) After addressing the aforementioned aspects, the crucial task is to select one configuration for each branch rooted at so that no two guards from different configurations are closer than , or to determine that no such selection exists.
This problem corresponds to finding an independent set of size in the following auxiliary graph, where denotes the number of branches rooted at : Each configuration of a branch rooted at is represented by a node. Two nodes are connected by an edge if both corresponding configurations belong to the same branch, or if there exists a guard and a guard such that the distance between them is strictly smaller than .
To this end, we propose a straightforward algorithm that iteratively prunes infeasible configurations–those that can never contribute to a valid solution–proceeding until a solution is identified or the algorithm certifies that no solution exists. The algorithm essentially consists of two phases. In the first phase, the algorithm selects configurations (with sufficiently large dispersion distance) in two steps for all branches geometrically extending (1) vertically and (2) horizontally from the room , respectively. This can be done using a simple greedy approach. In the second phase, the algorithm combines the solutions for both subproblems, either finding a valid solution, or identifying a configuration that can provably be discarded. In the latter case, the algorithm is restarted with the updated set of available configurations.
Runtime of the dynamic programming approach
To solve the decision problem, we need to solve one subproblem for each node of . The binary search on the possible dispersion distances to solve the maximization problem takes an additional logarithmic factor. This yields a total runtime of , where denotes the time needed to solve a subproblem. We provide a detailed description of the algorithm for solving a subproblem and prove that its amortized runtime across all subproblem calls is in the full version of our paper [16]. With this, the total runtime of the dynamic programming approach is .
5 Computing optimal solutions in practice
Mixed Integer Programming is a popular approach for solving -hard optimization problems. This problem allows for a simple formulation. We define a binary variable for each vertex in polygon to indicate guard placement and a continuous variable for the dispersion distance. The objective maximizes , subject to (i) , ensuring every witness in is covered, and (ii) , enforcing that no two guards with distance smaller than can be selected. The second constraint is non-linear but can be reformulated into a linear constraint using the big-M method. However, this reformulation can be problematic for traditional MIP solvers, as it weakens the linear relaxation and may lead to numerical instabilities. Alternatively, constraint programming solvers like CP-SAT can handle these constraints more effectively, as they rely less on linear relaxation.
Less obvious is that a SAT solver can also be used to solve this problem, leveraging the fact that there are only possible objective values to check for feasibility. For a fixed , feasibility is determined by the constraints , ensuring coverage, and , enforcing the minimum guard distance. A binary search over then yields the optimal solution. For efficiency, should be updated based on the actual solution returned by the SAT solver rather than just the probed values.
To obtain a sufficient witness set , we use atomic visibility polygons (AVPs) as introduced by Couto et al. [9], which yield a shadow witness set. The key idea is to construct the arrangement of visibility polygons defined by the polygon’s vertices, where each face (referred to as AVP) is covered by the same guard set. From this arrangement, shadow AVPs are identified as the local minima in the partial order of AVPs based on their covering sets. Selecting a single witness from each shadow AVP ensures full coverage of the polygon, even under -visibility constraints. For computing the -visibility polygons, we implemented a simple algorithm [16]. The basic idea is to partition the visibility region into four quadrants. Within each quadrant, we compute a Pareto front over the vertices, which primarily requires sorting followed by a sequential scan.
Empirical evaluation.
We analyze the practical complexity333Code and data can be found at https://github.com/KaiKobbe/dispersive_agp_solver. by addressing the following research questions:
- RQ1
-
Among the available SAT solvers, which one performs best for our problem?
- RQ2
-
Which approach – MIP, CP-SAT, or SAT – yields the best performance?
- RQ3
-
How does the runtime vary across different types of orthogonal polygons?
- RQ4
-
How is the total runtime distributed among the individual computational steps?
To answer these questions, we use a benchmark of instances, consisting of randomly generated office-like polygons and orthogonal polygons from the SBGDB [11], with up to vertices. The office-like polygons, generated with and without holes, are created by iteratively placing randomly sized rooms in the plane, ensuring connectivity through corridors. Additional corridors are added to introduce holes where applicable. We generated instances for each multiple of vertices, ranging from to .
All instances were executed once for each solver on an Ubuntu Linux workstation equipped with an AMD Ryzen 9 7900 processor and of RAM. The implementation was written in Python 3.12.8 using PySAT 1.8dev14, OR-Tools 9.11.4210, and Gurobi 12.0.1. Geometric computations were performed in C++ using CGAL 5.6.1 and integrated via PyBind11.
- RQ1
-
Figure 12 (top) indicates that all SAT solvers perform similarly, with Glucose4 demonstrating a slight performance advantage. Consequently, we select Glucose4 as the default SAT solver for the subsequent experiments.
- RQ2
-
Figure 12 (bottom) demonstrates that the SAT-based approach significantly outperforms the MIP and CP-SAT approaches, requiring only a fraction of the time, particularly for orthogonal polygons. While CP-SAT was still able to solve all instances within , Gurobi failed to solve instances, despite being faster for smaller instances.
- RQ3
-
While MIP and CP-SAT can handle office-like polygons significantly faster than orthogonal polygons, the SAT-based approach shows no significant runtime difference between polygon types. Overall, neither holes nor the type of orthogonal polygon substantially impact the runtime of the SAT-based approach. However, these factors do influence the MIP and CP-SAT approaches visibly.
- RQ4
-
For instances with at least vertices, the SAT-based approach spends on average of the overall runtime of on building the witness sets. On average, probes of the objective value are required, of which result in infeasibility. The time spent in the SAT solver is only on average, with the remaining time spent on building the models.
6 Conclusions
We conducted an extensive investigation of the Dispersive AGP within orthogonal polygons, focusing specifically on office-like polygons, and established a range of results. To this end, we distinguished between cases where polygon vertices are restricted to integer coordinates and those where they are not.
On the theoretical side, we proved that the problem is -complete, even for independent office-like polygons. In particular, we showed hardness of deciding whether there exists a guard set that realizes a dispersion distance of in office-like polygons with vertices at integer coordinates. The construction also shows that the same holds true for polyominoes. Complementarily, we presented polynomial-time algorithms for computing worst-case optimal solutions of dispersion distance . For independent office-like polygons without holes, we further introduced a dynamic programming approach that efficiently computes the optimal solution in polynomial time. It remains an open question whether the dynamic programming approach can be extended to accommodate the case where corridors are not independent. Moreover, the question of whether guard sets with a dispersion distance of can be computed in polynomial time for polyominoes containing holes remains unresolved.
On the practical side, despite the problem’s theoretical complexity, we demonstrated its practical tractability for arbitrary orthogonal polygons under the constraint of -visibility, at least for random instances up to a size of vertices.
While research has focused on the problem with vertex guards, the variant involving point guards remains an open question.
References
- [1] Mikkel Abrahamsen, Anna Adamaszek, and Tillmann Miltzow. Irrational guards are sometimes needed. In Symposium on Computational Geometry (SoCG), pages 3:1–3:15, 2017. doi:10.4230/LIPIcs.SoCG.2017.3.
- [2] Mikkel Abrahamsen, Anna Adamaszek, and Tillmann Miltzow. The art gallery problem is -complete. Journal of the ACM, 69(1):4:1–4:70, 2022. doi:10.1145/3486220.
- [3] Andreas Bärtschi, Subir Kumar Ghosh, Matús Mihalák, Thomas Tschager, and Peter Widmayer. Improved bounds for the conflict-free chromatic art gallery problem. In Symposium on Computational Geometry (SoCG), pages 144–153, 2014. doi:10.1145/2582112.2582117.
- [4] Andreas Bärtschi and Subhash Suri. Conflict-free chromatic art gallery coverage. Algorithmica, 68(1):265–283, 2014. doi:10.1007/s00453-012-9732-5.
- [5] Christoph Baur and Sándor P. Fekete. Approximation of geometric dispersion problems. Algorithmica, 30(3):451–470, 2001. doi:10.1007/BFb0053964.
- [6] Piotr Berman, Marek Karpinski, and Alex D. Scott. Approximation hardness and satisfiability of bounded occurrence instances of SAT. Electronic Colloquium on Computational Complexity, TR03, 2003. URL: https://eccc.weizmann.ac.il/report/2003/022/.
- [7] Paola Cappanera. A survey on obnoxious facility location problems. Technical report, University of Pisa, 1999. URL: https://dl.acm.org/doi/abs/10.5555/898115.
- [8] Márcia R. Cerioli, Luérbio Faria, Talita O. Ferreira, Carlos A. J. Martinhon, Fábio Protti, and Bruce A. Reed. Partition into cliques for cubic graphs: Planar case, complexity and approximation. Discrete Applied Mathematics, 156(12):2270–2278, 2008. doi:10.1016/J.DAM.2007.10.015.
- [9] Marcelo C. Couto, Pedro Jussieu de Rezende, and Cid C. de Souza. An exact algorithm for minimizing vertex guards on art galleries. International Transactions in Operational Research, 18:425–448, 2011. doi:10.1111/j.1475-3995.2011.00804.x.
- [10] Vasco Cruz and Ana Paula Tomás. On -guarding SCOTs - A new family of orthogonal polygons. In Latin American Symposium on Theoretical Informatics (LATIN), pages 713–729, 2022. doi:10.1007/978-3-031-20624-5_43.
- [11] Günther Eder, Martin Held, Steinþór Jasonarson, Philipp Mayer, and Peter Palfrader. Salzburg database of polygonal data: Polygons and their generators. Data in Brief, 31:105984, 2020. doi:10.1016/j.dib.2020.105984.
- [12] Lawrence H. Erickson and Steven M. LaValle. A chromatic art gallery problem. Technical report, University of Illinois, 2010.
- [13] Lawrence H. Erickson and Steven M. LaValle. An art gallery approach to ensuring that landmarks are distinguishable. In Robotics: Science and Systems VII, 2011. doi:10.15607/RSS.2011.VII.011.
- [14] Sándor P. Fekete, Stephan Friedrichs, Michael Hemmer, Joseph S. B. Mitchell, and Christiane Schmidt. On the chromatic art gallery problem. In Canadian Conference on Computational Geometry (CCCG), 2014. URL: https://cccg.ca/proceedings/2014/papers/paper11.pdf.
- [15] Sándor P. Fekete, Joseph S. B. Mitchell, Christian Rieck, Christian Scheffer, and Christiane Schmidt. Dispersive vertex guarding for simple and non-simple polygons. In Canadian Conference on Computational Geometry (CCCG), pages 33–40, 2024. URL: https://cosc.brocku.ca/˜rnishat/CCCG_2024_proceedings.pdf#section.0.4.
- [16] Sándor P. Fekete, Kai Kobbe, Dominik Krupke, Joseph S. B. Mitchell, Christian Rieck, and Christian Scheffer. Guarding offices with maximum dispersion, 2025. doi:10.48550/arXiv.2506.21307.
- [17] Jirí Fiala, Jan Kratochvíl, and Andrzej Proskurowski. Systems of distant representatives. Discrete Applied Mathematics, 145(2):306–316, 2005. doi:10.1016/J.DAM.2004.02.018.
- [18] M. R. Garey and David S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman, 1979.
- [19] Frank Hoffmann, Klaus Kriegel, Subhash Suri, Kevin Verbeek, and Max Willert. Tight bounds for conflict-free chromatic guarding of orthogonal art galleries. Computational Geometry, 73:24–34, 2018. doi:10.1016/j.comgeo.2018.01.003.
- [20] Chuzo Iwamoto and Tatsuaki Ibusuki. Computational complexity of the chromatic art gallery problem for orthogonal polygons. In Conference and Workshops on Algorithms and Computation (WALCOM), pages 146–157, 2020. doi:10.1007/978-3-030-39881-1_13.
- [21] Chuzo Iwamoto and Toshihiko Kume. Computational complexity of the -visibility guard set problem for polyominoes. In Discrete and Computational Geometry and Graphs, pages 87–95, 2014. doi:10.1007/978-3-319-13287-7_8.
- [22] Kai Kobbe and Dominik Krupke. dispersive_agp_solver. Software, German Research Foundation (DFG), project “CG:SHOP”, FE 407/21-1, swhId: swh:1:dir:f655f369c667ab3b9b7b7afff427303919d67cdc (visited on 2025-08-07). URL: https://github.com/KaiKobbe/dispersive_agp_solver, doi:10.4230/artifacts.24341.
- [23] D. T. Lee and Arthur K. Lin. Computational complexity of art gallery problems. IEEE Transactions on Information Theory, 32(2):276–282, 1986. doi:10.1109/TIT.1986.1057165.
- [24] Avraham Margalit and Gary D. Knott. An algorithm for computing the union, intersection or difference of two polygons. Computers & Graphics, 13(2):167–183, 1989. doi:10.1016/0097-8493(89)90059-9.
- [25] Lucas Meijer and Tillmann Miltzow. Sometimes two irrational guards are needed, 2024. doi:10.48550/arXiv.2212.01211.
- [26] Joseph O’Rourke. Art gallery theorems and algorithms. Oxford New York, NY, USA, 1987.
- [27] Christian Rieck and Christian Scheffer. The dispersive art gallery problem. Computational Geometry, 117:102054, 2024. doi:10.1016/j.comgeo.2023.102054.
- [28] Dietmar Schuchardt and Hans-Dietrich Hecker. Two NP-hard Art-Gallery problems for ortho-polygons. Mathematical Logic Quarterly, 41:261–267, 1995. doi:10.1002/malq.19950410212.
- [29] Thomas C. Shermer. Recent results in art galleries (geometry). Proceedings of the IEEE, 80(9):1384–1399, 1992. doi:10.1109/5.163407.
- [30] Csaba D. Toth, Joseph O’Rourke, and Jacob E. Goodman. Handbook of Discrete and Computational Geometry. Discrete Mathematics and Its Applications. CRC Press, 2004.
- [31] Jorge Urrutia. Art gallery and illumination problems. In Handbook of Computational Geometry, pages 973–1027. Elsevier, 2000. doi:10.1016/b978-044482537-7/50023-1.
- [32] Chris Worman and J. Mark Keil. Polygon decomposition and the orthogonal art gallery problem. International Journal of Computational Geometry & Applications, 17(02):105–138, 2007. doi:10.1142/S0218195907002264.
