Improved Approximation of Two Watchmen’s Routes in Simple Polygons
Abstract
We study the watchman route problem for a set of two watchmen for the objective of minimizing the length of the longest route (min-max) inside a simple polygon having vertices, which is known to be weakly NP-hard. First, we consider seeing a discrete set of points in the interior of . We show that even this problem is weakly NP-hard and present an approximation algorithm with approximation ratio that runs in time, assuming that a starting point for each of the two routes is given. We generalize the algorithm to see all of the interior of in time with approximation ratio , improving on the previously known best algorithm that has an approximation ratio of and runtime [8]. Finally, we describe how to extend this algorithm to the case where no starting points are given, this taking time, yielding an approximation ratio of , improving on the previously known best approximation algorithm with ratio also having runtime [8].
Keywords and phrases:
Art gallery problem, watchman route problem, multiple watchmen, path planning, polygonsCopyright and License:
2012 ACM Subject Classification:
Theory of computation Computational geometry ; Theory of computation Design and analysis of algorithms ; Theory of computation Approximation algorithms analysisFunding:
All authors were supported by grant 2021-03810 (Illuminate: provably good algorithms for guarding problems) from the Swedish Research Council (Vetenskapsrådet). Brötzner and Nilsson were also funded by grant 20250562 (Illuminate and Move: provably good algorithms for exploration problems) from the Crafoord foundation.Editor:
Pierre FraigniaudSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
The problem of finding a shortest watchman route goes back to Chin and Ntafos, who also provided algorithms for rectilinear polygons [2]. Algorithms for simple polygons were first given in [3] and corrected in [10]. The shortest watchman route problem has two variants, the anchored or fixed variant, where the route must pass through a given point sometimes specified to lie on the boundary, and the non-anchored or floating variant with no requirement to pass a specific point. The currently best algorithm for the anchored version requires time in the worst case [11], if the anchor point is assumed to lie on the boundary of the polygon. The floating variant can be computed in time by combining the result in [11] with the method in [9].
For two watchmen, the so-called two-watchman route problem, Mitchell and Wynters [7] showed that computing routes with the objective of minimizing the length of the longer route (min-max) is weakly NP-hard. Nilsson and Packer [8] recently provided approximation algorithms for computing min-max two-watchman routes with an approximation ratio of for the floating case taking time, and for the case of two given starting points, not necessarily on the boundary, taking time.
We first consider the following variant of the two-watchman route problem. We are given point sized treasures (the set ) in the simple polygon that need to be guarded [1, 4]. For the single watchman route case, an appropriate modification of the algorithm of Tan and Jiang [11] obtains a shortest route that visits the visibility polygons of the treasures in time for the boundary anchored version and can be extended to time for the floating version using Tan’s technique [9]. We want to compute the shortest two routes and , starting at two points and , respectively, not necessarily on the boundary of the polygon, such that every point is seen from at least one point on one of the routes. Two natural optimization criteria have previously been considered for these problems: the min-max measure and the min-sum measure. For the min-max measure we wish to obtain two routes such that the longer of the two is as short as possible. As we prove, this problem is weakly NP-hard not only for the objective of seeing all of the simple polygons [7], but also for the objective of seeing all points in . The min-sum measure on the other hand asks for two routes such that the sum of their lengths is minimized. The complexity status for this version is unknown.
We develop two algorithms for this anchored discrete problem, optimizing on the min-max criterion, one having approximation ratio and running in time and an improved version that, for any fixed , gives an approximation ratio of , also running in time.
Secondly, we also consider the problem of guarding the complete polygon and modify the first algorithm developed for a discrete point set using results from Nilsson and Packer [8]. We obtain algorithms having approximation ratio for the anchored and for the floating versions of the two-watchman route problem. The algorithm for the anchored version runs in time and the algorithm for the floating version runs in time.
2 Preliminaries
Let be a simple polygon with vertices labeled in clockwise order, and let be a set of points in , the treasures. We assume that no three points among the polygon vertices and are collinear. Furthermore, let and be the two starting points for the watchman routes in , not necessarily lying on the boundary.
For a point , let be the visibility polygon of , the set of points in that are visible to . An edge of that is not contained in an edge of is called a window of .
Without loss of generality, we may assume that , for any , as those points are already seen from the starting points. Let be the window that separates the subpolygon of containing from . Analogously, let be the window that separates the subpolygon of containing from . Now, observe that a watchman who starts walking at () sees point as soon as it visits (). We assign a direction to each window () so that lies locally to the left of () if the polygon is rotated so that the window is directed upwards, see also Figure 1. We denote the lower endpoint of the window the bottom point of the window and the upper endpoint the top point.
We study the problem of computing two routes such that each of the treasures can be seen from at least one of the routes. We denote the length of a route by .
Problem 1 (Min-Max Two-Watchman Route Problem for Treasures).
Given a simple polygon , a set of points in , (and two starting points and ,) compute two routes and (where passes through and passes through ), such that every point of is visible from at least one point on or and such that is minimized.
Theorem 1.
Problem 1 is weakly NP-hard.
Proof.
The reduction is from 2-partition [6]. Let be a set of integers. We construct a polygon with points where an optimal watchman route that sees all points has length for some small constant , and an optimal solution to Problem 1 consists of two tours with length each, corresponding to an optimal partition of .
Let . We start with a regular convex polygon with vertices and perimeter , which we call the center of . The starting points and are placed on the boundary of the center. On the side of the center, we attach a rectilinear tube of width and length . At the end of each corridor, there is a small notch that contains point such that the window of has distance to the center. See Figure 2 for an illustration of the polygon.
The shortest watchman route that sees all points runs along the boundary of the center, and thus passes through both and , and walks through each tunnel up to the window of point , for . For two watchman routes, only one of them needs to visit the window of a point . As each route is connected and starts at its corresponding starting point, the watchmen also walk a portion within the center of the polygon. However, note that even walking along all of the boundary of the center extends the total route length only by an additive constant of , which does not affect the choice of points assigned to each route. Thus, for an optimal pair of routes , for Problem 1, the points are partitioned into two sets and , such that visits the windows of the points in and visits the windows of the points in . Hence, , corresponds to a 2-partition of .
We can extend this problem and require the whole polygon to be seen.
Problem 2 (Min-Max Two-Watchman Route Problem for a Polygon).
Given a simple polygon (and two starting points and ), compute two routes and (where passes through and passes through ), such that every point in is visible from at least one point on or and such that is minimized.
Let () be the shortest route that sees all the points in and passes through (). If () lies on the boundary of , we can use the modified algorithm by Tan and Jiang to compute it in time. If () does not lie on the boundary, we need to modify the algorithm to obtain which window is visited first along a clockwise traversal of the tour starting at (). By trying all possible windows, we can compute the optimal route in time.
We denote the min-max shortest pair of routes that together see all the points in , one passing through and the other passing through , by and . We can without loss of generality assume that each of and is as short as possible. Furthermore, we define .
For each , let be the shortest path from starting point to , i.e., to the window , and analogously let be the shortest path from starting point to , i.e., to the window ; these paths are marked in red in Figure 1. Let be the shorter of the two paths to see and let be the longer of these two paths.
We remark that finding an (approximate) min-max optimal pair of routes is a question of correctly partitioning the points to be seen between the route passing through and the route passing through . Once the partitioning is obtained, the routes can be computed in time as previously described.
3 The Algorithm
We describe an algorithm to compute two watchman routes to see a set of treasures in a polygon (Problem 1). This is also the basis for the algorithm for seeing the whole polygon (Problem 2) that we present in Section 4, and then generalize to the floating version in Section 5.
First, compute a shortest watchman route that sees all points in and starts at , and a shortest watchman route that sees all points in and starts at . If the two routes and of an optimal two-watchman route intersect, then either of and , together with a route of length at the respective other starting point, gives a 2-approximation. This follows from the fact that we can trace the subpaths of the routes between their intersection points to obtain a route that sees all the points in . Thus, . All the remaining steps use the assumption that the routes and do not intersect.
We partition the points in into two sets, depending on where and lie with respect to . Let be the set of points in for which , and let be the remaining set of points in ; see Figure 1 for an illustration. To compute the two watchman routes, we consider and separately in Sections 3.1 and 3.2, respectively.
3.1 Handling the Points in
Let and be the shortest paths from and , respectively, to . The endpoints of and different from and lie on windows and , respectively. If , then belongs to the set and we denote the window . Our objective in this section is to show how to compute two routes and of optimal min-max length such that they together see all the points in .
Consider the set of disjoint subpolygons of . Let be the subpolygon that contains and , for each point . If , we say that dominates , , since any route through or that visits must also visit . We call any point in dominating if it is not dominated by any other point in and assume henceforth that contains only dominating points.
For the sake of convenience in this section, we relabel each window associated to the point based on the first appearance of its bottom point on the boundary of along a clockwise traversal of the boundary. To do this, start at vertex and traverse the boundary in clockwise direction. Then, relabel the windows to in the order as the bottom point of each window is encountered. We order the associated points in correspondingly.
Let and be two min-max length routes that together see all points in .
Lemma 2.
Let be the windows of the dominating points in , ordered as their bottom points appear along the boundary in clockwise order. If and do not intersect, then there exist at most two indices and such that visits and visits . Implicitly assuming that indices are taken modulo .
Proof.
For three distinct indices , , and , we have that if one of the following sequences of inequalities holds: , or , or , i.e., there exists a boundary point on such that a clockwise traversal of the boundary starting at this point reaches the bottom points of the windows in the order , , .
Assume that there are indices such that intersects and , but not and , and intersects and , but not and . Consider the polygonal chain defined by the part of between its bottom point and its intersection with , the part of until its intersection with , and the part of until its top point; see Figure 3. This chain separates into two regions. By definition, lies in one of these regions . As does not visit , the window lies in the other region, . Let be the region enclosed by , , , and, if and do not intersect, possibly part of the polygon boundary; see Figure 3(b). The region may be empty; see Figure 3(a) for such an example. Since lies outside the visibility polygons associated to the four windows we consider, either lies in or in .
If lies in , then has to cross or in order to visit , contradicting the stated assumptions; see Figures 3(a) and (b). If lies in , then in order for to visit , it must cross the boundary of , again contradicting our stated assumptions. Hence, (and ) visits an ordered subsequence of the windows as stated. The previous lemma gives us an immediate algorithm to compute and . By trying every index pair , computing the shortest route starting at that visits the windows and the shortest route starting at that visits the windows , indices always taken modulo ||, and selecting the min-max shortest pair of these, we obtain the two desired routes and . There are index pairs, and computing the shortest route takes for each of these pair, as described in Section 2. Thus, the time complexity is bounded by . We state this result as a theorem.
Theorem 3.
The shortest min-max pair of routes in that see the points in can be computed in time under the assumption that they do not intersect.
3.2 Handling the Points in
Let and be the windows of that and reach, respectively. If , then belongs to the set . The visibility polygon must intersect the shortest path since the starting points lie in different components of . Our objective in this section is to show how to compute two routes and of almost optimal min-max length such that they together see all the points in .
First, we introduce a concept that we will use extensively in the sequel. Let be some length . If is the point at distance from on , we can trace the geodesic quarter circle of radius upwards from , the connected locus of points having shortest paths in of length to , ending the trace if it encounters the polygon boundary. Similarly, we can trace the geodesic quarter circle of radius downwards from ; see Figure 4(a). Define as the geodesic half circle of radius from . We call the region that is bounded by and the two shortest paths from to the endpoints of the funnel from of radius . We symmetrically define the geodesic half circle and the funnel from of radius .
Recall that is the shorter of the two paths from and to the visibility polygon , for every point . Let be the longest among all such paths for the points in , and let and be the funnels of radius from and , respectively. We can show that for every point , one of its windows , intersects the funnel (of radius ) from the corresponding starting point.
Lemma 4.
For any point , either or .
Proof.
Consider the point . Both windows and of intersect . Without loss of generality assume that , the other case is proved in the same way.
If intersects the subpath , where is the point at distance from along , then intersects the funnel and the lemma holds. If does not intersect the subpath , then it intersects the subpath at ; see Figure 4(b). The pseudotriangle bounded by , , and must have an acute angle at , since the angle between and is right or obtuse. Therefore, must intersect the geodesic half circle , since and is a subpath of one of the paths , hence intersects also in this case. Next, we compute an initial solution for which we can bound the min-max length. Let and be a partitioning of the points in that we obtain as follows. If for a point , then belongs to , otherwise belongs to . We call this the standard partitioning of the points in . It follows from Lemma 4 that each visibility polygon , for every , is at distance at most from one of or .
Let and be the two shortest routes that see the points in and , respectively, that we can compute with the modified method of Tan and Jiang [11].
Lemma 5.
The length of the two routes and is bounded by
Proof.
Consider the boundary of the funnel . It consists of two paths of length and a sequence of connecting arcs of circles having radius at most ; the sum of their lengths is bounded by . The perimeter is a route that intersects all the visibility polygons of the points in . Since is the shortest route that intersects these visibility polygons, its length is bounded by . The length of the perimeter of is bounded in the same way and since , the lemma follows. Next, we improve on the previous result by updating the standard partitioning and obtain a -approximation, for any . We consider to be a constant, sufficiently small, and define the integer .
We partition the points into two sets in such a way that for each point the shortest path from the corresponding starting point is within a factor from the optimum. In order to do this, we make a decomposition of the points in into few subsets such that those points for which their corresponding windows are “similar” are placed in the same subset. By then choosing one representative point from each subset, we can compute the optimal partition of them using brute force, since there are only a few points to partition. The partition of the representative points indicates in which partition each similar point should be in. Once the partition for the full set of points has been computed, we can compute the two shortest watchman routes using the algorithm described in Section 2. We provide the details of the construction below.
For any point where , we can immediately assume that must be seen by the route from the starting point for which the geodesic is shorter. Otherwise, , as the optimal route must at least be as long as the geodesic , followed to and back. In this case, the standard partitioning together with the optimal routes for , i.e., the solution gives at worst a -approximation to our problem, since . Let be the subset of the points in for which is “too long”, in particular, , and assume they are partitioned according to the starting point of their shorter geodesic . Furthermore, let be the remaining points in for which is “short”. It remains to find an appropriate partition of the points in . To do this, we define a refinement of the funnel, and partition it into cells.
Define . For the points , we have by definition, giving us that . Let and be the two funnels of radius from and , respectively.
We make a similarity decomposition of the set of points in into at most distinct subsets as follows. is the geodesic half circle of radius centered at ; see Figure 5(a). Consider the consecutive equidistant points , for , along , and being the two endpoints of . The points of between the two geodesics and , for each , define a subfunnel of , denoted , lightly shaded in Figure 5(a). We can further decompose each subfunnel into cells , for , depending on the distance to . A cell is more heavily shaded in Figure 5(a). The funnel thus decomposes into cells. Similarly, we decompose the funnel into cells , for .
We say that a window belongs to cell if the intersection point of and is a point in the cell . The point lies in the subset if belongs to , belongs to , and . In this way we have partitioned all the points in into at most distinct subsets.
For each non-empty subset, we select one point as the representative for the subset and let be the set of all the chosen representative points. By trying all partitions of the representative points of into two subsets, we compute the two shortest tours and that visit the visibility polygons of the points in , over all possible partitions of .
Let and be the two shortest routes obtained from the partition given by placing each point in a subset in the same partition as the representative point of this subset. The two routes can be computed in time. To bound the lengths of and, we introduce two auxiliary routes and that are easier to bound and prove that and are not longer than and , respectively.
Let . We construct the route from as follows ( is constructed from in the same way). Let be the supremum value for which the geodesic half circle intersects , i.e., . Let be a point of contact between and a convex vertex of ; see Figure 5(b). From follow in counterclockwise order until a reflex vertex of is encountered. From now follow in clockwise order until a reflex vertex of is encountered, where is the number of convex vertices on the clockwise path of from to . Let be the point of intersection of and and let be the angle between the tangent of at and the -axis. For simplicity of construction, assume , , and to be rotated so that , i.e., the tangent of at is vertical. Let , for some , be the vertex of such that the edges and lie on the same side of a vertical line through , i.e., the rightmost vertex of , if lies locally to the left and lies locally to the right of . For some , assume the edges have non-negative slope, for all . Similarly, for some , assume the edges have non-positive slope, for all . Let the clockwise subpath from to of also be the first part of . Add a vertical edge of length at upward to a new vertex and a vertical edge of length at downward to a new vertex . While , the segment has slope angle , and we offset the segment by a distance in the direction (increasing angles going clockwise around a circle), which gives the segment ; see Figures 5(b) and (c). We connect with by a circle arc with origin and radius , for each and finally connect back to with the corresponding subpath of ; again see Figures 5(b) and (c). If at some point the construction intersects the polygon boundary we shortcut the path so that it is the shortest to connect to in the free space of the polygon. We show that sees all points in and bound the min-max length.
Lemma 6.
The two-watchman route sees all points in and
Proof.
Recall that is an optimal min-max solution to the shortest two-watchman route problem for the points in , and let be an optimal min-max solution for the points in . Since is an optimal min-max solution for the problem on the points in , it follows that and , whereby .
Let be a point in , for some , , and assume that sees . This implies that intersects the window at some point . Consider any other point in the same subset as . Since the endpoints of and lie in the same cell, the angle between the windows and is at most and the distance between the two windows within the cell is at most as this is an upper bound on the farthest distance between any two points in a cell (the height of the cell plus the width of the cell); see Figure 6. Let be the endpoint of intersecting the window . Thus, the distance from to is bounded by
Hence, if sees , then sees all points in as was chosen arbitrarily in . We can argue the other possibility when sees in the same way and therefore, since and see all representative points in , and together see all points in .
It remains to bound the lengths of and . We do this only for as the argument for is the same. consists of translated segments from (recall that ), two additional segments of length , and circular arcs, also of radius , where the angle sum is at most ; see Figures 5(b) and (c). The total length of is therefore bounded by
as claimed.
We summarize the results on handling the points in .
Theorem 7.
The pair of watchman routes , that see the points in , can be computed in time, and has length bounded by
Proof.
By construction, the routes and visit the same windows as the routes and respectively. As and are the shortest routes that visit the windows in this way, and . Since and , we obtain
by our choice of . Moreover, we can compute and in time, as mentioned in Section 2.
3.3 Putting It All Together
Finally, we chose the shortest two routes among the possible pairs: a watchman route starting at and a stationary watchman at ; a watchman route starting at and a stationary watchman at ; and the combined watchman routes and , where and are the two routes that see the points in as defined in Section 3.1, and and are the improved routes that see the points in as computed in Section 3.2. Let
By combining the algorithms developed in Sections 3.1 and 3.2 together with the bounds in Theorems 3 and 7, we immediately have the following theorem. Since is considered to be a constant, it does not affect the total running time.
Theorem 8.
The two routes and see all points in , can be computed in time, and
for any fixed constant .
We remark that the two routes and given by
using the standard partitioning instead of the improved partitioning can be computed in time, have a min-max length bound of , but do not require exhaustive search to find the correct partition of the representative points in set .
4 Computing the Shortest Watchman Routes That See All of
We can generalize the method obtained in Section 3 to find two watchman routes that together see the whole polygon . We assume that the two optimal routes and for Problem 2 do not intersect, as otherwise a shortest watchman route starting at , or a shortest watchman route starting at , together with a route of length 0 at the respective other starting point, gives a 2-approximation (as explained in Step 1 in Section 3).
We carefully choose a set of points along the boundary of with the property that whenever and see these points, they see all of the boundary of , and for two watchmen, this is enough to see the polygon.
Theorem 9 (Lemma 3.1 in [8]).
If two watchmen together see all of the boundary of a polygon , then they see all of .
Consider a point on the boundary of that is not seen from or , and let be the visibility polygon of . We use the notation to denote the subpolygon in that contains , and to denote the subpolygon in that contains . Analogous to before, we call the edge the window of with respect to , and the edge the window of with respect to .
We want to see every point on the boundary. To be able to apply the strategy from Section 3, we start by defining two infinite sets and , and allocate every boundary point into one of them based on the windows of it. Let be the set of boundary points for which , and let be the remaining set of boundary points. This partitions every polygon edge into intervals of points that lie in the same set, or . We call such an interval a subedge and denote the set of subedges with points in by and the set of subedges with points in by . The endpoints of the subedges are either vertices of , i.e., points in , or interior points of the edges. We call these interior points transition points, and denote the set of all transition points by . Observe that each transition point is defined by one of the following:
-
The intersection of the polygon boundary with a line through two polygon vertices
-
A vertex of the visibility polygons and
We can trivially construct the arrangement of lines through polygon vertices in time, using a brute-force algorithm. This arrangement has complexity , and the polygon consists of edges. Thus, the intersection points of the arrangement and the polygon edges can be computed in time. The visibility polygon of a point in a polygon can be computed in time, see [5]. With this, can be computed in time (note that this is not optimal, but does not affect the final complexity of our algorithm).
The visibility polygon of every point in intersects the shortest path between the two starting points . Conversely, the visibility polygon of any point in cannot intersect . As the area seen by a point that moves along a polygon boundary edge changes continuously, we observe the following.
Lemma 10.
If and are two points in that lie on the same edge of then, every point between and is also in .
Proof.
Assume for a contradiction that there exists a point in the interior of that lies in . Then, the shortest path between the starting points lies fully inside . Let be the vertex endpoint on that is closest to , and consider the segment . This segment splits into two subpolygons, one containing and one containing . Assume w.l.o.g. that the subpolygon that contains does not contain , see Figure 7(a). Then, , since no ray emanating from can intersect both and except at and then belongs to , a contradiction.
Thus, every edge contains at most one subedge in and at most two subedges in , and there is at most a linear number of transition points.
To see the polygon boundary, we need to ensure that every subedge is seen. In a first step, we apply the strategy from Section 3 to . This ensures that all points in are seen. To do so, we partition the points in into two sets and , and consider the two discrete, linear-sized sets, and . We take care of the subedges in and separately. By adding the transition points to both sets and , we ensure that the endpoints of each subedge in lie in , and the endpoints of each subedge in lie in .
Again, our goal is to take care of each subedge separately. We assign a direction to so that lies locally to the left of , if the polygon is rotated so that the window is directed upwards. The shortest path that visits is fully contained in the subpolygon , and visits locally from the right. We analogously assign a direction to .
We refine our set of subedges by splitting every subedge in into segments that we call fragments such that for every point on a fragment, the windows of the points have the same orientation, either towards the subedge or away from the subedge.
Lemma 11.
Every subedge in is split into at most two fragments, that is, a transition between points with windows of different orientations happens at most once when sliding along .
Proof.
Consider the path . Extending the first segment of (adjacent to ) backwards until it hits the boundary of gives us a shortest path connecting two boundary points of . The path separates into two simply connected polygons and , lying locally to the left of (or on) as we move from towards along and lying locally to the right of (or on) as we move from towards . Assume, without loss of generality, that the farthest endpoint of lies in , otherwise we reverse the roles of and . An illustration is given in Figure 7(b). The point is a bottom or top point of . Let be a point that moves from to along the subedge and consider the window . As moves from to , the corresponding top (bottom) point of the window traverses the polygon boundary in . If aligns with a segment of at , the point moves from to and flips its orientation, goes from being a bottom (top) point in the open ended interval to being a top (bottom) point in the open ended interval . We call such a point a split point. Since is a shortest path, the alignment of and a segment of can occur only once. Hence, every subedge is split into at most two fragments at a split point.
For an edge , the split point is given by the intersection of the polygon boundary and a line through two polygon vertices, and can therefore be computed in the same way as the transition points. We replace the subedge in by these fragments, add the split points to , and update and accordingly.
With this modification, we handle the points in in the same way as described in Section 3.1, and obtain the two routes and . The following Lemma guarantees that every subedge in is seen.
Lemma 12.
Let be a fragment in . Either or sees all of .
Proof.
Since and lie on the same fragment of , one of the two subpolygons is fully contained in the other, say w.l.o.g. . The situation is as depicted in Figure 7(b), with at . Thus, if visits to see , it also visits , and since is part of a polygon edge, sees every point on . The case for is analogous.
Next, we handle the points in as described in Section 3.2 by computing the standard partitioning of the points. We make use of the following lemma.
Lemma 13 (Lemma 4.1 in [8]).
For a subedge , if a watchman sees and then it sees the whole subedge .
Thus, only those subedges in where each endpoint is seen by a different watchman, meaning that its two endpoints are separated in the standard partitioning, are not yet seen. Let be the set of these subedges. For our approximate solution, we aim to find a good way for both watchmen to cooperatively guard the edges in . To do so, we refine our discretization by splitting every subedge in into two, and let each watchman guard one of the resulting subedges.
For each subedge in , we compute the point on for which both watchmen have an equal distance from their starting point to the window of ’s visibility polygon, i.e., , see Figure 8.
Then, we replace with and . This can be done in time per subedge, using the strategy described in [8]. We also add to a third set of points , and modify the partitioning of by adding all points in to both partitions. With this, we simultaneously partition the subedges in based on their endpoints. Finally, we compute the shortest watchman routes for this new set of points. The two endpoints of a subedge are seen by the same watchman. Hence, by Lemma 13, the whole subedge is seen.
Furthermore, recall that we construct the standard partitioning by assigning every point to a starting point based on its distance to the starting point. Putting the points in into both partitions does not contradict the bound on the maximum length within each partition, since for every point , . Therefore, the bound of Lemma 5 also holds for the modified set , hence we get
Finally, as in Section 3.3, we choose the shortest set of watchman routes as our solution
Since the set contains at most points, we obtain a set of two watchman routes for of length at most in time.
Theorem 14.
The two routes and see all of , can be computed in time, and
5 Adaptations for the Floating Variant
Nilsson and Packer [8] show how to compute two points and having the property that: for any point on the boundary of , the shortest of the paths and has length bounded by , where is the min-max length of the optimum floating two-watchman route. Recall that in Section 4, we defined a set of points on the boundary. Therefore, for the two points and , the stated property holds in particular for the points in . The computation of and takes time.
Using the method derived in Section 4, we split the points in into and and can obtain a pair of watchman routes and through the points and , respectively, in additional time. These two routes consist of two subroutes and , where and see the points in , and the subroutes and see the points in . The length of each of and is bounded by , since the optimal routes are not guaranteed to pass through and but there is some point on each of the two optimal routes at a distance at most from and , respectively. The length of and is bounded by the length of the perimeter of its funnel, i.e., ; see Lemma 5. We therefore conclude
Corollary 15.
For a polygon , the pair of watchman routes that see all of can be computed in time, and
where is the maximum length of an optimal pair of watchman routes for the floating two-watchman route problem in .
6 Conclusion
We have addressed the two-watchman route problem in simple polygons by providing an approximation algorithm that is based on a discretization of the polygon boundary. The hardness in finding a good solution lies in determining a partition of the polygon boundary pieces into two subsets, such that each piece is seen by one of the two watchmen. For more than two watchmen, to see a discrete point set, a generalization of our partitioning scheme could be a promising strategy. However, to see the whole polygon with three (or more) watchmen, seeing the polygon boundary is not sufficient. Obtaining such approximation algorithms therefore requires different methods.
Since optimal watchman routes for the min-sum objective behave differently than for the min-max objective, our strategy does not apply, except for the crude observation that the longest of two min-max optimal routes is at most as long as the longest of two min-sum optimal routes. This adds a multiplicative factor of on our results for the min-max measure, giving an approximation factor of for the anchored version, and a factor of for the floating version – better than the currently best known factors of for the anchored version and for the floating version [8]. Nilsson and Packer’s approximation factor for the anchored version is larger than for the floating version as their anchored routes result from enforcing the floating routes to pass through the starting points, while in our algorithms the anchored routes are constructed from the starting points. Finally, the computational complexity of the min-sum two-watchman route problem in simple polygons remains open.
References
- [1] Svante Carlsson and Håkan Jonsson. Guarding a treasury. In Proceedings of the 5th Canadian Conference on Computational Geometry, Waterloo, Ontario, Canada, pages 85–90. University of Waterloo, 1993.
- [2] Wei-pang Chin and Simeon C. Ntafos. Optimum watchman routes. Inf. Process. Lett., 28(1):39–44, 1988. doi:10.1016/0020-0190(88)90141-X.
- [3] Wei-pang Chin and Simeon C. Ntafos. Shortest watchman routes in simple polygons. Discr. Comput. Geom., 6:9–31, 1991. doi:10.1007/BF02574671.
- [4] Linda L. Deneen and Shashikant Joshi. Treasures in an art gallery. In Proceedings of the 4th Canadian Conference on Computational Geometry, St. John’s, Newfoundland, Canada, pages 17–22. Memorial University of Newfoundland, 1992.
- [5] Barry Joe and R. B. Simpson. Corrections to Lee’s visibility polygon algorithm. BIT, 27(4):458–473, 1987. doi:10.1007/BF01937271.
- [6] Richard M. Karp. Reducibility among combinatorial problems. In Raymond E. Miller and James W. Thatcher, editors, Proceedings of a symposium on the Complexity of Computer Computations, held March 20-22, 1972, at the IBM Thomas J. Watson Research Center, Yorktown Heights, New York, USA, The IBM Research Symposia Series, pages 85–103. Plenum Press, New York, 1972. doi:10.1007/978-1-4684-2001-2_9.
- [7] Joseph S. B. Mitchell and Erik L. Wynters. Watchman routes for multiple guards. In Proceedings of the 3rd Canadian Conference on Computational Geometry, pages 126–129, 1991.
- [8] Bengt J. Nilsson and Eli Packer. Approximation algorithms for the two-watchman route in a simple polygon. Algorithmica, 86(9):2845–2884, 2024. doi:10.1007/S00453-024-01245-0.
- [9] Xuehou Tan. Fast computation of shortest watchman routes in simple polygons. Inf. Process. Lett., 77(1):27–33, 2001. doi:10.1016/S0020-0190(00)00146-0.
- [10] Xuehou Tan, Tomio Hirata, and Yasuyoshi Inagaki. Corrigendum to "An Incremental Algorithm for Constructing Shortest Watchman Routes". Int. J. Comput. Geom. Appl., 9(3):319–323, 1999. doi:10.1142/S0218195999000212.
- [11] Xuehou Tan and Bo Jiang. Efficient algorithms for touring a sequence of convex polygons and related problems. In Proceedings of Theory and Applications of Models of Computation, TAMC 2017, pages 614–627. Springer Verlag, Lecture Notes in Computer Science 10185, 2017. doi:10.1007/978-3-319-55911-7_44.
