Smoothed Analysis of the Art Gallery Problem
SSmoothed Analysis of the Art Gallery Problem
Michael Gene Dobbins , Andreas Holmsen , and Tillmann Miltzow Department of Mathematical Sciences, Binghamton University Department of Mathematical Sciences, KAIST Department of Information and Computing Sciences, Utrecht University
Abstract
In the Art Gallery Problem we are given a polygon P ⊂ [0 , L ] on n vertices and a number k . Wewant to find a guard set G of size k , such that each point in P is seen by a guard in G . Formally, aguard g sees a point p ∈ P if the line segment pg is fully contained inside P .The only, currently known, correct algorithm to solve the Art Gallery Problem exactly, uses algebraicmethods [27, 28]. Due to the recent result that the Art Gallery Problem is ∃ R -complete [3], it seemsunlikely that algebraic methods can be avoided for any exact algorithm. On the other hand, any examplethat requires irrational coordinates, or has a unique solution is vulnerable , to small perturbations, i.e.looses that property after a random perturbation. Furthermore, it took more than four decades tocome up with an example where irrational coordinates are required [2]. Lastly, there is a series ofpapers that implement algorithms that give optimal solutions to medium sized simulated instances (5000vertices) [24]. The history and practical findings therefore indicate that irrational coordinates are a “veryrare” phenomenon to find in an optimal solution. In this paper we give a theoretical explanation.Next to worst case analysis, Smoothed Analysis gained popularity to explain the practical performanceof algorithms, even if they perform badly in the worst case. Smoothed Analysis is an interpolation betweenaverage case analysis and worst case analysis. The idea is to study the expected performance on smallperturbations of the worst input. The performance is measured in terms of the magnitude δ of theperturbation and the input size. We consider four different models of perturbation. ( (a) Minkowski-Inflation, (b)
Edge-Inflation, (c)
Edge-Perturbation, and (d)
Vertex-Perturbation.) We show that theexpected number of bits to describe optimal guard positions equals( a ) , ( b ) , ( c ) O (cid:18) log (cid:18) nLδ (cid:19)(cid:19) , ( d ) O (cid:18) log (cid:18) nLδβ (cid:19)(cid:19) , per guard, where the value β denotes the minimum of the interior and exterior angle of the polygon. Thisshows from a theoretical perspective that rational guards with small bit-complexity are typical . Notethat describing the guard position is the bottleneck to show NP-membership. To illustrate our findingsmore, we consider a discrete model of Edge-Inflation. We can show that the resulting instances can besolved with high probability in non-deterministic polynomial time, by the Naive Algorithm . The NaiveAlgorithm guesses the correct guard positions and checks if they are guarding the entire polygon. As asimple corollary, we can show that there is an algorithm that solves the Art Gallery Problem in expectednon-deterministic polynomial time on a Turing Machine, however, that algorithm uses algebraic methodswith small probability. In a continuous model of perturbation, we show that the Naive Algorithm runsin expected non-deterministic time, but spends and additional O ( n ) time on a real RAM , in order tocheck that the guards are correct. Avoiding the real RAM is impossible for continuous perturbations asthe coordinates of the vertices of the resulting polygons are given by real numbers. As a corollary, weshow correctness of an approximation algorithm in the smoothed analysis setting.The significance of our results is that algebraic methods are not needed to solve the Art GalleryProblem in typical instances. This is the first time an ∃ R -complete problem was analyzed by SmoothedAnalysis. a r X i v : . [ c s . C G ] N ov Introduction
Definition of the Art Gallery Problem
In the Art Gallery Problem we are given a polygon P and anumber k . We want to find a guard set G of size k , such that each point in P is seen by a guard in G .Formally, a guard g sees a point p ∈ P if the line segment pg is fully contained inside P . We usually denotethe vertices of P by v , . . . , v n , and the number of vertices by n . The Art Gallery Problem has been one of the core problems in Computational Geometry ever since itsintroduction by Victor Klee in 1973. Much of its popularity may stem from the metaphor, referring toan actual gallery, with actual guards. However, bear in mind that the problem is, although motivated bypractice, a theoretical one about visibility and geometric set-cover. One of the earliest results states that anypolygon on n vertices can be guarded by (cid:98) n/ (cid:99) guards, and sometimes that many guards are needed [20]. Abeautiful five line proof of this fact was given by Steve Fisk [33].A significant amount of the literature on the Art Gallery Problem studies variants of the problem, but tosurvey these results lies outside the scope of this paper. Variants can be defined by restricting the positionof the guards, restricting the shape of the polygon, and altering the notion of visibility. The majority ofresults either give combinatorial results or study algorithmic aspects. Recently, Bhattacharya, Ghosh andPal announced a breakthrough, where they reported a constant factor-approximation algorithm for the casewhen the guards are restricted to lie on the vertices [12]. For further references we recommend the surveyand books on the Art Gallery Problem and visibility problems in general [51, 53].Regarding the classical variant, surprisingly little is known. In 1979 appeared a linear time algorithm toguard a polygon with one guard [44], and an O ( n ) algorithm to guard a polygon with two guards appearedin the 1991 Master thesis of Belleville [10, 11]. Up until 2002 it was not even known whether the Art GalleryProblem is decidable. Decidability of the Art Gallery Problem was pointed out by Micha Sharir, who showedhow to encode the Art Gallery Problem into the first order theory of the reals [27, See Acknowledgment]. Asthere exist algorithms to decide the first order theory of the reals, the Art Gallery Problem is decidable [7].In particular, the algorithm runs in n O ( k ) time, where n is the number of vertices and k is the number ofguards. (Here, we assume that every vertex is encoded using O (log n ) bits.) It was also shown that the ArtGallery Problem is W[1]-hard, and not solvable in time f ( k ) n o ( k/ log k ) , for any computable function f unlessthe Exponential Time Hypothesis fails [13]. (The Exponential Time Hypothesis states essentially that 3SATon N variables cannot be solved in 2 o ( N ) .) This indicates that the running time of Sharir’s algorithm is bestpossible, but it does not resolve the question, whether algebraic methods are required.The first approximation algorithm was established by Bonnet and Miltzow in 2016. Using some mildassumptions, they showed that a fine grid contains a solution that is at most a factor 9 away from theoptimum [14]. Combined with a result of Efrat and Har-Peled [28], this yielded the first approximationalgorithm for the Art Gallery Problem.From the complexity perspective the problem was studied almost exclusively from the perspective ofNP-hardness and inapproximability [4, 29, 43, 66], while the question of NP-membership was rarely asked.A first doubt of NP-membership was raised in 2017, when Abrahamsen, Adamaszek and Miltzow showedthat there exists polygons with vertices given by integer coordinates, that can be guarded by three guards,in which case some guards must necessarily have irrational coordinates [2]. (It is an open problem whetherirrational guards may be required for polygons which can be guarded by two guards.)Shortly after, the same authors could show that the Art Gallery Problem is complete for the complexityclass ∃ R [3]. ∃ R -completeness can also be stated as follows. The Art Gallery Problem is equivalent, underpolynomial time reductions, to deciding whether a system of polynomial equations has a solution. Thisimplies that it seems unlikely that the algebraic algorithms used by Sharir to solve the Art Gallery Problemcan be avoided, to give optimal solutions in the worst case . We will discuss the complexity class ∃ R later inmore detail. Assuming NP (cid:54) = ∃ R , we can conclude that the Art Gallery Problem is not contained in NP.While those theoretical results are quite negative, the history and practical experiences tell a morepositive story. First of all, it took more than four decades before an example could be found that requires2rrational guards [2]. Moreover, that example is highly vulnerable to small perturbations, meaning thatsmall perturbations lead to a polygon that can be guarded optimally by guards with rational coordinates.Regarding the practical study of the Art Gallery Problem, we want to point out that several researchershave implemented heuristics, that were capable of finding optimal solutions for a large class of simulatedinstances [5, 15–17, 21, 22, 24, 34, 42]. Even up to 5000 vertices.Let us point out that several researchers have asked whether the Art Gallery Problem requires irrationalcoordinates [1, 24, 32, 35, 59]. While Abrahamsen, Adamaszek and Miltzow [2, 3] gave a negative answerfor the worst case scenario, we give a positive answer for typical instances.We summarize that there is a large discrepancy between the theoretical findings that the Art GalleryProblem is ∃ R -complete and the practical observation that there usually exists an optimal solution withrational coordinates. Our results explain this discrepancy. ∃ R A new complexity class began to emerge around the existential theory of the reals in the 1980s [68], andmore recently the notation ∃ R was introduced along with the formal definition [62]. The class ∃ R is theclass of all decision problems that are many-one reducible in polynomial time to deciding whether a givenpolynomial Q ∈ Z [ x , . . . , x n ] has a real root, i.e. a solution x ∈ R n such that Q ( x ) = 0. From the field ofreal algebraic geometry [7], we know that NP ⊆ ∃ R ⊆ PSPACE . At its core, hardness for ∃ R provides an explanation for why some problems may not lie in NP.One of the most famous algorithmic questions is the recognition of segment intersection graphs . Here,we are given a graph and we are asked to decide whether there exists a set of segments which represent thegraph in the following way: every segment represents a vertex of the graph and two segments intersect ifand only if their corresponding vertices are adjacent. It is easy to believe that the problem lies in NP. By asimple perturbation argument, it can be assumed that all coordinates of segment endpoints are representedby integers, and as long as the number of bits needed to represent them can be bounded by some polynomial,we would be done. Indeed, Matouˇsek [47] comments that“Serious people seriously conjectured that the number of digits can be polynomially bounded—but it cannot.”Indeed McDiarmid and M¨uller have shown that the number of bits needed to represent certain families ofsegment intersection graphs is at least 2 Ω( n ) [48]. Similar large coordinate phenomena have been observedalso for other geometric problems [37]. However, this does not exclude that those respective problems lie inNP, as it may be possible to describe a different certificate of polynomial size. Indeed recognition of stringgraphs is in NP [54, 55, 63, 64], although there are families which require an exponential number of crossingsin any string representation [41].The complexity class ∃ R provides a tool to give much more compelling arguments that a problem maynot lie in NP than merely observing that the naive way of placing the problem into NP does not work.Indeed various problems have been shown to be ∃ R -complete [18, 19, 26, 36, 39, 45, 57, 62, 67] and thuseither non of them lie in NP or all of them do.Another important aspect of ∃ R -complete problems is that we have no chance of solving even smallinstances (with the current methods), as the constants in the known algebraic algorithms are too large.Most relevant in our context is the ∃ R -completeness that was shown by Abrahamsen, Adamaszek andMiltzow in 2017 [3]. In 1987, O’Rourke [51, page 232] commented on the NP-membership in his famousbook on the Art Gallery Problem as follows: Previously, ETR (Existential Theory of the Reals) had been used ambiguously to refer to the formal language, the corre-sponding decision problem, or its algorithmic complexity. ∃ R -completeness implies that there is no algorithm, which runs in polynomial non-deterministic timeand can solve the Art Gallery Problem always, unless NP = ∃ R . This result is our main motivation, to see ifthere is a simple algorithm that solves the Art Gallery Problem. As we don’t expect that such an algorithmis correct in the worst case, we turn our attention to different ways to analyze algorithms. Some algorithms perform much better than predicted by their worst case analysis. The most famous ex-ample seems to be the Simplex-Algorithm. It is an algorithm that solves linear programming efficiently inpractice, although it is known that there are instances for seemingly all variants of the algorithm that take anexponential amount of time (see for instance [40]). There are several possible ways to explain this behavior.For example, it could be that all practical instances have some structural properties, which we have not yetdiscovered. We could imagine that a more clever analysis of the Simplex-Algorithm would yield that it runsin polynomial time, assuming the property is presented. To the best of our knowledge such a property hasnot yet been identified. Another approach would be to argue that worst case examples are just very “rarein practice”. The problem with this approach is that it is difficult to formalize.
Average Case Analysis
The first approach is to assume that a “practical instance” is drawn uniformlyat random from all possible instances. This is also called average case analysis. The first problem with thisapproach is that we have to choose a probability space. The second problem is that practical instances areoften highly structured. For instance, planar graphs play an important role in many situations, but almostnever appear if each edge is drawn randomly with probability 1 /
2. The third problem is that it only saysthat a big portion of the probability space behaves nicely, but there might still be a big region in the spaceof instances which is really bad. And maybe that region is actually of practical relevance.
Smoothed Analysis
The second approach is a nice combination of the average case and the worst caseanalysis and generally referred to as Smoothed Analysis, as it smoothly interpolates between the two. It wasdeveloped by Spielman and Teng [69], who introduced the field in their celebrated seminal paper “SmoothedAnalysis of algorithms: Why the simplex algorithm usually takes polynomial time”. Both authors receivedthe G¨odel Prize in 2008, and the paper was one of the winners of the Fulkerson Prize in 2009. In 2010Spielman received the Nevanlinna Prize for developing Smoothed Analysis.The smoothed expected running time can be defined as follows: Let us fix some δ , which describes themaximum magnitude of perturbation. We denote by (Ω δ , µ δ ) a corresponding probability space where each x ∈ Ω δ defines for each instance I a new ‘perturbed’ instance I x . We denote by T ( I x ), the time to solve theinstance I x . Now the smoothed expected running time of instance I equals T δ ( I ) = E x ∈ Ω δ T ( I x ) = (cid:90) x ∈ Ω δ T ( x ) µ δ ( x ) . If we denote by Γ n the set of instances of size n , then the smoothed running time equals: T smooth( n ) = max I ∈ Γ n E x ∈ Ω δ T ( I x ) . Roughly speaking this can be interpreted as saying, that not only do the majority of instances have to behavenicely, but actually in every neighborhood the majority of instances behave nicely. The expected runningtime is measured in terms of n and δ . If the expected running time is small in terms of 1 /δ then this means4hat difficult instances are fragile with respect to perturbations. This serves as theoretical explanation whysuch instances may not appear in practice.It is not a priori clear how this probability space Ω δ should be defined. It is easy, if our object is a pointin Euclidean space and proximity can be defined by Euclidean distance, but less obvious if your object is apermutation or a polygonal region in the plane.Although the concept of Smoothed Analysis is more complicated than simple worst case analysis, it is anew success story in theoretical computer science. It could be shown that various algorithms actually runin polynomial time, explaining very well their practical performance.One of the highlights is an analysis of the Nemhauser-Ullmann Algorithm [49] for the knapsack problemrunning in smoothed polynomial time [8]. Those results could be generalized, yielding that every binaryoptimization problem can be solved in smoothed polynomial time if and only if it can be solved in pseu-dopolynomial time [9]. Other famous examples are the Smoothed Analysis of k -means algorithm [6], the2-OPT TSP local search algorithm [30], and the local search algorithm for MaxCut [31]. Recently, thesmoothed number of faces on the convex hull of a point set was analyzed under Gaussian noise [25]. Thecurrently best analysis of the Simplex Algorithm yields a running time of O ( d √ log n σ − + d log / n ), with d the number of variables, σ the variance of Gaussian noise, and n the number of constraints [23]. We referthe interested reader to surveys, mini-courses, and lecture notes [46, 58, 60, 61]. We now define the models of perturbation which we find relevant for the Art Gallery Problem. See Figure 1for an illustration. We will also explicitly state our assumptions on the underlying polygons. For all ourprobability spaces Ω δ , we are using the uniform distribution. (a) The polygon together with an Edge-Inflation. (b) If we continue the edges, of a Minkowski-Inflation, we get an Edge-Inflation.(c) The Minkowski-sum of a poly-gon together with a disk. (d) A Vertex-Perturbation. (e) A random Edge-Perturbation.Note that all angles of edges arepreserved. Figure 1: Overview, over various models, how a polygon can be perturbed.
Vertex-Perturbation
Given a polygon P on n vertices v , . . . , v n and a vector u = ( u , . . . , u n ) ∈ R n ,we denote by P u the polygon with vertices v (cid:48) i = v i + ( u i − , u i ). We say that u ∈ R n represents a Vertex-Perturbation of magnitude δ , if for every i holds that u i − + u i ≤ δ . See Figure 1d for an illustration. Wedefine the corresponding probability space as Ω δ = disk( δ ) n . (We define disk( δ ) = { x ∈ R : x + x ≤ δ } .)5 inkowski-Inflation Given a polygon P on n vertices v , . . . , v n and a number t ∈ R , we denote by P t = P ⊕ disk( t ) ⊆ R the Minkowski-Inflation of P by t , see Figure 1c. We say the magnitude of theinflation is at most δ in case that t ≤ δ . We define the corresponding probability space as Ω δ = [0 , δ ]. Recallthat given two sets A, B ⊂ R , the Minkowski-sum is defined as A ⊕ B = { x + y ∈ R : x ∈ A and y ∈ B } . Edge-Inflation
Let P and P (cid:48) be polygons on the same number of vertices. We say edge e is shifted inpolygon P (cid:48) , if there is a corresponding edge e (cid:48) in P (cid:48) and e and e (cid:48) are parallel. The shift has magnitude t ,if the distance of the supporting lines of e and e (cid:48) is t . We distinguish between a shift to the outside and tothe inside in the obvious way. We say P t is an Edge-Inflation of P if every edge of P is shifted by t to theoutside in P t . See Figure 1a. We say the magnitude of the inflation is at most δ in case that t ≤ δ . Wedefine the corresponding probability space as Ω δ = [0 , δ ].We also define a discrete probability space Ω δ,q = { iδq : 0 ≤ i ≤ q − } ⊆ [0 , δ ]. Here q ∈ N indicates the granularity of the perturbation. Furthermore, we assume δ ∈ Q . Consider the example of the triangle ∆ onthe vertices (0 , , (1 , , (0 , r ∈ Q holds that the Edge-Inflation ∆ r does not have rational coordinates. However, it is easy to give an explicit description of the coordinates,using radicals, i.e., square-roots. Edge-Perturbation
Given a polygon P and ( t , . . . , t n ) = v ∈ [ − δ, δ ] n = Ω δ , we define the Edge-Perturbation P v by shifting the i -th edge of the polygon P by t i , either inside or outside. (Dependingon the sign of t i .) See Figure 1e for an illustration. Pointedness
Given a polygon P we define the pointedness β = β ( P ) as follows: Let α be the smallestinterior or exterior angle of P , then β = α/
8. We assume that the interior or exterior angle does not changeby more than a factor of 2 by any perturbation considered in this paper. This can be achieved by havingthe perturbation sufficiently small. As a consequence of this assumption every interior and exterior anglewill be always at least 4 β for any Vertex-Perturbation that we consider. The Naive Algorithm
The Naive Algorithm is guessing non-deterministically those coordinates, with aminimum number of bits needed to describe an optimal guard set. Thereafter the Naive Algorithm checks ifthose guessed guards are indeed guarding the entire polygon. The Naive Algorithm will fail in case that thereis no way to guard the given polygon optimally by guards whose coordinates can be described by rationalnumbers. In that case, we say that the running time is infinite.
Assumptions and Model of Computation
In this paper we are working with two different models ofcomputation, which is a consequence of the model of perturbation that we are using.In the first model, we are using a continuous model of perturbation. In that case, the polygon is describedby real numbers. Consequently, we assume that we can do computations on the real RAM. It is crucialhowever that the non-deterministic part of the computation cannot guess real numbers, but only rationalnumbers. We measure the non-deterministic time of the algorithm in terms of the number of bits that areneeded to represent the rational numbers that are guessed by the algorithm.In the second model, we are using a discrete model of perturbation. In this setting, we are assuming thatthe vertices of the input polygon can be described by rational numbers. However, this does not lead alwaysto rational vertices of the perturbed polygon, as we pointed out above. Nevertheless, as we will argue, wecan do all basic operations on a word RAM.Otherwise we are not making any assumptions on the polygons themselves. In particular, the polygonmay have holes. However, note that if the perturbation is too large in comparison to the polygon, then theperturbed polygon may not be well-defined. This does not cause any serious issues since Smoothed Analysisusually applies in settings where the perturbation is thought of as relatively small. So without defining thisformally, we will throughout the entire paper assume that the perturbation is sufficiently small, such that theperturbation defines a polygon. In case of Minkowski-Inflation, the output region is not a polygon anymore.We can still reason about it, by making the assumption that we can do basic operations (like computing6isibility regions and determine if a point is inside the regions, etc.). Although, the Minkowski-Inflation is animportant technical step for us, it is not the most important perturbation model. Thus, we will not discusshow realistic these assumptions are.
Our main result states that typical instances do not require irrational guards and the expected number of bitsper guard is logarithmic. The result establishes that algebraic methods are not needed in typical instances.
Theorem 1 (Bit-complexity) . Let P be a polygon, suppose P ⊂ [0 , L ] for some positive integer L , and let β denote the pointedness of P . If δ > is the magnitude of a (a) Minkowski-Inflation (b)
Edge-Inflation (c)
Edge-Perturbation (d)
Vertex-Perturbation,then the expected number of bits per guard to describe an optimal solution equals (a),(b),(c) O (cid:0) log (cid:0) nLδ (cid:1)(cid:1) (d) O (cid:16) log (cid:16) nLδβ (cid:17)(cid:17) . As a simple corollary of the proof, we get that a fine grid of expected width w = 2 O (log( nL/δ )) = ( nL/δ ) O (1) will contain an optimal guarding set. This may appear at first sight as a candidate set of polynomial size,however recall that the vertices are given in binary and thus L may be exponential in the input size.Theorem 1 leads immediately to a non-deterministic polynomial time algorithm for the Art GalleryProblem in the Smoothed Analysis model. However, we still need the real RAM to test if the guard positionsare correct. Theorem 2 (Expected NP-time) . Let P be a polygon, suppose P ⊂ [0 , L ] for some positive integer L , andlet β denote the pointedness of P . If δ > is the magnitude of a (a) Minkowski-Inflation (b)
Edge-Inflation (c)
Edge-Perturbation (d)
Vertex-Perturbation,then the Naive Algorithm runs in expected (a),(b),(c) O (cid:0) n log (cid:0) nLδ (cid:1)(cid:1) (d) O (cid:16) n log (cid:16) nLδβ (cid:17)(cid:17) non-deterministic time. Furthermore, the algorithm takes an additional O ( n ) deterministic time on areal RAM. To avoid the real RAM, we switch to a discrete model of perturbation and focus solely on the Edge-Inflation. Note that we know that some instances of the Art Gallery Problem require irrational guards andthe Naive Algorithm would have an infinite running time. Thus we cannot expect to acquire a finite expectedrunning time over a finite probability space.
Theorem 3 (NP-time With High Probability) . Let P be a polygon and suppose P ⊂ [0 , L ] for some positiveinteger L . If δ > is the magnitude of a discrete Edge-Inflation with granularity q sufficiently large ( q > np is sufficient), then the Naive Algorithm runs with probability − p in O ( n log Lnδp ) non-deterministic timeand some additional polynomial deterministic time on an ordinary Turing Machine. Note that the dependence on n, L, δ and β are in each case logarithmic. This is unusual compared to otherrunning times derived in Smoothed Analysis. Usually the dependence is (1 /δ ) c , where c is some constant,which is not always very small. The dependence on 1 /δ can be interpreted as how fragile the hard instancesare to perturbations, and here, a logarithmic dependence indicate that they are exponentially more fragilethan in other settings where Smoothed Analysis has been applied.More important than the analysis itself, is the fact that this is the first time any exact algorithm, withoutusing algebraic methods, could be shown to work correctly in a generally accepted theoretical model. Wehope that our analysis will inspire researchers to find ways to show that also other (more practical) algorithmsare correct in the Smoothed Analysis model or a different model.If we choose p from Theorem 3 sufficiently small, only a small fraction of the instances cannot be solvedby the Naive Algorithm. If we use algebraic methods for those instances, we easily get an algorithm thatruns in expected non-deterministic polynomial time. 7 heorem 4 (NP-time) . Let P be a polygon and suppose P ⊂ [0 , L ] for some positive integer L = n O (1) .If δ > is the magnitude of a discrete Edge-Inflation with granularity q sufficiently large ( q > n Ω( n ) issufficient), then there is an algorithm that runs in expected non-deterministic polynomial time on an ordinaryTuring Machine. Note that although Smoothed Analysis is a fairly involved concept, the proofs are relatively simple.It is tempting to think that one could improve the result by scaling the polygon such that it fits into aunit square. Note that in this case one also has to scale down the perturbation by the same magnitude andone obtains the same result.As a corollary, we can see that a fine grid contains an optimal solution in the Smoothed Analysis setting.Efrat and Har-Peled gave an approximation algorithm to a variant where guards are restricted to a grid [28].We repeat their theorem, reformulated and simplified slightly. Let
OP T ( P ) be an optimal guarding set ofthe polygon P , and let OP T ( P, C ) denote the optimal way to guard the polygon P , under the restrictionthat all guards need to lie on points in C . (We will only consider sets C , which are guarding P .) We say apolygon is simple if it does not contain any hole. Theorem (Efrat & Har-Peled [28]) . Given a simple polygon P with n vertices, one can spread a grid Γ inside P , and compute a guard set of size O ( | OP T ( P, Γ) · log | OP T ( P, Γ) | ) . The expected running time ofthe algorithm is O ( n log n log ∆ . ) , where ∆ is the ratio between the diameter of the polygon and the gridwidth. The algorithm runs on a real RAM. Note that the theorem does not assume that | OP T ( P, Γ) | and | OP T ( P ) | are related. Due to this gap,the algorithm was not known to be an approximation algorithm of the optimum. Bonnet and Miltzowfilled this gap, as they showed that a fine grid contains a constant factor approximation of the optimum,under some mild assumptions on the polygon. So in fact the algorithm of Efrat and Har-Peled provides an O (log | OP T ( P ) | )-approximation to the classical Art Gallery Problem [14]. Now the technical demandingproof by Bonnet and Miltzow can be replaced by a simple Smoothed Analysis. Also our analysis yields betterconstants both in the approximation factor and the grid-width. Note that ∆ ≈ L/δ in our notation. Withour notation the new theorem yields:
Theorem 5 (Approximation-Algorithm) . Let P be a simple polygon, suppose P ⊂ [0 , L ] for some positiveinteger L , and let δ denote the magnitude of an Edge-Inflation. Then the algorithm by Efrat and Har-Peledruns in expected time O ( n log n log ( nL/δ )) , and gives a solution which is within a factor O (log | OP T ( P t ) | ) from the optimum number of guards for P t . The algorithm runs on a real RAM. Note that the expectation is here both about the randomness used by the algorithm and the randomnesscoming from the Smoothed Analysis.Our methods mainly rely on a simple analysis of Edge-Inflation. It seems to be the case that any analysisthat works out for Edge-Inflation is likely to also work for other models of perturbation. In Section 8, wewill discuss why it is (arguably) better to focus on Edge-Inflation. Nevertheless, the relative simplicity ofanalyzing Edge-Inflation is the main reason why we only consider Edge-Inflation in Theorem 3, Theorem 4and Theorem 5.
Notation
We write f ( n ) ≤ c g ( n ), to indicate f ( n ) = O ( g ( n )) or equivalently f ( n ) ≤ cg ( n ), for some largeenough constant c . In this section we establish some general facts that will be needed throughout the paper.The key idea of the paper are some monotonicity properties of Minkowski-Inflation and Edge-Inflation.Roughly speaking guarding can only get easier after inflations.
Lemma 6 (Fixed Minkowski-Inflation) . Let P be a polygon, t > and P t its Minkowski-Inflation bymagnitude t . Then | OP T ( P ) | ≥ | OP T ( P t , w Z ) | , for any w ≤ √ t . roof. Given
OP T = OP T ( P ), we define a set G ⊆ w Z of guards of size | G | = | OP T | , by rounding everypoint in OP T to its closest grid point in w Z . We will show that G guards P t . See to the left of Figure 2for an illustration. xg x Rg xg v Figure 2: Left: The Region R is convex, and contains a guard g ∈ G and the point x . Thus x is guarded by g . Right: The Region R (cid:48) is easily seen to be convex.Let us fix some arbitrary point x ∈ P t . It is sufficient to show that G guards x . By definition of P t ,there exists an x ∈ P and an x ∈ disk( t ) such that x = x + x . Furthermore let g be a guard of OP T that guards x . Consider the region R = g x ⊕ disk( t ), i.e., the Minkowski-sum of the segment g x witha disk of radius t . As the segment g x is contained in P , it holds that R is contained in P t . Also as boththe segment and the disk are convex, so is R . At last notice that R contains a point g ∈ G , as every disk ofradius t contains a point of the grid w Z with w = √ t . As R is convex, g ∈ G guards x . Lemma 7 (Fixed Edge Inflation) . Let P be a polygon with integer coordinates and t > and P t the Edge-Inflation of P by t . Then | OP T ( P ) | ≥ | OP T ( P t , w Z ) | , for any w ≤ √ t .Proof. We follow closely the proof of Lemma 6. See to the right of Figure 2 for an illustration.Given
OP T = OP T ( P ), we define a set G ⊆ w Z of guards of size | G | = | OP T | , by rounding every pointin OP T to its closest grid point in w Z . We will show that G guards P t . Note that in an edge inflation by t , we get the same polygon as by a Minkowski-Inflation by t , except that we have to add some small regionsat the convex corners, as illustrated in Figure 1a. We already know that G guards the Minkowski t -inflationof P . So it remains to show that G guards those little extra regions, as discussed above.Let us fix some arbitrary point x ∈ P t inside one of those extra regions. We will show that G guards x . Let v be the vertex according to the region that x sits in. Furthermore let g be a guard of OP T thatguards v . Consider the region R = g v ⊕ disk(0 , t ). We define R (cid:48) as the region R together with the regionthat x sits in. Obviously x ∈ R (cid:48) and also there exists a point of G in R . It holds by construction that R (cid:48) isconvex. This finishes the proof. To showcase our technique, we will first show the correctness of the approximation algorithm of Efrat andHar-Peled [27, 28].
Theorem 5 (Approximation-Algorithm) . Let P be a simple polygon, suppose P ⊂ [0 , L ] for some positiveinteger L , and let δ denote the magnitude of an Edge-Inflation. Then the algorithm by Efrat and Har-Peledruns in expected time O ( n log n log ( nL/δ )) , and gives a solution which is within a factor O (log | OP T ( P t ) | ) from the optimum number of guards for P t . The algorithm runs on a real RAM.Proof. Let us assume that there are some numbers 0 = t < t < . . . < t (cid:96) = δ such that for all i and s ∈ [ t i − , t i ) holds that | OP T ( P s ) | is constant. As | OP T ( P s ) | is monotonically decreasing it holds that (cid:96) ≤ n . Note that, if we do an Edge-Inflation by s ∈ [ t i − , t i ), we know that a grid of width w = √ s − t i − ) contains an optimal solution. And in this case the algorithm of Efrat and Har-Peled [28] runs in9 ( n log n log ( L/ ( s − t i − ))) time. We denote by E ( T i ) the expected running time for s ∈ [ t i − , t i ). Wedenote δ i = t i − t i − . Using the definition of the smoothed expected running time we get E ( T i ) ≤ c δ i (cid:90) s ∈ [ t i − ,t i ) n log n log Ls − t i − . This gives E ( T i ) ≤ c δ i (cid:90) s ∈ [0 ,δ i ) n log n log Ls ≤ c δ i δ i n log n log Lδ i = n log n log Lδ i . Here, we solved the integral with a standard algebra system. Now, we are ready to compute the overallexpected running time E ( T ) = 1 δ (cid:88) i =1 ,...,(cid:96) δ i E ( T i ) ≤ c δ (cid:88) i =1 ,...,(cid:96) δ i n log n log Lδ i = n log nδ (cid:88) i =1 ,...,(cid:96) δ i log Lδ i . As the function x log (1 /x ) is concave the maximum is attained, if δ = . . . = δ (cid:96) = δ/(cid:96) . Thus we get E ( T ) ≤ c n log nδ (cid:96) (cid:20) δ/(cid:96) log L ( δ/(cid:96) ) (cid:21) = n log n log L ( δ/(cid:96) ) ≤ n log n log Lnδ .
This section is devoted to show the following theorem.
Theorem 1 (Bit-complexity) . Let P be a polygon, suppose P ⊂ [0 , L ] for some positive integer L , and let β denote the pointedness of P . If δ > is the magnitude of a (a) Minkowski-Inflation (b)
Edge-Inflation (c)
Edge-Perturbation (d)
Vertex-Perturbation,then the expected number of bits per guard to describe an optimal solution equals (a),(b),(c) O (cid:0) log (cid:0) nLδ (cid:1)(cid:1) (d) O (cid:16) log (cid:16) nLδβ (cid:17)(cid:17) . We will start by considering inflations as they play a special role for the other cases.
Lemma 8.
Let P be a polygon and δ denotes the magnitude of a Minkowski-Inflation or Edge-Inflation.We assume furthermore, that the polygon P has n vertices and fits inside a square [0 , L ] . Then the expectednumber of bits to describe the optimal guard placement equals O (log( Ln/δ )) , per guard.Proof. Let us assume that there are some numbers 0 = t < t < . . . < t (cid:96) = δ such that for all i and s ∈ [ t i − , t i ) holds that | OP T ( P s ) | is constant. As | OP T ( P s ) | is monotonically decreasing it holds that (cid:96) ≤ n . We denote by δ i = t i − t i − .Note that if the perturbation happens to be s ∈ [ t i − , t i ] then a grid of width w = √ s − t i − ) contains anoptimal solution, see Lemma 6 and 7. Then the number of bits to describe the solution equals O (log( L/w ))per guard. To see this note that we can use b = (cid:100) /w (cid:101) as denominator of all coordinates and the numeratorsare upper bounded by (cid:100) L/w (cid:101) . Thus O (log( L/w )) bits suffice. Let us denote the number of bits after aperturbation by s as B ( s ). We denote by E ( B i ) the expected number of bits for s ∈ [ t i − , t i ). The expectednumber of bits E ( B i ) can be calculated as E ( B i ) = 1 δ i (cid:90) s ∈ [ t i − ,t i ) B ( s ) ≤ c δ i (cid:90) s ∈ [ t i − ,t i ) log( L/ ( t i − s )) = 1 δ i (cid:90) s ∈ [0 ,δ i ] log( L/s ) . δ i δ i (1 + log( L/δ i )) ≤ c log( L/δ i ) . We are now ready to compute E ( B ). E ( B ) = 1 δ (cid:88) i =1 ,...,(cid:96) δ i E ( B i ) ≤ c δ (cid:88) i =1 ,...,(cid:96) δ i log( L/δ i ) . As the function x log(1 /x ) is concave the maximum is attained, if δ = . . . = δ (cid:96) = δ/(cid:96) . Thus we get E ( B ) ≤ c δ (cid:88) i =1 ,...,(cid:96) δ/(cid:96) log( L(cid:96)/δ ) = log(
L(cid:96)/δ ) ≤ c log( Ln/δ ) . Let us now turn to the Smoothed Analysis of Edge-Perturbations. The idea is that the set of all Edge-Perturbations can be decomposed into a combination of a new Edge-Perturbation together with a smallEdge-Inflation. As we know that Edge-Inflations behave nicely, so will Edge-Perturbations.
Lemma 9.
Let P be a polygon and let δ denote the magnitude of an Edge-Perturbation. Furthermore,assume that the polygon P has n vertices and fits inside a square [0 , L ] . Then the expected number of bitsto describe a guard placement equals O (log( Ln/δ )) per guard.Proof. Instead of picking a vector v uniformly at random from Ω δ = [ − δ, δ ] n , we describe another randomprocess, which leads to the same result. First, we guess the dimension that takes the minimum and themaximum entry. There are n ( n −
1) possibilities. Let t = max v − min v be the difference between themaximum and the minimum. The remaining entries are chosen in the interval [0 , t ] uniformly at random.This gives a vector v (cid:48) . Thereafter, we pick uniformly at random a shift s ∈ [0 , δ − t ]. The vector v = v (cid:48) + s .It is easy to see that this process is equivalent to choosing v uniformly at random from Ω δ = [ − δ, δ ] n . SeeFigure 3 for an illustration. min v max vs (cid:124) (cid:123)(cid:122) (cid:125)(cid:124) (cid:123)(cid:122) (cid:125) t Figure 3: Illustration to pick a random vector v ∈ Ω δ = [ − δ, δ ] n . First guess, where the min and max areattained; then guess the difference max − min; then guess all other entries, and ultimately guess the min.11s in the previous proof, we denote by B ( v ) the number of required bits per guard to describe an optimalguarding on the edge-perturbed polygon P v . E ( B ) = 1(2 δ ) n (cid:90) v ∈ [ − δ,δ ] n B ( v )= 1(2 δ ) n n ( n − (cid:90) t ∈ [0 , δ ] (cid:90) v (cid:48) ∈ [ − δ, − δ + t ] n − (cid:90) s ∈ [0 , δ − t ] B ( v (cid:48) + s )Here, we used the random process as described above. Recall v = v (cid:48) + s . And v (cid:48) must be padded intwo dimensions. As the inner integral describes a random Edge-Inflation of magnitude 2 δ − t , we can useLemma 8 to get the following upper bound. ≤ c δ ) n n ( n − (cid:90) t ∈ [0 , δ ] (cid:90) v (cid:48) ∈ [ − δ, − δ + t ] n − (2 δ − t ) log( Ln/ (2 δ − t ))As the part in the inner integral is independent of v (cid:48) , we can easily integrate and get:= 1(2 δ ) n n ( n − (cid:90) t ∈ [0 , δ ] t n − (2 δ − t ) log( Ln/ (2 δ − t )) (1)In order to compute this integral, we compute the following integral for a = 2 δ and b = 1 / ( Ln ). We willdenote the Harmonic numbers by H n = 1 + + . . . + n . − (cid:90) t ∈ [0 ,a ] t n − ( a − t ) log( b ( a − t ))= (cid:90) t ∈ [0 ,a ] t n − log( b ( a − t )) − a (cid:90) t ∈ [0 ,a ] t n − log( b ( a − t ))Using some standard computer algebra system we get.= a n (log ba − H n ) n − a a n − (log ba − H n − ) n − a n n ( n −
1) [( n − ba − H n ) − n (log ba − H n − )]We simplify the second term as follows. Note that H n = O (log n ).( n − ba − H n ) − n (log ba − H n − )= log(1 /ba ) − ( n − H n − − n − n + ( n − H n − + H n − ≤ c log(1 /ba ) + log n = log( n/ba ) . Now plugging in this simplification in the integral from Line (1) gives1(2 δ ) n n ( n − (cid:90) t ∈ [0 , δ ] t n − (2 δ − t ) log( Ln / (2 δ − t )) ≤ c δ ) n n ( n −
1) (2 δ ) n n ( n −
1) log( Ln / δ )= O (log( nL/δ )) . This shows that the expected running time equals O (log( nL/δ )), as claimed.12e are now ready to go through the Smoothed Analysis with respect to Vertex-Perturbation. This partfollows mainly the part of Edge-Perturbation. Again the idea is to think of a Vertex-Perturbation as acombination of a Vertex-Perturbation and an Edge-Inflation. However, we need an additional trick. Theproblem is that it is seemingly impossible to decompose the space of Vertex-Perturbation into Edge-Inflationsexplicitly. Fortunately, it turns out that knowing that such a decomposition exists is enough. δ α γγd QP s vv s v Q Figure 4: Lower bounding the possible Edge-Inflation.
Lemma 10.
Let P be a polygon with pointedness β and δ > δ > . Furthermore, let P s be a Vertex-Perturbation of magnitude δ , and let Q = ( P s ) t be an Edge-Inflation of P s of magnitude γ . It holds thatfor any γ ≤ β ( δ − δ ) that Q is also a Vertex-Perturbation of P of magnitude δ .Proof. See Figure 4 for an illustration of the following description. Consider a single vertex v of P . Let v s denote the corresponding vertex in P s , and v Q the corresponding vertex of Q . It suffices to show thatdist( v, v Q ) ≤ δ . Let d = dist( v Q , v s ) and let α denote the interior angle at v s . It is easy to see that γ = d sin( α/ . As we remarked above about the assumption on our perturbations, it holds that sin( α/ ≥ α/ ≥ β . Thisimplies γ ≥ dβ and in turn β ( δ − δ ) ≥ γ ≥ dβ , by definition of γ . Thus we have d ≤ ( δ − δ ). This impliesdist( v, v Q ) ≤ δ + d ≤ δ + ( δ − δ ) ≤ δ .Let Ω δ = disk( δ ) n be the space that describes all possible Vertex-Perturbations of magnitude δ of a givenpolygon P . As δ is fixed for the rest of the section, we omit it in the notation and just write Ω (= Ω δ ). Inorder to define formally the decomposition of the Ω into Edge-Inflations, we need to define Edge-Deflation.Given a polygon P , we say Q is an Edge-Deflation of P of magnitude δ if and only if P is an Edge-Inflationof Q of magnitude δ . Let us denote by P (Ω) = { P x : x ∈ Ω } . Then there exists a space Ω that consists ofall pairs ( x, s ) ∈ Ω × [0 , δ ] such that the following conditions hold: • For any positive Edge-Deflation Q of P x , it holds Q (cid:54)∈ P (Ω). • The Edge-Inflation ( P x ) s of magnitude s is contained in P (Ω).We denote by P x,s the polygon P , for which we first do the Vertex-Perturbation x and then inflate by s . Lemma 11 (Decomposition into Inflations) . There is a bijection ϕ from Ω to Ω such that P x = P ϕ ( x ) .Proof. For every Vertex-Perturbation P y , with y ∈ Ω there exists a maximal deflation P x , with x ∈ Ω. Let s be the amount by which we deflated. We define ϕ ( y ) = ( x, s ). It holds that P y = P x,s = P ϕ ( y ) This describesthe bijection ϕ . 13ecall that we denote by B ( x ) the required number of bits per guard after perturbing by x . By abuseof notation, we denote by B ( x, s ) the corresponding number of bits, for ( x, s ) ∈ Ω. Furthermore for each x ∈ Ω, we denote by t x , the maximum such that ( x, t x ) ∈ Ω. We denote by Ω (cid:48) , the projection of Ω onto itsfirst component. In other words Ω (cid:48) ⊆ Ω is the set of all Vertex-Perturbations such that any Edge-Deflationof them would not yield a polygon in P (Ω). Lemma 12 (Integral-Equivalence) . It holds that (cid:90) x ∈ Ω B ( x ) = (cid:90) x ∈ (Ω (cid:48) ) (cid:90) s ∈ [0 ,t x ] B ( x, s ) . Proof.
By Lemma 11, the right and the left integral are actually integrating over the same set.Using the above bijection, we can now argue that the number of bits B ( x ) can be replaced, by theexpected running time inside the integral, as we will show in the following lemma. Lemma 13 (Use-The-Average) . It holds that (cid:90) x ∈ Ω B ( x ) ≤ (cid:90) x ∈ Ω O (log( Ln/t x )) . Proof.
We start by expanding the integral using Lemma 12. (cid:90) x ∈ Ω B ( x ) = (cid:90) x ∈ Ω (cid:48) (cid:90) s ∈ [0 ,t x ] B ( x, s ) ≤ c (cid:90) x ∈ Ω (cid:48) t x log( Ln/t x )The last line follows from Lemma 8, as the inner integral corresponds to an Edge-Inflation. Using that tc = (cid:82) s ∈ [0 ,t ] c , for every constant c , we get= (cid:90) x ∈ Ω (cid:48) (cid:90) s ∈ [0 ,t x ] log( Ln/t x )= (cid:90) x ∈ Ω (cid:48) (cid:90) s ∈ [0 ,t x ] log( Ln/ ( t x − s )Note that for ( x, s ) = ϕ ( x (cid:48) ), it holds that t x − s = t x (cid:48) . (We refer to ϕ from Lemma 11.) This implies= (cid:90) x ∈ Ω log( Ln/t x ) . Here the last line follows from the bijection explained before Lemma 12.
Lemma 14.
Let P be a polygon and δ denotes the magnitude of a Vertex-Perturbation. Furthermore, assumethat the polygon P has n vertices and fits inside a square [0 , L ] and has pointedness β . Then the expectednumber of bits is upper bounded by O (cid:18) log nLδβ (cid:19) . Proof.
Let us start with the definition of the expected running time and Lemma 13. E ( B ) = 1( πδ ) n (cid:90) x ∈ Ω B ( x ) ≤ c πδ ) n (cid:90) x ∈ Ω log( Ln/t x ) . . . Figure 5: Here, one vertex has distance t and all other vertices have distance at most t from its originalvertex.Note that Ω is the Cartisian product of n disks. And we think of x as picking n points from n disksindependently. See Figure 5 for an illustration. Similar to the proof of Lemma 9, we can think of a newrandom experiement to select x = ( x , . . . , x n ) ∈ Ω = disk( δ ) n as follows. First guess a number t ∈ [0 , δ ],which represents the maximum distance of every point x i to its disk center, and guess, which of the n pointsis attaining this maximum distance. The remaining points have all at most distance t from the center.Thus we can rewrite the integral as follows. (cid:90) x ∈ Ω log( Ln/t x ) = n (cid:90) t ∈ [0 ,δ ] πt (cid:90) x (cid:48) ∈ disk ( t ) n − log( Ln/t x )Here the factor 2 πt comes from the circumference of a disk of radius t . Using that β ( δ − t ) ≤ t x , by Lemma 10,we get ≤ c n (cid:90) t ∈ [0 ,δ ] πt (cid:90) x (cid:48) ∈ disk ( t ) n − log Lnβ ( δ − t )Note that the inner integral does not depend on x (cid:48) . Furthermore the area of a disk of radius t equals πt ,which gives us = n (cid:90) t ∈ [0 ,δ ] πt ( πt ) n − log Lnβ ( δ − t )= 2 nπ n (cid:90) t ∈ [0 ,δ ] t n − log Lnβ ( δ − t )Using some computer algebra system, we can compute the integral. This is exactly the same computationas in Lemma 9, and gives us ≤ c n π n δ n log Ln βδ n = π n δ n log Ln βδ . This gives E ( B ) ≤ c πδ ) n π n δ n log nLβδ = O (cid:18) log nLβδ (cid:19) . This section is devoted to the proof of the following theorem.
Theorem 2 (Expected NP-time) . Let P be a polygon, suppose P ⊂ [0 , L ] for some positive integer L , andlet β denote the pointedness of P . If δ > is the magnitude of a a) Minkowski-Inflation (b)
Edge-Inflation (c)
Edge-Perturbation (d)
Vertex-Perturbation,then the Naive Algorithm runs in expected (a),(b),(c) O (cid:0) n log (cid:0) nLδ (cid:1)(cid:1) (d) O (cid:16) n log (cid:16) nLδβ (cid:17)(cid:17) non-deterministic time. Furthermore, the algorithm takes an additional O ( n ) deterministic time on areal RAM. Note that the non-deterministic part is easy. There are at most n guards in an optimal guarding andeach can be described with a logarithmic number of bits, according to Theorem 1. One may wonder whetherit is possible to improve the running time to the form O ( k log . . . ), where k is the optimal number of guards.The problem is that k is not well-defined, as it may vary depending on the perturbation.It remains to describe a deterministic algorithm to check if a given set of guards is indeed guarding agiven polygon. It was shown by Efrat and Har-Peled [28] that for a simple polygon P we can check in O ( kn log k log n ) time if k given guards see P completely. Lemma 15 ([28]) . It can be checked in O ( kn log k log n ) time if a given set of G guards is correctly guardinga given polygon, without holes, on n vertices. This algorithm works on a real RAM. For polygons with holes, we describe a simple (probably well-known) algorithm that runs in O ( n k )time. Here k is defined as the number of given guards. As we have not found a reference in the literature,we repeat it here for the benefit of the reader. Lemma 16 (Folklore) . It can be checked in O ( k n ) time if a given set of G guards is correctly guarding agiven polygon, potentially with holes, on n vertices. This algorithm works on a real RAM.Proof. For polygons with h holes, it is possible to compute the visibility regions of each guard in O ( n + h log h )time [38]. Note that the number of vertices and edges of those polygons is still O ( n ). (Every pair of adjacentedges of the visibility polygon contains at least one vertex of the original polygon and every vertex is incidentto at most two edges.) Then we have in total m = O ( kn ) edges and vertices.We can now compute the union Q of all those polygons in O ( m log m + l ) time, where l = O ( m ) = O ( k n ) is the total number of edge intersections of all the given edges. This can be done by a simplesweepline algorithm of all the visibility polygons [52, Chapter 7].Thereafter, we can check if the set of vertices of Q are the same (in the same order) as the vertices of ouroriginal polygon P . This can be done in linear time. The running time is dominated by O ( k n ), by takingthe union of the visibility polygons. Theorem 3 (NP-time With High Probability) . Let P be a polygon and suppose P ⊂ [0 , L ] for some positiveinteger L . If δ > is the magnitude of a discrete Edge-Inflation with granularity q sufficiently large ( q > np is sufficient), then the Naive Algorithm runs with probability − p in O ( n log Lnδp ) non-deterministic timeand some additional polynomial deterministic time on an ordinary Turing Machine. We first focus on the non-deterministic part of the algorithm. Let us assume that there are some numbers0 = t < t < . . . < t (cid:96) = δ such that for all i and s ∈ [ t i − , t i ) it holds that | OP T ( P s ) | is constant. As | OP T ( P s ) | is monotonically decreasing it holds that (cid:96) ≤ n . We denote by δ i = t i − t i − . Consider the set S = (cid:91) i =1 ,...,(cid:96) [ t i − + δp n , t i ] . Note that | S | ≥ δ (1 − p/ S = [0 , δ ] \ S . Note that | S ∩ Ω δ,q | ≤ n + p ( q + 1) /
2. Thus, for q > n/p , it holds that | S ∩ Ω δ,q | ≤ p ( q + 1) = p | Ω δ,q | . Therefore a random perturbation will be in the set S with probability at least 1 − p . Now, fix some s ∈ S and i ∈ { , . . . , (cid:96) } , with s ∈ [ t i − + δp/ n, t i ). Notethat | OP T ( P t i − ) | = | OP T ( P s ) | . Furthermore P s is an Edge-Inflation of P t i − of magnitude at least δp/ n .16hus, by Lemma 7, a grid of width w = √ δp/ n = δp/ √ n contains an optimal guarding of P s . We candescribe each guard with (cid:100) log L (cid:101) + (cid:100) log( √ n/δp ) (cid:101) = O (cid:18) log Lnδp (cid:19) bits. Thus clearly O ( n log Lnδp ) bits in total are sufficient as any polygon on n vertices can be guarded by atmost n guards. This finishes the non-deterministic part of the algorithm.It remains to argue that we can also check optimal guards on a Turing Machine. Recall that we mentionedin Lemma 16 how to check a given set of guards in O ( n ) time on a real RAM. It remains to argue thatthis algorithm also runs in polynomial time on a Turing Machine. First note that even after a rational (0 ,
0) (4 , , − , − √ (cid:0) (cid:1) (4 + √ , √ , − − , √ Figure 6: A triangle with integer vertices and an Edge-Inflation by 1. The Edge-Inflation has vertices thatcan be described using radicals.perturbation, the resulting vertices may not be rational, see Figure 6. Let us start with the way that avertex can be represented. For that purpose, suppose that r ∈ Ω δ,q describes an Edge-Inflation. Assumethat u, v, w ∈ Q are three consecutive vertices of the original polygon P . We will denote the new verticesby u (cid:48) , v (cid:48) , w (cid:48) . We can compute the normal vectors of the edges uv and vw using square roots. Using thenormal vectors, we can compute the slope and the y -intercept of the supporting lines of u (cid:48) v (cid:48) and v (cid:48) w (cid:48) . Fromthere, we can compute the intersection point of those lines, which define the point v (cid:48) . The resulting pointcan be described using square roots. To be more precise, the only place we will leave the field Q is, when wecompute the normal vectors. Denote by a and b the Euclidean distance between u, v and v, w respectively.Then all calculations take place in the field Q [ a, b ].Now, consider the algorithm described in the proof of Lemma 16. The first set A of geometric objectsthat is computed are segments defined by combinations of guards and vertices. The second set B of objectsthat is computed are intersections of segments in A . Note that each object in A ∪ B can be defined usinga constant number of vertices and/or guards. No further geometric objects are computed. Once all thosegeometric objects are computed, all further queries on the coordinates of those objects are just comparisonsof x and y -coordinates. Such a comparison reduces to solving a sum of square roots problem , which is not ingeneral known to be polynomial time solvable [50]. It is one of the major open problems in computationalgeometry, to find a polynomial time algorithm. In our case however, we know that only a finite number ofsquare roots are involved, and this case is known to be polynomial time solvable [56].Note that the time of the deterministic part of the algorithm depends polynomially on log q .17 Non-deterministic Time Using Algebra
This section is devoted to describe an algorithm that runs in expected deterministic time. The advantage ofthe next theorem is that it really works on a non-deterministic Turing Machine, without a real RAM. Andthe described algorithm works correctly in all cases, not just with high probability. However, the algorithmuses algebraic methods in a very small fraction of the cases.
Theorem 4 (NP-time) . Let P be a polygon and suppose P ⊂ [0 , L ] for some positive integer L = n O (1) .If δ > is the magnitude of a discrete Edge-Inflation with granularity q sufficiently large ( q > n Ω( n ) issufficient), then there is an algorithm that runs in expected non-deterministic polynomial time on an ordinaryTuring Machine.Proof. We use the Naive Algorithm as described in Theorem 3 with probability 1 − p = 1 − n − cn , where c is some sufficiently large constant to be determined later. The non-deterministic running time in that caseequals O ( n log Lnδp ) = O ( n log Lnδ ). In the remaining cases, we are using algebraic algorithms that run in n c (cid:48) n time [7, 27, 28]. We set c = c (cid:48) . The expected non-deterministic running time can be estimated by(1 − p ) O (cid:18) n log Lnδ (cid:19) + pn cn = O ( n log Lnδ ) . The deterministic time to check if the guess made by the Naive Algorithm is correct is the same as inTheorem 3.
In this section we compare various models of perturbation. This is important to critically evaluate thecontribution of our findings. See Table 1, for a summary.Vertex-Pertur. Minkowski-Infl. Edge-Infl. Edge-Pert.remains a polygon YES NO YES YESnumber of vertices preserved YES NO YES YESangles preserved NO YES YES YESshape preservation YES YES YES YESdimension of randomness 2 n n small Hausdorff distance YES YES NO NOfair to edges NO YES YES YESfair to vertices YES YES NO NOsmall visibility change YES NO NO NOTable 1: A comparison of the four models of perturbation.At first glance, Vertex-Perturbations seem to be the most natural type of perturbations, as we usuallyspecify a polygon by describing its vertices. However, bear in mind that practical instances are constructedwith specific features in mind. Also recall that Smoothed Analysis aims to analyze instances as similar aspossible to the input. Thus, if a perturbation destroys a constructed feature, it is less meaningful then aperturbation that maintains that feature. In fact, if we would not alter the instance at all, then we wouldsimply get the worst case analysis. Let us now have a second glance at the various ways to perturb a polygon,and see which behave most nicely under the described criteria.One of the most natural criteria is whether we maintain the property of being a polygon after theperturbation. Clearly, Minkowski-Inflations violate this criteria. However, note that we could also take theMinkowski-sum of a polygon with a square, and the resulting object would remain polygon.We might also like to know whether the number of vertices remains. Again, this fails only for theMinkowski-Inflations. 18 feature that seems to be important, is whether the angles between edges are maintained. It is, forinstances, often the case in buildings that walls are rectilinear to one another. We might not care about theprecise width of a corridor, but we might find it odd if the two walls of the corridor are not parallel. Here,only the Vertex-Perturbation fails miserably.Another criteria is whether the general shape is maintained. All presented perturbations satisfy thiscriteria. But one could think of perturbations where the shape is not maintained at all. For instance bypermuting the order of the vertices.As already mentioned, we want to perturb as little as possible. We can take the dimension of theprobability space as measure for the added randomness. Here, the inflations are best, as their probabilityspace is one dimensional. However, note that one could argue that the perturbation is designed to destroyirrational solutions.Another important aspect is by how much visibility is altered by the perturbation. One can see thatthe visibility regions are altered more by Minkowski-Inflation and Edge-Perturbation, in comparison to theVertex-Perturbation. The reason is that reflex vertices might be moved a lot in case that the inner angle atthat vertex is particularly large. This might be the reason, why our analysis is easier with the Minkowski-Inflation. See Figure 7 for an illustration.Figure 7: Left: The visibility region after some Vertex-Perturbation is altered comparatively little. Right:The Minkowski-Inflation alters the visibility a lot. This might be the reason, why our analysis is easier withthe Minkowski-Inflation.A somewhat weird criteria, is a voting of the points on the boundary. After a perturbation of magnitude t , every point could be asked the following question: “Do you feel perturbed by magnitude t ?” For theEdge-Inflation, it is easy to see that most points on the edge, will say yes, whereas vertices and pointsclose to vertices might say, that they feel perturbed much more then t . On the other hand, in the Vertex-Perturbation model all vertices, will say that they are moved by t , whereas most points on the edges mightsay that they are moved far less. Thus loosely speaking, Vertex-Perturbations treat edges in a “dishonestmanner”, whereas Edge-Perturbations treat vertices in a “dishonest manner”. It seems difficult to designa model of perturbation that is both fair to the edges and to the vertices. (Combining Edge and Vertex-Perturbation, is unfair to both edges and vertices.)Finally, one might be interested in maintaining a small Hausdorff-distance to the original polygon afterthe perturbation. This is not the case for Edge-Inflation and Edge-Perturbations as can be seen in Figure 8.There is another aspect that we so far have swept totally under the rug. Spielman and Teng did notconsidered uniform distributions, but Gaussian distributions. Their argument being that practical instancesare often altered by random noise and noise is for various reasons best modeled by the Gaussian distribution.We believe that the Gaussian distribution makes life considerably more difficult and we don’t expect anydifference in the results. The reason is that both Gaussian and uniform distribution choose from the same19 Figure 8: Altough, the Edge-Inflation is fairly small the Hausdorff distance to the perturbed polygon iscomparatively large, due to the very small convex angle.set of instances. In both cases, the result is that under both distributions the majority of instances behavesgood. The only difference is that we “drew” instances with some small difference in distribution.We summarize that none of the considered models of perturbation is ideal in all criteria and preference ofone over the other might be a question of taste. The authors find the preservation of angles and low addedrandomness most important.
In this paper, we have shown that typically a polygon can be guarded optimally by guards with rationalcoordinates and those coordinates might be very small. This is one of the few positive results on the ArtGallery Problem.As a corollary, the Naive Algorithm takes linear non-deterministic time and O ( n ) deterministic time onpolygon with holes. Thus, we ask: Question A.
Does there exists an O ( kn ) algorithm, to decide if a given set of k guards, is correctly guardinga given polygon with holes on n vertices? While, we showed that Smoothed Analysis can overcome the obstacle of ∃ R -hardness for the Art GalleryProblem, most lower bounds, like NP-hardness, W[1]-hardness, and inapproximability are expected to con-tinue to hold, even after perturbations. Note that practical implementations usually consist of a geometricpart, which is theoretically polynomial time solvable and a combinatorial part, which solves a set-coverproblem, which is NP-hard in general. De Rezende et al. [24] report as follows:“Still the geometric routines made up for over 90% of the runtime.”In other words their algorithms spend most time on the geometric part and least time on the part of thealgorithm that is NP-hard. It would be interesting to find a theoretical explanation for this phenomenon. Question B.
Does there exist a theoretical explanation for the reported findings, that the NP-hard part ofthe implemented algorithms takes the least time?
We showed that the grid is a candidate set in the Smoothed Analysis model. While it is nice to have acandidate set at all, we would really like to have one of polynomial size. All the NP-hardness proofs thatthe authors are aware of yield instances with easily identifiable polynomial sized candidate sets. Thus it isnot clear, if such a candidate set might not exist for every polygon, after a small perturbation.
Question C.
Does there exist an algorithm that runs in smoothed polynomial time and outputs a candidateset of polynomial size?
In this paper, we studied the so-called Naive Algorithm, which is the simplest possible algorithm for theArt Gallery Problem. But there are implementations of much more clever algorithms that perform well inpractice.
Question D.
Can we show that one of the more sophisticated practical algorithms works correctly in thesmoothed sense? ∃ R -hard problems. Maybe, wecan find that they also have a non-deterministic polynomial time algorithm, which runs correctly in theSmoothed Analysis sense. A possible candidate is Motion Planning. Note that there are many variantsof Motion Planning, and we currently do not even know which variants are ∃ R -hard. But often algebraicmethods are the only way to solve the problem provably correctly [7]. Another example would be Nash-Equilibria [65].As we have shown that essentially all models of perturbation behave in the same way, we think thatit should be sufficient in the future to regard Edge-Inflation only. This model is very nice as it preservesangles, the probability space is one dimensional and it is usually easiest to analyze. Furthermore, ourtechniques strongly suggest that any result on Edge-Inflation carries over to the other models, in a tediousbut standardized way. Acknowledgments
We want to thank Stefan Langerman, Jean Cardinal, John Iacono and Mikkel Abra-hamsen for helpful discussion on the presentation of the results. We want to thank Joseph O’Rourke forpointing us to an algorithm to check if a given set of guard positions is correct.Part of the research was conducted while visiting KAIST, and we thank KAIST and BK21 for theirsupport and for providing an excellent working environment.Andreas Holmsen was supported by the Basic Science research Program through the National ResearchFoundation of Korea (NRF) funded by the Ministry of Education (NRF-2016R1D1A1B03930998).Tillmann Miltzow acknowledges the generous support from the ERC Consolidator Grant 615640-ForEFrontand the Veni EAGER.
References [1] Pankaj Kumar Agarwal, Kurt Mehlhorn, and Monique Teillaud. Dagstuhl Seminar 11111, Computa-tional Geometry, March 13 – 18 , 2011.[2] M. Abrahamsen, A. Adamaszek, and T. Miltzow. Irrational guards are sometimes needed. In
SoCG2017 , pages 3:1–3:15, 2017. Arxiv 1701.05475.[3] M. Abrahamsen, A. Adamaszek, and T. Miltzow. The art gallery problem is ∃ R -complete. In STOC2018 , pages 65–73, 2018. Arxiv 1704.06969.[4] A. Aggarwal.
The art gallery theorem: its variations, applications and algorithmic aspects . PhD thesis,The Johns Hopkins University, 1984.[5] Y. Amit, J. S. Mitchell, and E. Packer. Locating guards for visibility coverage of polygons.
InternationalJournal of Computational Geometry & Applications , 20(05):601–630, 2010.[6] D. Arthur and S. Vassilvitskii. Worst-case and smoothed analysis of the icp algorithm, with an appli-cation to the k-means method. In
FOCS 2016 , pages 153–164. IEEE, 2006.[7] S. Basu, R. Pollack, and M.-F. Roy.
Algorithms in real algebraic geometry . Springer-Verlag BerlinHeidelberg, 2006.[8] R. Beier and B. V¨ocking. Random knapsack in expected polynomial time. In
STOC , pages 232–241.ACM, 2003.[9] R. Beier and B. V¨ocking. Typical properties of winners and losers in discrete optimization.
SIAMJournal on Computing , 35(4):855–881, 2006.[10] P. Belleville. Computing two-covers of simple polygons. Master’s thesis, McGill University, 1991.[11] P. Belleville. Two-guarding simple polygons. In
Proc. 4th Canadian Conference on ComputationalGeometry , page 103–108, 1992. 2112] P. Bhattacharya, S. K. Ghosh, and S. P. Pal. Constant approximation algorithms for guarding simplepolygons using vertex guards.
Arxiv 1712.05492 , 2017.[13] ´E. Bonnet and T. Miltzow. Parameterized hardness of art gallery problems. In (ESA) , pages 19:1–19:17,2016. Arxiv 1603.08116.[14] ´E. Bonnet and T. Miltzow. An approximation algorithm for the art gallery problem. In
SoCG 2017 ,pages 20:1–20:15, 2017.[15] D. Borrmann, P. J. de Rezende, C. C. de Souza, S. P. Fekete, S. Friedrichs, A. Kr¨oller, A. N¨uchter,C. Schmidt, and D. C. Tozoni. Point guards and point clouds: Solving general art gallery problems. In
SoCG 2013 , pages 347–348, 2013.[16] A. Bottino and A. Laurentini. A nearly optimal sensor placement algorithm for boundary coverage.
Pattern Recognition , 41(11):3343–3355, 2008.[17] A. Bottino and A. Laurentini. A nearly optimal algorithm for covering the interior of an art gallery.
Pattern recognition , 44(5):1048–1056, 2011.[18] J. Cardinal, S. Felsner, T. Miltzow, C. Tompkins, and B. Vogtenhuber. Intersection graphs of rays andgrounded segments.
Journal of Graph Algorithms and Applications , 22:273–295, 2018.[19] J. Cardinal and U. Hoffmann. Recognition and complexity of point visibility graphs.
Discrete &Computational Geometry , 57(1):164–178, 2017.[20] V. Chv´atal. A combinatorial theorem in plane geometry.
Journal of Combinatorial Theory, Series B ,18(1):39–41, 1975.[21] M. C. Couto, P. J. de Rezende, and C. C. de Souza. An exact algorithm for minimizing vertex guardson art galleries.
International Transactions in Operational Research , 18(4):425–448, 2011.[22] M. C. Couto, C. C. De Souza, and P. J. De Rezende. Experimental evaluation of an exact algorithmfor the orthogonal art gallery problem. In
International Workshop on Experimental and Efficient Algo-rithms , pages 101–113. Springer, 2008.[23] D. Dadush and S. Huiberts. A friendly smoothed analysis of the simplex method. In
STOC , pages390–403. ACM, 2018.[24] P. J. de Rezende, C. C. de Souza, S. Friedrichs, M. Hemmer, A. Kr¨oller, and D. C. Tozoni. Engineeringart galleries. In P. S. Lasse Kliemann, editor,
Algorithm Engineering – Selected Results and Surveys ,pages 379–417. Springer International Publishing, 2016.[25] O. Devillers, M. Glisse, X. Goaoc, and R. Thomasse. Smoothed complexity of convex hulls by witnessesand collectors.
Journal of Computational Geometry , 7(2):101–144, 2016.[26] M. G. Dobbins, L. Kleist, T. Miltzow, and P. Rz¸a˙zewski. ∀∃ R -completeness and area-universality. WG2018 , 2018. Arxiv 1712.05142.[27] A. Efrat and S. Har-Peled. Guarding galleries and terrains. In
IFIP 2002 , pages 181–192, 2002.[28] A. Efrat and S. Har-Peled. Guarding galleries and terrains.
Inf. Process. Lett. , 100(6):238–245, 2006.[29] S. Eidenbenz, C. Stamm, and P. Widmayer. Inapproximability results for guarding polygons andterrains.
Algorithmica , 31(1):79–113, 2001.[30] M. Englert, H. R¨oglin, and B. V¨ocking. Worst case and probabilistic analysis of the 2-opt algorithm forthe tsp. In
SODA , pages 1295–1304, 2007. 2231] M. Etscheid and H. R¨oglin. Smoothed analysis of local search for the maximum-cut problem.
ACMTransactions on Algorithms (TALG) , 13(2):25, 2017.[32] S. Fekete. Private communication.[33] S. Fisk. A short proof of Chv´atal’s watchman theorem.
J. Comb. Theory, Ser. B , 24(3):374, 1978.[34] S. Friedrichs. Integer solutions for the art gallery problem using linear programming. Masterthesis,2012.[35] S. Friedrichs, M. Hemmer, J. King, and C. Schmidt. The continuous 1.5D terrain guarding problem:Discretization, optimal solutions, and PTAS.
Journal of Computational Geometry , 7(1):256–284, 2016.[36] J. Garg, R. Mehta, V. V. Vazirani, and S. Yazdanbod. ETR-completeness for decision versions ofmulti-player (symmetric) Nash equilibria. In
ICALP 2015 , pages 554–566, 2015.[37] J. E. Goodman, R. Pollack, and B. Sturmfels. The intrinsic spread of a configuration in R d . Journal ofthe American Mathematical Society , pages 639–651, 1990.[38] P. J. Heffernan and J. S. Mitchell. An optimal algorithm for computing visibility in the plane.
SIAMJournal on Computing , 24(1):184–201, 1995.[39] R. J. Kang and T. M¨uller. Sphere and dot product representations of graphs. In
SoCG , pages 308–314.ACM, 2011.[40] V. Klee and G. J. Minty. How good is the simplex algorithm. Technical report, Washington Univ.Seattle Dept. of Mathematics, 1970.[41] J. Kratochv´ıl and J. Matouˇsek. String graphs requiring exponential representations.
Journal of Com-binatorial Theory, Series B , 53(1):1–4, 1991.[42] A. Kr¨oller, T. Baumgartner, S. P. Fekete, and C. Schmidt. Exact solutions and bounds for general artgallery problems.
Journal of Experimental Algorithmics (JEA) , 17:2–3, 2012.[43] D.-T. Lee and A. K. Lin. Computational complexity of art gallery problems.
IEEE Transactions onInformation Theory , 32(2):276–282, 1986.[44] D.-T. Lee and F. P. Preparata. An optimal algorithm for finding the kernel of a polygon.
Journal ofthe ACM (JACM) , 26(3):415–421, 1979.[45] A. Lubiw, T. Miltzow, and D. Mondal. The complexity of drawing a graph in a polygonal region.
Arxiv ,2018. Graph Drawing 2018.[46] B. Manthey and H. R¨oglin. Smoothed analysis: Analysis of algorithms beyond worst case. it-InformationTechnology Methoden und innovative Anwendungen der Informatik und Informationstechnik , 53(6):280–286, 2011.[47] J. Matouˇsek. Intersection graphs of segments and ∃ R . Arxiv , 1406.2636, 2014.[48] C. McDiarmid and T. M¨uller. Integer realizations of disk and segment graphs.
Journal of CombinatorialTheory, Series B , 103(1):114–143, 2013.[49] G. L. Nemhauser and Z. Ullmann. Discrete dynamic programming and capital allocation.
ManagementScience , 15(9):494–505, 1969.[50] J. O’Rourke. Problem 33: Sum of square roots. http://cs.smith.edu/~jorourke/TOPP/P33.html . Accessed: 2018-10.[51] J. O’Rourke.
Art Gallery Theorems and Algorithms . Oxford University Press, 1987.2352] J. O’Rourke.
Computational geometry in C . Cambridge university press, 1998.[53] J. O’Rourke. Visibility. In J. E. Goodman and J. O’Rourke, editors,
Handbook of Discrete and Com-putational Geometry , chapter 28. Chapman & Hall/CRC, second edition, 2004.[54] J. Pach and G. T´oth. Recognizing string graphs is decidable. In
Graph Drawing 2001 , pages 247–260,2001.[55] J. Pach and G. T´oth. Recognizing string graphs is decidable.
Discrete & Computational Geometry ,28(4):593–606, 2002.[56] J. Qian and C. A. Wang. How much precision is needed to compare two sums of square roots of integers?
Information Processing Letters , 100(5):194–198, 2006.[57] J. Richter-Gebert and G. M. Ziegler. Realization spaces of 4-polytopes are universal.
Bulletin of theAmerican Mathematical Society , 32(4):403–412, 1995.[58] H. R¨oglin. Minicourse on smoothed analysis. https://algo.rwth-aachen.de/Lehre/SS07/VRA/Material/SmoothedAnalysis.pdf , 2007. Online; accessed August 2018.[59] G. Rote. EuroCG open problem session, 2011. See the personal webpage of G¨unter Rote: http://page.mi.fu-berlin.de/rote/Papers/slides/Open-Problem_artgallery-Morschach-EuroCG-2011.pdf .[60] T. Roughgarden. Smoothed Complexity and Pseudopolynomial-Time Algorithms. https://theory.stanford.edu/~tim/f14/l/l15.pdf , 2014. Online; accessed August 2018.[61] T. Roughgarden. Beyond worst-case analysis.
Arxiv , 1806.09817, 2018.[62] M. Schaefer. Realizability of graphs and linkages. In
Thirty Essays on Geometric Graph Theory , pages461–482. Springer, 2013.[63] M. Schaefer, E. Sedgwick, and D. Stefankovic. Recognizing string graphs in NP. In
STOC , pages 1–6,2002.[64] M. Schaefer, E. Sedgwick, and D. ˇStefankoviˇc. Recognizing string graphs in NP.
Journal of Computerand System Sciences , 67(2):365–380, 2003.[65] M. Schaefer and D. ˇStefankoviˇc. Fixed points, Nash equilibria, and the existential theory of the reals.
Theory of Computing Systems , 60(2):172–193, 2017.[66] D. Schuchardt and H. Hecker. Two NP-hard art-gallery problems for ortho-polygons.
Math. Log. Q. ,41:261–267, 1995.[67] Y. Shitov. A universality theorem for nonnegative matrix factorizations.
Arxiv 1606.09068 , 2016.[68] P. Shor. Stretchability of pseudolines is np-hard.
Applied Geometry and Discrete Mathematics-TheVictor Klee Festschrift , 1991.[69] D. A. Spielman and S.-H. Teng. Smoothed analysis of algorithms: Why the simplex algorithm usuallytakes polynomial time.