Abstract 1 Introduction 2 Worst-case optimality 3 Computational complexity 4 Dynamic programming for hole-free independent office-like polygons 5 Computing optimal solutions in practice 6 Conclusions References

Guarding Offices with Maximum Dispersion

Sándor P. Fekete ORCID Department of Computer Science, TU Braunschweig, Germany Kai Kobbe ORCID Department of Computer Science, TU Braunschweig, Germany Dominik Krupke ORCID Department of Computer Science, TU Braunschweig, Germany Joseph S. B. Mitchell ORCID Department of Applied Mathematics and Statistics, Stony Brook University, NY, USA Christian Rieck ORCID Department of Discrete Mathematics, University of Kassel, Germany Christian Scheffer ORCID Department of Electrical Engineering and Computer Science, Bochum University of Applied Sciences, Germany
Abstract

We investigate the Dispersive Art Gallery Problem with vertex guards and rectangular visibility (r-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 L1-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 4 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 3 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 2+ε is 𝖭𝖯-hard for any ε>0, 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 2.

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 1600 vertices in under 15 s.

Keywords and phrases:
Dispersive Art Gallery Problem, vertex guards, office-like polygons, orthogonal polygons, polyominoes, 𝖭𝖯-completeness, worst-case optimality, dynamic programming, SAT solver
Copyright and License:
[Uncaptioned image] © Sándor P. Fekete, Kai Kobbe, Dominik Krupke, Joseph S. B. Mitchell, Christian Rieck, and Christian Scheffer; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational geometry
Related Version:
Full Version: https://arxiv.org/abs/2506.21307 [16]
Supplementary Material:
Software  (Source Code): https://github.com/KaiKobbe/dispersive_agp_solver [22]
  archived at Software Heritage Logo 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ł Skrzypczak

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.

Figure 1: An office-like polygon with holes, along with a vertex guard set (shown as red and blue points) achieving maximum dispersion. Rooms are highlighted in light gray, and corridors in dark gray. The pair of blue guards represents the minimum geodesic distance among all pairs in the set.

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 r-visibility and L1-geodesics. Without loss of generality, we assume a minimum distance of 1 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 3 when vertices are restricted to integer coordinates, and 2 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 4 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 2+ε can be achieved for any ε>0 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 1600 vertices can be solved in under 15 s.

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 r-visibility (where two points u and v see each other if and only if the rectangle described by u and v 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 r-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 r-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 r-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 L1 geodesics and r-visibility. They proved that deciding whether a given thin polyomino allows a guard set with a dispersion distance of 5 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 3. Fekete et al. [15] extended this to vertex guards in polygons. They demonstrated that determining whether a guard set with a dispersion distance of 2 exists in polygons with holes is 𝖭𝖯-complete. Furthermore, they showed that a dispersion distance of 2 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 p𝒫 is visible by at least one point g𝒢. 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 p and q are said to see each other if the axis-aligned rectangle defined by p and q is entirely contained within 𝒫. The visibility region Vis(p)𝒫 of a point p is the set of all points that are visible from p. The size of a guard set is its number of guards. We measure the distance δ(p,q) between two points p,q𝒫 as L1-geodesics. With this, the dispersion distance of a guard set 𝒢 is the minimum geodesic L1-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 C1 and C2 are independent if no guard placed on a vertex of C1 also guards C2. 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.

(a)
(b)
Figure 2: A family of histogram polygons illustrating that the ratio between optimal solutions of the AGP and the dispersive AGP can differ significantly. Red and blue points indicate optimal vertex guard placements for AGP and dispersive AGP, respectively.

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 2; 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 3, 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 3; 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 3 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 3, 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 3 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.

(a)
(b)
Figure 3: A dispersion distance of 3 is (a) sometimes best possible and (b) always realizable.

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 3 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).

(a)
(b)
Figure 4: A dispersion distance of (a) 2+ε for every rational ε>0 is sometimes best possible, but (b) a dispersion distance of 2 is always realizable.

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 2. Furthermore, for every rational ε>0, there is such a polygon in which a dispersion distance of 2+ε is best possible.

We begin with observing that arrangements of densely packed corridors enforce small dispersion distances.

Lemma 3 ().

For every n and ε>0, there exists an office-like polygon with at least n vertices such that every guard set has a dispersion distance that is smaller than 2+ε.

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 1, and the red rectangles have a width of 0<τ<ε/2 for any ε(0,1).

We now give the idea that any guard set contains a guard in corridor C only if its dispersion distance is smaller than 2+ε. 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 2+ε that contains a guard at the bottom-left (top-left) vertex of C must contain all guards depicted in green (blue). However, this leads to a contradiction, as no guard can be placed with sufficient distance in C1 (or C2), i.e., there is no 2+ε-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 C. 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 2 is always realizable.

Lemma 4.

Every office-like polygon allows a guard set with dispersion distance at least 2.

Proof.

Our construction of a guard set with a dispersion distance of at least 2 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 2. We ensure that guards placed in different but adjacent rooms have at least a geodesic distance of 2 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 4 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 2×2 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 4 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 2+ε for any rational ε>0 in independent office-like polygons with holes is 𝖭𝖯-complete.

Membership in 𝖭𝖯 is relatively straightforward: First, we can compute the r-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 (P3Sat3¯¯[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 P3Sat3¯¯, 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 4, 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 3 of the vertices v and v.

Figure 5: Banning-type subpolygon.
Variable gadget.

The variable gadget is depicted in Figure 6. Banning-type gadgets on both sides prevent placing guards at the vertices f and f. 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.

Figure 6: Variable gadget for office-like polygons with vertices at integer coordinates.
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.

(a) 3-literal clause gadget.
(b) 2-literal clause gadget.
Figure 7: Clause gadgets for office-like polygons with vertices at integer coordinates.

In both cases, there exist guard sets with a dispersion distance of 4 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 90° 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 v of the outgoing corridor. Additionally, the remaining vertex of the outgoing corridor is at a distance of 3 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.

Figure 8: The bending gadget enables 90° turns within office-like polygons whose vertices lie on integer coordinates.

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.

(a) Variable gadget.
(b) Bending gadget.
(c) 2-literal clause.
(d) 3-literal clause.
Figure 9: Simpler gadgets for polyominoes. Note that the 3-clause gadget is shown solely for completeness, as it is equivalent to that for office-like polygons with vertices at integer coordinates.

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 2+ε for any ε>0. 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 n 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 𝒪(n2) 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 G(𝒫)=(V,E) represent 𝒫 as follows: There is a node vV for each room Rv of 𝒫, and an edge e={v,w}E if two rooms Rv and Rw are connected by a corridor Ce. We now fix an arbitrary in-arborescence G of G(𝒫), i.e., a directed tree with edges pointing towards a root, see Figure 10. For each node v of G, 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.

Figure 10: A hole-free independent office-like polygon 𝒫 with its corresponding in-arborescence for G(𝒫) with root r.

Preliminaries and subproblem definition

Consider a directed edge e=(u,v) in G and the maximal directed subtree T of G rooted at u. The branch B for e consists of the corridor Ce and all rooms and corridors corresponding to nodes and edges of T. We refer to the two vertices shared by Ce and Rv as the gate vertices (or gate) of B. For convenience, we define the branches rooted at v as those for edges of the form (,v). In Figure 10, the rooms and corridors outlined in red correspond to the branches B1 and B2 that are rooted at v, with corresponding gate vertices marked in white.

A guard set for a branch B consists of guards exclusively placed at vertices within B, ensuring coverage of every room and corridor in B. However, some guard sets for B also cover Rv (by placing a guard at a feasible gate vertex), while others do not. A set of configurations 𝒞 for B is a collection of guard sets for B, 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 𝒢B𝒢 denote the guards that are placed at vertices within B. Then, there always exists a configuration c𝒞 such that (𝒢𝒢B)c 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 G: When processing the root r of G, we solve the entire decision problem. Every other node v in G, is handled as follows: Let w denote the unique node such that there exists an edge from v to w in G. The goal is to find a set of configurations for the branch of (v,w). Note that, by the time we process v, all predecessor nodes have already been processed, and we therefore know a set of configurations for each branch rooted at v. 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 Be belonging to an edge e=(v,w). Consider all feasible guard placements on the vertices of a single corridor Ce and its incident room Rv; 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.

Figure 11: Schematic illustration of sensible guard placements at corners of Rv and in Ce (depicted red). When fixing one of the options, it suffices to find a guard set for e’s branch that has a dispersion distance of at least  and, among those, maximizes the distance to the respective blue vertex.

Furthermore, some of these guard sets are not sensible, as, e.g., placing two guards at corners of a room Rv is unnecessary, as both would have identical visibility polygons. Now, for every such placement X, we aim to derive a configuration for Be by selecting the guards in X along with one precomputed configuration for each branch rooted at v. However, choosing such a combination requires careful consideration of the following aspects:

(1) As mentioned above, some configurations for branches rooted at v do cover Rv, while others do not. Therefore, if X does not contain a guard in Rv, an arbitrary choice of configurations may result in Rv remaining uncovered. To address this issue, we fix a configuration (for some branch rooted at v) that places a guard at one of its gate vertices, and hence in Rv. To ensure correctness, we probe every possible option.

(2) By definition, all pairs of guards within a single configuration c maintain a minimum dispersion distance of ; however, this condition may be violated when considering interactions between guards in X and those in c. In such instances, the configuration c is deemed invalid and consequently excluded from further consideration.

(3) When computing the configuration c that contains the guard set X, our goal is to ensure that whenever there exists a guard set for 𝒫 with a dispersion distance of at least  that includes X, then there also exists such a guard set that includes c. Leveraging on the fact that 𝒫 is independent, we arrive at the following crucial observation.

Observation 9.

Consider two vertices n1,n2 in 𝒫 such that n1 is inside, and n2 is outside of a branch B. Then, there always exists a shortest geodesic L1-path between n1 and n2 that passes through one of the gate vertices of B.

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 Ce. Therefore, when considering a fixed placement X, the following holds for one gate vertex g of Be: when all guards in the chosen configuration maximize their minimum distance to g, the distance to the other gate vertex of Be is maximized as well. For an exemplary illustration, consider the blue vertices in Figure 11. With Observation 9, this is best possible when using X.

We now want to choose a configuration with these properties. To achieve this, we perform a binary search over the 𝒪(n2) pairwise vertex distances in 𝒫, aiming to find the choice of configurations for branches rooted at v that maximizes the distance to g. For each distance  considered during the current step of the binary search, we discard all configurations of branches rooted at v where a guard has a distance less than  to g.

(4) After addressing the aforementioned aspects, the crucial task is to select one configuration for each branch rooted at v 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 k in the following auxiliary graph, where k denotes the number of branches rooted at v: Each configuration of a branch rooted at v is represented by a node. Two nodes are connected by an edge if both corresponding configurations c1,c2 belong to the same branch, or if there exists a guard g1c1 and a guard g2c2 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 Rv, 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 G. The binary search on the possible dispersion distances to solve the maximization problem takes an additional logarithmic factor. This yields a total runtime of 𝒪(tnnlogn), where tn 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 𝒪(n4logn) in the full version of our paper [16]. With this, the total runtime of the dynamic programming approach is 𝒪(n5log2n).

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 xg𝔹 for each vertex gV(𝒫) in polygon 𝒫 to indicate guard placement and a continuous variable 0+ for the dispersion distance. The objective maximizes , subject to (i) w𝒲:gV(𝒫),wVis(g)xg1, ensuring every witness in 𝒲 is covered, and (ii) g,gV(𝒫):xgxgδ(g,g), enforcing that no two guards g,gV(𝒫) with distance δ(g,g) 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 𝒪(n2) possible objective values to check for feasibility. For a fixed , feasibility is determined by the constraints w𝒲(gV(𝒫),wVis(g)xg), ensuring coverage, and g,gV(𝒫),δ(g,g)<(xg¯xg¯), 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 r-visibility constraints. For computing the r-visibility polygons, we implemented a simple 𝒪(nlogn) 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 2344 instances, consisting of 1599 randomly generated office-like polygons and 745 orthogonal polygons from the SBGDB [11], with up to 1600 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 20 instances for each multiple of 40 vertices, ranging from 40 to 1600.

All instances were executed once for each solver on an Ubuntu Linux workstation equipped with an AMD Ryzen 9 7900 processor and 96 GB 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 300 s, Gurobi failed to solve 30 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 1500 vertices, the SAT-based approach spends on average 4.397 s of the overall runtime of 10.475 s on building the witness sets. On average, 14.69 probes of the objective value are required, of which 11.56 result in infeasibility. The time spent in the SAT solver is only 0.011 s on average, with the remaining time spent on building the models.

Figure 12: (top) Comparison of the different SAT solvers. (bottom) Comparison of the runtime (limited to 300 s) of the different approaches on different instance types.

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 4 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 3. 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 3 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 r-visibility, at least for random instances up to a size of 1600 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 r-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 r-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.