1 Introduction

Some of the most intriguing problems in computational geometry concern visibility and motion planning in polygonal environments. A classical problem is that of computing a shortest watchman route in an environment, i.e., the shortest closed tour that sees the complete free-space of the environment. Watchman routes can either be fixed, requiring the tour to pass a given boundary point or floating, with no requirement to pass any specific point. These problems have been shown NP-hard [7, 10] and even \(\Omega (\log n)\)-inapproximable [23] for polygons with holes having a total of n segments.

After a sequence of false starts [8, 14, 31, 32], Tan et al. [33] prove an \(O(n^4)\) time dynamic programming algorithm for computing a shortest fixed watchman route through a given boundary point in a simple polygon. This is later improved to \(O(n^3\log n)\) time by Dror et al. [9] and to \(O(n^3)\) time by Tan and Jiang [34]. Carlsson et al. [6] show how to generalize an algorithm that computes a shortest fixed watchman route to compute a shortest floating watchman route in a simple polygon with a quadratic factor overhead. Tan [29] improves this to a linear factor overhead. Hence, the currently best algorithm for a shortest floating watchman route in a simple polygon uses \(O(n^4)\) time.

Given the relatively high polynomial time complexity for computing watchman routes in simple polygons, efficient approximation algorithms are also of interest. Nilsson [25] and Tan [30] have independently developed linear time approximation algorithms for a shortest floating watchman route in a simple polygon.

The more general problem of computing multiple watchman routes that together see the environment has received much less attention. Mitchell and Wynters [24] show that already computing the pair of tours that together see a simple rectilinear polygon is NP-hard, if we want to minimize the length of the longest of the two tours, the minmax measure. It is still an open problem whether it is possible to compute a pair of tours for which the sum of the lengths of the two tours is minimal, the minsum measure, in polynomial time. Packer [26] gives some experimental results for multiple watchman routes in simple polygons. For point sized watchmen, so-called static guards, Belleville [3, 4] shows an efficiently computable characterization of all simple polygons that are two-guardable with point guards.

Our Results. We present a polynomial time constant factor approximation algorithm to compute a minmax or minsum pair of tours that together see a simple polygon. We first consider the floating version of the problem and obtain a 5.969-approximation algorithm for the minmax pair of tours and 11.939-approximation for the minsum pair of tours that runs in \(O(n^8)\) time, where n is the number of vertices of the polygon.

In the next three sections, we provide some preliminary results and prove some crucial properties that we use continuously in the sequel. In Sect. 5, we give the algorithm for the minmax two-watchman route prove its correctness and analyze its running time. In Sect. 6, we show how to modify the previous algorithm to run in \(O(n^4)\) time while maintaining constant approximation factor, albeit only guaranteeing a factor twice as large as the previous algorithm. In Sect. 7 we modify the algorithm to handle the fixed two-watchman route, the case when we have fixed starting points for the tours that they have to pass through, arriving at an \(O(n^2)\) time algorithm with approximation factor 6.922. We conclude the presentation in Sect. 8.

2 Preliminaries

Let P be a simple polygon having n vertices and let \(\partial {\textbf {P}}\) denote the boundary of P. We say that two points in P see each other, if the line segment connecting the points does not intersect the exterior of P. For any arbitrary connected object X inside P, we denote by \({\textbf {VP}}(\textit{X})\) the weak visibility polygon of X in P, i.e., the set of points in P that see some point of X. The boundary of a visibility polygon \({\textbf {VP}}(\textit{X})\) consists of edges that are either (sub)edges of P or edges that have their end points on \(\partial {\textbf {P}}\) but their interior points in the interior of P. These latter edges are denoted the windows of \({\textbf {VP}}(\textit{X})\) and they have at least one end point on a reflex vertex of P. We henceforth assume the existence of linear time algorithms to compute \({\textbf {VP}}(\textit{X})\) when X is a point or a segment inside P. Such algorithms have previously been presented in the literature [12, 16, 21, 28].

A cut is a directed line segment in P with both end points on \(\partial {\textbf {P}}\) and each interior point is an interior point of P. Hence, a directed segment incident to a polygon edge or a directed segment intersecting more than two vertices is not a cut. A cut always separates P into exactly two sub-polygons of nonzero area. If a cut is represented by the segment \([\textit{p},\textit{q}]\) we say that the cut is directed from \(\textit{p}\) to \(\textit{q}\). For a cut c in P, we define the left polygon, \({\textbf {L}}(c)\), to be the set of points in P locally to the left of c according to c’s direction.

Assume a counterclockwise walk of \(\partial {\textbf {P}}\). Such a walk imposes a direction on each of the edges of P in the direction of the walk. Consider a reflex vertex of P. The two edges incident to the vertex can each be extended inside P until the extensions reach a boundary point. These extended segments form cuts given the same direction as the edge they are collinear to. We call these cuts extensions; see Fig. 1a and denote the set of extensions in P by \(\mathcal {E}\).

Fig. 1
figure 1

Illustrating the definition of extensions (a) and an example where a disconnected set has points to the left of every extension (the marked blue convex vertices) but does not see the whole polygon (b) (Color figure online)

We define a guard set to be any set of points \(\mathcal {G}\) that together see all of P, i.e., \(\bigcup _{g\in \mathcal {G}}{{\textbf {VP}}(g)}={\textbf {P}}\). It is clear that any guard set must have points intersecting \({\textbf {L}}(\textit{e})\) for every extension \(\textit{e}\) of P, since otherwise the edge collinear to \(\textit{e}\) will not be seen by the guard set; see Fig. 1a. Chin and Ntafos [8] prove that this is indeed also a sufficient requirement when the guard set is connected, as it is for a shortest watchman route. For disconnected guard sets, it is easy to construct examples where this requirement is not sufficient; see Fig. 1b where the guard set consisting of the three marked convex vertices has points to the left of each essential extension but it does not see the complete polygon.

Let c be a cut. If a guard set \(\mathcal {G}\) intersects \({\textbf {L}}(c)\), i.e., \(\mathcal {G}\cap {\textbf {L}}(c)\) is non-empty, we say that c is covered by \(\mathcal {G}\). Furthermore, if \(\mathcal {G}\) intersects the interior of \({\textbf {L}}(c)\), then \(\mathcal {G}\) properly covers c. If \(\mathcal {G}\) properly covers c and intersects c, we say that \(\mathcal {G}\) crosses c. Finally, if \(\mathcal {G}\) covers c, but does not properly cover c, then \(\mathcal {G}\) reflects on c; see Fig. 2.

Fig. 2
figure 2

Illustrating covering, crossing, and reflecting guard sets. The cut c is covered in all four examples

We also make use of the fact that shortest paths in P between combinations of segments and points can be computed efficiently [12, 13, 21]. We denote the shortest path between two objects X and Y in P by \(\textit{SP}(X,Y)\).

Let \(\textit{X}_1\) and \(\textit{X}_2\) be two closed polygonal cycles contained in a simple polygon P, such that each point in P sees some point on \(\textit{X}_1\) or \(\textit{X}_2\). We call the pair \(\mathcal {X}=(\textit{X}_1,\textit{X}_2)\), a two-watchman route. The length of a cycle X in P is denoted \(\Vert \hspace{-0.08em}\textit{X}\hspace{-0.08em}\Vert \) and we let \(\Vert \hspace{-0.08em}\mathcal {X}\hspace{-0.08em}\Vert _{{\tiny \mathsf sum}}{\mathop {=}\limits ^{\text {def}}}\Vert \hspace{-0.08em}\textit{X}_1\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}\textit{X}_2\hspace{-0.08em}\Vert \) be the sum length of \(\mathcal {X}\) and \(\Vert \hspace{-0.08em}\mathcal {X}\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}{\mathop {=}\limits ^{\text {def}}}\max \big \{\Vert \hspace{-0.08em}\textit{X}_1\hspace{-0.08em}\Vert ,\Vert \hspace{-0.08em}\textit{X}_2\hspace{-0.08em}\Vert \big \}\) be the max length of \(\mathcal {X}\).

Let \(\mathcal {S}=(\textit{S}_1,\textit{S}_2)\) and \(\mathcal {T}=(\textit{T}_1,\textit{T}_2)\) be two two-watchman routes such that \(\Vert \hspace{-0.08em}\mathcal {S}\hspace{-0.08em}\Vert _{{\tiny \mathsf sum}}\le \Vert \hspace{-0.08em}\mathcal {X}\hspace{-0.08em}\Vert _{{\tiny \mathsf sum}}\) and \(\Vert \hspace{-0.08em}\mathcal {T}\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}\le \Vert \hspace{-0.08em}\mathcal {X}\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}\) for any two-watchman route \(\mathcal {X}\) in P. We say that \(\mathcal {S}\) is a minsum two-watchman route and \(\mathcal {T}\) is a minmax two-watchman route. The following inequalities are immediate from the definitions, for any two-watchman route \(\mathcal {X}\),

$$\begin{aligned} \Vert \hspace{-0.08em}\mathcal {X}\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}=&\max \big \{\Vert \hspace{-0.08em}\textit{X}_1\hspace{-0.08em}\Vert ,\Vert \hspace{-0.08em}\textit{X}_2\hspace{-0.08em}\Vert \big \}\le \Vert \hspace{-0.08em}\textit{X}_1\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}\textit{X}_2\hspace{-0.08em}\Vert =\Vert \hspace{-0.08em}\mathcal {X}\hspace{-0.08em}\Vert _{{\tiny \mathsf sum}}, \end{aligned}$$
(1)
$$\begin{aligned} \Vert \hspace{-0.08em}\mathcal {X}\hspace{-0.08em}\Vert _{{\tiny \mathsf sum}}=&\Vert \hspace{-0.08em}\textit{X}_1\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}\textit{X}_2\hspace{-0.08em}\Vert \le 2\max \big \{\Vert \hspace{-0.08em}\textit{X}_1\hspace{-0.08em}\Vert ,\Vert \hspace{-0.08em}\textit{X}_2\hspace{-0.08em}\Vert \big \}=2\Vert \hspace{-0.08em}\mathcal {X}\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}, \end{aligned}$$
(2)

and therefore

$$\begin{aligned} \Vert \hspace{-0.08em}\mathcal {T}\hspace{-0.08em}\Vert _{{\tiny \mathsf max}} \le \Vert \hspace{-0.08em}\mathcal {S}\hspace{-0.08em}\Vert _{{\tiny \mathsf sum}} \le 2\Vert \hspace{-0.08em}\mathcal {T}\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}. \end{aligned}$$
(3)

Hence, computing a c-approximation for one measure also gives at most a 2c-approximation for the other measure.

One could imagine that there always is a cut in the polygon such that the two tours that are shortest watchman tours for the two sub-polygons formed are almost as short as the optimum two-watchman tour. Trying out all possible cuts, and solving the two single watchman tour subproblems in each case would give a simple and efficient algorithm with good approximation ratio. One would then imagine wrong, as the counterexample in Fig. 3c shows. The red and blue point sized tours, each see the grey region and the regions of their own color. Here, any partition of the polygon into two pieces by a cut will make the watchman tour solution of each piece infinitely longer than the optimal solution. The example can easily be modified for non-point sized tours.

Fig. 3
figure 3

A counterexample, showing that no cut through the polygon separates the two-watchman route problem into two independent single watchman route problems having reasonable approximation ratio

3 General Properties of Two-Watchman Routes

We make the following assumption about the polygons considered in this section.

Assumption 3.1

The polygon P considered in this section is simple and not guardable by one or two point guards. Hence, P is not convex or starshaped.

The following lemma is at the heart of our construction of an algorithm to compute a two-watchman route.

Lemma 3.1

If two tours in P see all of \(\partial {\textbf {P}}\), then they see all of P.

Proof

We do a proof by contradiction. Let \(\textit{X}_1\) and \(\textit{X}_2\) be two tours in P and assume that \(\textit{p}\) is an interior point of P not seen by any of them. We show that there must be some boundary point that is also not seen by the tours contradicting that \(\textit{X}_1\) and \(\textit{X}_2\) together see \(\partial {\textbf {P}}\). Let \({\textbf {VP}}(\textit{X}_1)\) and \({\textbf {VP}}(\textit{X}_2)\) be the two visibility polygons of the tours. Each of them must have boundary segments \(\textit{w}_{1}\) and \(\textit{w}_{2}\) separating the subpolygon containing \(\textit{p}\) from the subpolygon containing the tour. The segment \(\textit{w}_{1}\) cuts P into two subpolygons. Let \({\textbf {P}}_{\!\textit{X}_1}\) be the subpolygon containing \(\textit{X}_1\) and let \({\textbf {P}}_{\!\textit{p}}\) be the subpolygon containing \(\textit{p}\). If \(\textit{X}_2\) intersects \(\textit{w}_{1}\), we interchange the roles of \(\textit{X}_1\) and \(\textit{X}_2\), thus we can assume that \(\textit{X}_2\) is either completely in \({\textbf {P}}_{\!\textit{X}_1}\) or completely in \({\textbf {P}}_{\!\textit{p}}\). We have three cases:

  • \(\textit{X}_2\) lies in \({\textbf {P}}_{\!\textit{X}_1}\). Let \(\textit{SP}(\textit{p},\textit{X}_2)\) be the shortest path from \(\textit{p}\) to \(\textit{X}_2\) and let \(\textit{s}\) be the first segment of this path. It connects \(\textit{p}\) with a reflex vertex \(\textit{v}\) on the boundary of P. Extend \(\textit{s}\) away from \(\textit{v}\) until it hits the boundary at \(\textit{p}\)’; see Fig. 4a. The point \(\textit{p}\)’ is clearly not seen by \(\textit{X}_2\) since if it were, then \(\textit{p}\) would also bee seen by \(\textit{X}_2\). The point \(\textit{p}\)’ is not seen by \(\textit{X}_1\) either since \(\textit{SP}(\textit{p},\textit{X}_2)\) crosses \(\textit{w}_{1}\) at some point \(\textit{q}\) with \(\textit{SP}(\textit{p},\textit{q})\) in \({\textbf {P}}_{\!\textit{p}}\) and since \(\textit{SP}(\textit{p},\textit{q})\) is a shortest path, the extension from \(\textit{p}\) to \(\textit{p}\)’ cannot cross \(\textit{w}_{1}\); see Fig. 4b.

  • \(\textit{X}_2\) lies in \({\textbf {P}}_{\!\textit{p}}\) and \(\textit{w}_{1}\) and \(\textit{w}_{2}\) intersect. Let \(\textit{q}\) be the intersection point between \(\textit{w}_{1}\) and \(\textit{w}_{2}\) and let \(\textit{s}\) be the first segment of \(\textit{SP}(\textit{p},\textit{q})\). It connects \(\textit{p}\) either with a reflex vertex \(\textit{v}\) on the boundary of P or with \(\textit{q}\). Extend \(\textit{s}\) away from \(\textit{v}\) (or \(\textit{q}\)) until it hits the boundary at \(\textit{p}\)’; see Fig. 4c. The point \(\textit{p}\)’ cannot be seen by \(\textit{X}_1\) or \(\textit{X}_2\) since \(\textit{SP}(\textit{p},\textit{q})\) lies outside both \({\textbf {VP}}(\textit{X}_1)\) and \({\textbf {VP}}(\textit{X}_2)\) (except for the point \(\textit{q}\)), and hence, since \(\textit{SP}(\textit{p},\textit{q})\) is a shortest path, the extension from \(\textit{p}\) to \(\textit{p}\)’ cannot cross any of \(\textit{w}_{1}\) or \(\textit{w}_{2}\).

  • \(\textit{X}_2\) lies in \({\textbf {P}}_{\!\textit{p}}\) and \(\textit{w}_{1}\) and \(\textit{w}_{2}\) do not intersect. It is clear that there exist points on the boundary not seen by the two tours since the boundary points close to the end points of \(\textit{w}_{1}\) not in \({\textbf {P}}_{\!\textit{X}_1}\) and the boundary points close to the end points of \(\textit{w}_{2}\) not in \({\textbf {P}}_{\!\textit{X}_2}\) are not seen by any of the tours; see Fig. 4d.

This completes the proof. \(\square \)

The lemma implies that it is sufficient that our algorithm constructs two tours that together see the whole boundary of P to guarantee that all of P is guarded. The example in Fig. 1b shows that the claim does not hold for three guard sets.

Fig. 4
figure 4

Illustrating the three cases of the proof of Lemma 3.1. Examples a, b illustrate the case when \(\textit{X}_2\) lies in \({\textbf {P}}_{\!\textit{X}_1}\)c illustrates the case when \(\textit{X}_2\) lies in \({\textbf {P}}_{\!\textit{p}}\) and \(\textit{w}_{1}\) and \(\textit{w}_{2}\) intersect, and d the case when \(\textit{X}_2\) lies in \({\textbf {P}}_{\!\textit{p}}\) and \(\textit{w}_{1}\) and \(\textit{w}_{2}\) do not intersect

Consider two tours \(\textit{X}_1\) and \(\textit{X}_2\) and a polygon boundary edge \(\textit{b}\).

Lemma 3.2

For any two tours \(\textit{X}_1\) and \(\textit{X}_2\) and a polygon boundary edge \(\textit{b}\), the sets \({{\textbf {VP}}(\textit{X}_1)}\cap \textit{b}\), \({{\textbf {VP}}(\textit{X}_2)}\cap \textit{b}\) and \({{\textbf {VP}}(\textit{X}_1)}\cap {{\textbf {VP}}(\textit{X}_2)}\cap \textit{b}\) are each connected.

Proof

If the set under consideration is empty, the lemma follows by definition so assume in each case that it is nonempty. If any of \({{\textbf {VP}}(\textit{X}_i)}\cap \textit{b}\), for \(i\in \{1,2\}\), is connected, it is a subsegment of \(\textit{b}\) and therefore convex. Since the intersection of two connected and convex sets is also a connected and convex set, it follows that the connectedness of \({{\textbf {VP}}(\textit{X}_1)}\cap {{\textbf {VP}}(\textit{X}_2)}\cap \textit{b}=\bigcap _{i\in \{1,2\}} {{\textbf {VP}}(\textit{X}_i)}\cap \textit{b}\) is an immediate consequence, if we can show that the two sets \({{\textbf {VP}}(\textit{X}_i)}\cap \textit{b}\), for \(i\in \{1,2\}\), are connected.

We make a proof by contradiction and assume that \({{\textbf {VP}}(\textit{X}_i)}\cap \textit{b}\) is disconnected, for each \(i\in \{1,2\}\). By following \(\textit{b}\) from one end point to the other we pass each of the connected components giving us an ordering of them. Let \(\textit{r}_1\) be a point in the first component and let \(\textit{r}_2\) be a point in the last component. Each point \(\textit{r}_1\) and \(\textit{r}_2\) is seen by \(\textit{X}_i\). Hence, for \(\textit{X}_i\) there is a point \(\textit{r}\)’ on \(\textit{b}\) between \(\textit{r}_1\) and \(\textit{r}_2\) that is not seen by \(\textit{X}_i\). Let \(\textit{p}_j\), for \(j\in \{1,2\}\), be two points on \(\textit{X}_i\) that see \(\textit{r}_j\) respectively. Without loss of generality, we can assume that \([\textit{p}_j,\textit{r}_j]\) does not intersect \(\textit{X}_i\) except at \(\textit{p}_j\), for \(i\in \{1,2\}\). If the segments \([\textit{p}_1,\textit{r}_1]\) and \([\textit{p}_2,\textit{r}_2]\) do not intersect, we construct a closed simple polygon \({\textbf {R}}_i\) in P as follows: follow \(\textit{b}\) from \(\textit{r}_1\) to \(\textit{r}_2\), from \(\textit{r}_2\) to \(\textit{p}_2\), from \(\textit{p}_2\) to \(\textit{p}_1\) along a simple path in \(\textit{X}_i\), and finally from \(\textit{p}_1\) to \(\textit{r}_1\). The only edges of the constructed polygon \({\textbf {R}}_i\) that are not part of \(\textit{X}_i\) are the three edges adjacent to \(\textit{r}_1\) and \(\textit{r}_2\) so \({\textbf {R}}_i\) is completely seen by the part of the tour \(\textit{X}_i\) connecting \(\textit{p}_2\) to \(\textit{p}_1\). Hence, the point \(\textit{r}\)’ is also seen since it lies on \(\textit{b}\) between \(\textit{r}_1\) and \(\textit{r}_2\), giving us a contradiction.

On the other hand if the segments \([\textit{p}_1,\textit{r}_1]\) and \([\textit{p}_2,\textit{r}_2]\) intersect, let \(\textit{q}\) be an intersection point between \([\textit{p}_1,\textit{r}_1]\) and \([\textit{p}_2,\textit{r}_2]\). The three points \(\textit{p}_1\), \(\textit{p}_2\), and \(\textit{q}\) form a triangle interior to P and we construct a closed simple polygon \({\textbf {R}}'_i\) in P having \(\textit{q}\) as a vertex as follows: follow a simple path of \(\textit{X}_i\) from \(\textit{p}_1\) to \(\textit{p}_2\), a straight edge from \(\textit{p}_2\) to \(\textit{q}\), and a straight edge from \(\textit{q}\) to \(\textit{p}_1\). If we extend the segment \([\textit{p}',\textit{q}]\) inside \({\textbf {R}}'_i\), it must intersect \(\textit{X}_i\), since \(\textit{p}_1\) connects to \(\textit{p}_2\) in \({\textbf {R}}'_i\) using a simple path of \(\textit{X}_i\). Hence, the point \(\textit{p}\)’ is also seen from \(\textit{X}_i\), again giving us a contradiction. \(\square \)

From Lemma 3.2 we have that \(\textit{T}_1\) and \(\textit{T}_2\) both see connected components of any boundary edge of P. Hence, a boundary edge \(\textit{b}\) can be partitioned into at most three subsegments, at most one of which is seen by both \(\textit{T}_1\) and \(\textit{T}_2\) and the remaining at most two are seen by one of \(\textit{T}_1\) and \(\textit{T}_2\).

Our next lemma shows that \(\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}<\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert \) and this strict inequality is used in the proof of Lemma 3.5.

Lemma 3.3

Let \((\textit{T}_1,\textit{T}_2)\) be the shortest minmax two-watchman route and \(\textit{W}_{{\tiny \mathsf \!opt}}\) the shortest watchman route. If \(\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert >0\),

$$\begin{aligned} \Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}<\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert . \end{aligned}$$

Proof

Consider a shortest watchman route \(\textit{W}_{{\tiny \mathsf \!opt}}\) and let \(\textit{p}\) and \(\textit{q}\) be two points on \(\textit{W}_{{\tiny \mathsf \!opt}}\) such that if you follow the tour \(\textit{W}_{{\tiny \mathsf \!opt}}\) from \(\textit{p}\) a distance of \(\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert /2\) in counterclockwise order, you reach the point \(\textit{q}\). It is clear that following the tour from \(\textit{p}\) to \(\textit{q}\) in clockwise order also gives a path of length \(\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert /2\).

Let \(\textit{SP}(\textit{p},\textit{q})\) be the shortest path from \(\textit{p}\) to \(\textit{q}\) in P. If \(\Vert \hspace{-0.08em}\textit{SP}(\textit{p},\textit{q})\hspace{-0.08em}\Vert <\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert /2\), we construct a two-watchman route \((\textit{X}_1,\textit{X}_2)\) such that \(\Vert \hspace{-0.08em}(\textit{X}_1,\textit{X}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}<\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert \) as follows. Let \(\textit{X}_1\) be the tour obtained by following \(\textit{SP}(\textit{p},\textit{q})\) from \(\textit{p}\) to \(\textit{q}\) and \(\textit{W}_{{\tiny \mathsf \!opt}}\) from \(\textit{q}\) to \(\textit{p}\) in counterclockwise order. Since \(\Vert \hspace{-0.08em}\textit{SP}(\textit{p},\textit{q})\hspace{-0.08em}\Vert <\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert /2\), the length of \(\textit{X}_1\) is strictly smaller than \(\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert \). The tour \(\textit{X}_2\) is obtained by following \(\textit{W}_{{\tiny \mathsf \!opt}}\) from \(\textit{p}\) to \(\textit{q}\) in counterclockwise order and then \(\textit{SP}(\textit{p},\textit{q})\) from \(\textit{q}\) to \(\textit{p}\). Again, the length of \(\textit{X}_2\) is strictly smaller than \(\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert \).

If \(\Vert \hspace{-0.08em}\textit{SP}(\textit{p},\textit{q})\hspace{-0.08em}\Vert =\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert /2\), on the other hand, then both the clockwise and counterclockwise paths from \(\textit{p}\) to \(\textit{q}\) along \(\textit{W}_{{\tiny \mathsf \!opt}}\) follow \(\textit{SP}(\textit{p},\textit{q})\), since shortest paths are unique. We construct a two-watchman route \((\textit{X}_1,\textit{X}_2)\) as follows. Let \(\textit{r}\) be the midpoint on \(\textit{SP}(\textit{p},\textit{q})\) and let \(\textit{X}_1\) be the tour obtained by following \(\textit{SP}(\textit{p},\textit{q})\) from \(\textit{p}\) to \(\textit{r}\) and back to \(\textit{p}\). Similarly, let \(\textit{X}_2\) be the tour obtained by following \(\textit{SP}(\textit{p},\textit{q})\) from \(\textit{q}\) to \(\textit{r}\) and back to \(\textit{q}\). We have that \(\Vert \hspace{-0.08em}(\textit{X}_1,\textit{X}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}=\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert /2<\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert \) also in this case.

Since \((\textit{T}_1,\textit{T}_2)\) is the shortest minmax two-watchman route, it has max-length bounded by that of \((\textit{X}_1,\textit{X}_2)\) and is hence also strictly smaller than \(\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert \), concluding the proof. \(\square \)

In the previous section, we defined \(\mathcal {E}\) to be the set of extensions of the edges in P. There is a subdivision of \(\mathcal {E}\) into nonempty subsets \(\mathcal {E}_1\) and \(\mathcal {E}_2\), such that each tour \(\textit{T}_1\) and \(\textit{T}_2\) of a minmax two-watchman route covers the extensions in \(\mathcal {E}_1\) and \(\mathcal {E}_2\) respectively. It is clear that neither \(\mathcal {E}_1\) nor \(\mathcal {E}_2\) can be empty since if one of them is empty, the other contains all the extensions of \(\mathcal {E}\). This means that one of \(\textit{T}_1\) or \(\textit{T}_2\) covers all the extensions in \(\mathcal {E}\), but the shortest tour that covers all extensions in \(\mathcal {E}\) is \(\textit{W}_{{\tiny \mathsf \!opt}}\), the shortest watchman route, contradicting Lemma 3.3. Note also that the subdivision is not necessarily a partition since an extension in \(\mathcal {E}\) can be covered by both \(\textit{T}_1\) and \(\textit{T}_2\).

Assume from now on that each tour \(\textit{T}_1\) and \(\textit{T}_2\) is as short as possible and consider the points of the boundary \(\partial {\textbf {P}}\) of P that are seen by \(\textit{T}_1\). The visibility from \(\textit{T}_1\) subdivides \(\partial {\textbf {P}}\) into disjoint (maximal) subpaths and we color the interior points of each subpath white if \(\textit{T}_1\) sees these points and black if \(\textit{T}_1\) does not see the points. The end points of each (maximal) subpath is colored grey. For a color \(c\in \{{ black}, { grey}, { white}\}\), we say that a point on \(\partial {\textbf {P}}\) has color c for \(\textit{T}_1\). We can similarly color the boundary for \(\textit{T}_2\) in which case we say that a point has color \(c'\) for \(\textit{T}_2\), \(c'\in \{{ black}, { grey}, { white}\}\).

We refine the coloring of the boundary somewhat by considering the convex vertices of \(\textit{T}_1\). Let \(\Vert \textit{T}_1\Vert >0\) and let \(\textit{u}\) be a convex vertex of \(\textit{T}_1\). There exists at least one grey boundary point \(\textit{p}(\textit{u})\) that is seen from \(\textit{u}\) but not from any other point of \(\textit{T}_1\). The point \(\textit{p}(\textit{u})\) must exist, otherwise \(\textit{T}_1\) can be made shorter, contradicting that the tours \(\textit{T}_1\) and \(\textit{T}_2\) are as short as possible. In fact, \(\textit{u}\) can have many such points. We therefore consider a convex vertex \(\textit{u}\) of \(\textit{T}_1\) to have multiplicity k, if there are k different points \(\textit{p}(\textit{u})\) associated to \(\textit{u}\). We differentiate between \(\textit{p}(\textit{u})\) and \(\textit{p}(\textit{u}')\) even though \(\textit{u}=\textit{u}'\) and has multiplicity at least two. We let the color of each point \(\textit{p}(\textit{u})\) be dark grey. The remaining grey points are considered to be light grey.

Let \(\textit{l}(\textit{u})\) be the maximal line segment in P passing through the points \(\textit{u}\) on \(\textit{T}_1\) and \(\textit{p}(\textit{u})\) on \(\partial {\textbf {P}}\). The segment \(\textit{l}(\textit{u})\) must intersect at least one reflex vertex of \(\partial {\textbf {P}}\) between \(\textit{u}\) and \(\textit{p}(\textit{u})\) that hides \(\textit{p}(\textit{u})\) from \(\textit{T}_1\!\setminus \!\textit{u}\). Let \(\textit{v}(\textit{u})\) be the reflex vertex of \(\partial {\textbf {P}}\) on \(\textit{l}(\textit{u})\) closest to \(\textit{p}(\textit{u})\). The line segment \([\textit{p}(\textit{u}),\textit{v}(\textit{u})]\) partitions P into two subpolygons \({\textbf {P}}_{\!1}\) containing \(\textit{T}_1\) and \({\textbf {P}}_{\!0}\). Let \(\textit{b}(\textit{u})\) be the polygon boundary edge adjacent to the reflex vertex \(\textit{v}(\textit{u})\) in \({\textbf {P}}_{\!0}\) and let \(\textit{e}(\textit{u})\) be the extension collinear to \(\textit{b}(\textit{u})\) inside \({\textbf {P}}_{\!1}\). We associate a direction to \(\textit{l}(\textit{u})\) so that \(\textit{e}(\textit{u})\) lies locally to the left of \(\textit{l}(\textit{u})\). Henceforth, we denote \({\textbf {P}}_{\!0}\) by \({\textbf {P}}_{\!\!\textit{e}(\textit{u})}\) and \({\textbf {P}}_{\!1}\) by \({\textbf {P}}_{\!\textit{l}(\textit{u})}\) to let them depend on the vertex \(\textit{u}\) of \(\textit{T}_1\). We refer to Fig. 5a for an illustration of the given definitions and prove the following lemma.

Fig. 5
figure 5

a Illustrates the coloring definitions of the points on the boundary of P. b Illustrates the proof of Lemma 3.4, if \(\textit{p}\) is white for \(\textit{T}_2\), then \(\textit{T}_1\) can be shortened

Lemma 3.4

For \(\Vert \hspace{-0.08em}\textit{T}_1\hspace{-0.08em}\Vert >0\), any boundary point that is dark grey for \(\textit{T}_1\) must also be grey for \(\textit{T}_2\), and for \(\Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert >0\), any boundary point that is dark grey for \(\textit{T}_2\) must also be grey for \(\textit{T}_1\).

Proof

We show the lemma for a boundary point \(\textit{p}\) that is dark grey for \(\textit{T}_1\). The reverse claim follows by symmetry. We have two cases.

  • If \(\textit{p}\) is white for \(\textit{T}_2\), we have an immediate contradiction since the single convex vertex \(\textit{u}\) of \(\textit{T}_1\) that sees \(\textit{p}\) can be cut away from \(\textit{T}_1\) arbitrarily close to \(\textit{u}\), thus shortening the length of \(\textit{T}_1\); see Fig. 6b.

  • If \(\textit{p}\) is black for \(\textit{T}_2\), this means that there is open interval on the boundary \(\partial {\textbf {P}}\) centered at \(\textit{p}\) that is not seen by any point of \(\textit{T}_2\). Since \(\textit{p}\) is one end point of a maximal subpath that is seen by \(\textit{T}_1\), there exist boundary points not seen by either \(\textit{T}_1\) or \(\textit{T}_2\), a contradiction.

This concludes the proof. \(\square \)

We can now show the following claim.

Lemma 3.5

There exists a minmax two-watchman route \(\mathcal {T}=(\textit{T}_1,\textit{T}_2)\), such that each tour \(\textit{T}_i\) intersects some extension in \(\mathcal {E}_i\)\(i\in \{1,2\}\).

Proof

We will use the assumption that both tours \(\textit{T}_1\) and \(\textit{T}_2\) are as short as possible. At least one of them will have the length \(\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}\) and the other the shortest possible length given that the first tour achieves the length \(\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}\). We will show the result only for tour \(\textit{T}_1\), but the same argument holds also for \(\textit{T}_2\). The proof is by case analysis, first subdividing into the cases when \(\Vert \hspace{-0.08em}\textit{T}_1\hspace{-0.08em}\Vert =0\) and thus the region \({\textbf {P}}\setminus \!{{\textbf {VP}}(\textit{T}_2)}\) is starshaped, and the case \(\Vert \hspace{-0.08em}\textit{T}_1\hspace{-0.08em}\Vert >0\). In this latter case we make a proof by contradiction assuming that \(\textit{T}_1\) does not intersect any extension in \(\mathcal {E}\). The argument in this case becomes slightly involved but relies on showing that under this assumption, Lemma 3.4 does not hold, giving us a contradiction.

Assume first that \(\Vert \hspace{-0.08em}\textit{T}_1\hspace{-0.08em}\Vert =0\), i.e., \(\textit{T}_1\) is a point sized tour. This implies that \({\textbf {P}}\setminus \!{{\textbf {VP}}(\textit{T}_2)}\) is starshaped even though it may be a disconnected set. The set of points in P that see all of \({\textbf {P}}\!\setminus \!{{\textbf {VP}}(\textit{T}_2)}\), also known as the kernel, is the intersection of the left halfplanes collinear to the boundary edges from \(\partial {\textbf {P}}\cap ({\textbf {P}}\!\setminus \!{{\textbf {VP}}(\textit{T}_2)})\) [20]. Left means here locally to the left of the associated edge in the order of the counterclockwise traversal. The kernel boundary cannot be made up only of boundary edges of P, since that would make P a convex polygon and thus guardable with one point guard contradicting Assumption 3.1. Hence, there is a kernel boundary edge collinear with some extension of P and we can let \(\textit{T}_1\) be a point on this kernel boundary edge.

Now, assume that \(\Vert \hspace{-0.08em}\textit{T}_1\hspace{-0.08em}\Vert >0\). We make a proof by contradiction and assume further that \(\textit{T}_1\) does not intersect any extension in \(\mathcal {E}\). If this is the case, \(\textit{T}_1\) cannot have any reflex vertices, since if \(\textit{T}_1\) does, then any such vertex coincides with a reflex vertex of P and thus \(\textit{T}_1\) intersects the two extensions adjacent to this vertex. Hence, \(\textit{T}_1\) has only convex vertices. If \(\textit{T}_1\) is a line segment, we consider the two end points of the segment to be the convex vertices of the tour that goes back and forth between them.

The rest of the proof now shows that, if \(\textit{T}_1\) does not intersect some extension, then there exists a dark grey boundary point for \(\textit{T}_1\) that is either black or white for \(\textit{T}_2\), contradicting Lemma 3.4. We prove this by a case analysis. The case analysis first considers the two cases when \(\textit{T}_1\) has two convex vertices \(\textit{u}\) and \(\textit{u}\)’, such that \({\textbf {L}}\big (\textit{l}(\textit{u})\big )\cap {\textbf {L}}\big (\textit{e}(\textit{u}')\big )=\emptyset \), i.e., \(\textit{T}_1\) lies in a region of P bounded by two extensions on either side of \(\textit{T}_1\) and the case when it does not. This second case is then subdivided into two further cases, when the left hand sides of all the segments \(\textit{l}\)(\(\textit{u}\)) of convex vertices \(\textit{u}\) of \(\textit{T}_1\), all have non-empty intersection and when they have empty intersection. In the first of these cases, \(\textit{T}_1\) can be slid in one direction shortening it and in the second of these cases, there must exist exist a convex vertex \(\textit{u}\) of \(\textit{T}_1\) and three extensions that \(\textit{T}_2\) covers ensuring that \(\textit{p}(\textit{u})\) is white for \(\textit{T}_2\), contradicting Lemma 3.4. We proceed with the formal details.

  • If \(\textit{T}_1\) has two convex vertices \(\textit{u}\) and \(\textit{u}\)’, such that \({\textbf {L}}\big (\textit{l}(\textit{u})\big )\cap {\textbf {L}}\big (\textit{e}(\textit{u}')\big )=\emptyset \), then the intersection \({\textbf {L}}\big (\textit{e}(\textit{u})\big )\cap {\textbf {L}}\big (\textit{e}(\textit{u}')\big )\) is also empty, since \(\Big ({\textbf {L}}\big (\textit{e}(\textit{u})\big )\!\setminus \!{\textbf {P}}_{\!\!\textit{e}(\textit{u})}\Big )\subset {\textbf {L}}\big (\textit{l}(\textit{u})\big )\). This means that \(\textit{T}_1\) lies properly in the region \({\textbf {P}}\setminus \Big ({\textbf {L}}\big (\textit{e}(\textit{u})\big )\cup {\textbf {L}}\big (\textit{e}(\textit{u}')\big )\Big )\) without touching \(\textit{e}\)(\(\textit{u}\)) or \(\textit{e}\)(\(\textit{u}\)’) whereby \(\textit{T}_2\) must intersect the two disjoint regions \({\textbf {L}}\big (\textit{e}(\textit{u})\big )\) and \({\textbf {L}}\big (\textit{e}(\textit{u}')\big )\). Since \({\textbf {L}}\big (\textit{l}(\textit{u})\big )\cap {\textbf {L}}\big (\textit{e}(\textit{u}')\big )=\emptyset \), \(\textit{T}_2\) must cross \(\textit{l}(\textit{u})\) and hence \(\textit{p}(\textit{u})\) is white for \(\textit{T}_2\) giving us a contradiction to Lemma 3.4; see Fig. 5a illustrating this case.

  • If all pairs of vertices \(\textit{u}\) and \(\textit{u}\)’ of \(\textit{T}_1\) (with multiplicity) have the property that \({\textbf {L}}\big (\textit{l}(\textit{u})\big )\cap {\textbf {L}}\big (\textit{e}(\textit{u}')\big )\ne \emptyset \), then since \(\Big ({\textbf {L}}\big (\textit{e}(\textit{u}')\big )\setminus {\textbf {P}}_{\!\!\textit{e}(\textit{u}')}\Big )\subset {\textbf {L}}\big (\textit{l}(\textit{u}')\big )\) it also holds that \({\textbf {L}}\big (\textit{l}(\textit{u})\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}')\big )\ne \emptyset \) and we have further subcases.

    • If \(\bigcap _{\textit{u}\in \mathcal {U}}{\textbf {L}}\big (\textit{l}(\textit{u})\big )\ne \emptyset \), where \(\mathcal {U}\) is the set of vertices of \(\textit{T}_1\) (with multiplicity), then let \(\textit{q}\) be a point in \(\bigcap _{\textit{u}\in \mathcal {U}}{\textbf {L}}\big (\textit{l}(\textit{u})\big )\) and let \(\textit{u}_1\) and \(\textit{u}_2\) be two distinct vertices of \(\textit{T}_1\) such that \(\textit{T}_1\) is completely contained in the cone \(\angle \textit{u}_1,\textit{q},\textit{u}_2\). We note that \(\textit{T}_1\) is the shortest tour that visits the regions \({\textbf {L}}\big (\textit{l}(\textit{u})\big )\), for \(\textit{u}\in \mathcal {U}\). Let \(\bigtriangleup \textit{u}_1,\textit{q},\textit{u}_2\) denote the triangle with corners at \(\textit{u}_1\), \(\textit{q}\), and \(\textit{u}_2\). The interior region of \(\angle \textit{u}_1,\textit{q},\textit{u}_2\setminus \!\bigtriangleup \textit{u}_1,\textit{q},\textit{u}_2\) cannot contain convex vertices of \(\textit{T}_1\), since any such vertex \(\textit{u}\)’ would have \(\textit{q}\not \in {\textbf {L}}\big (\textit{l}(\textit{u}')\big )\) contradicting that \(\bigcap _{\textit{u}\in \mathcal {U}}{\textbf {L}}\big (\textit{l}(\textit{u})\big )\ne \emptyset \); see Fig. 6a. \(\textit{T}_1\) thus connects \(\textit{u}_1\) and \(\textit{u}_2\) by a line segment. Vertex \(\textit{u}_1\) (with multiplicity) intersects \(\bigcap _{\textit{u}\in \mathcal {U}_{\textit{u}_1}}\!\!{\textbf {L}}\big (\textit{l}(\textit{u})\big )\) for some subset \(\mathcal {U}_{\textit{u}_1}\) of \(\mathcal {U}\). Similarly, the vertex \(\textit{u}_2\) (with multiplicity) intersects \(\bigcap _{\textit{u}\in \mathcal {U}_{\textit{u}_2}}\!\!{\textbf {L}}\big (\textit{l}(\textit{u})\big )\) for some subset \(\mathcal {U}_{\textit{u}_2}\) of \(\mathcal {U}\), with \(\mathcal {U}_{\textit{u}_1}\!\cap \mathcal {U}_{\textit{u}_2}=\emptyset \). Since the intersection of locally convex regions is also locally convex, any point on the line segment \([\textit{u}_1,\textit{q}]\) intersects \(\bigcap _{\textit{u}\in \mathcal {U}_{\textit{u}_1}}\!{\textbf {L}}(\textit{l}(\textit{u}))\) and similarly, any point on the line segment \([\textit{u}_2,\textit{q}]\) intersects \(\bigcap _{\textit{u}\in \mathcal {U}_{\textit{u}_2}}\!\!{\textbf {L}}\big (\textit{l}(\textit{u})\big )\). Thus we can move \(\textit{u}_1\) and \(\textit{u}_2\) (with multiplicity) along their corresponding line segments towards \(\textit{q}\), thus shortening \(\textit{T}_1\), giving us a contradiction; see Fig. 6a.

    • If \(\bigcap _{\textit{u}\in \mathcal {U}}{\textbf {L}}\big (\textit{l}(\textit{u})\big )=\emptyset \) and for all pairs \(\textit{u}\) and \(\textit{u}\)’, \({\textbf {L}}\big (\textit{l}(\textit{u})\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}')\big )\ne \emptyset \), then \(\textit{T}_1\) must have at least three vertices. We first show that there exists a subset of three vertices \(\textit{u}_1\), \(\textit{u}_2\), and \(\textit{u}_3\) such that \({\textbf {L}}\big (\textit{l}(\textit{u}_1)\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}_2)\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}_3)\big )=\emptyset \). Since \(\textit{T}_1\cap {\textbf {L}}\big (\textit{l}(\textit{u})\big )=\textit{u}\), for every vertex \(\textit{u}\) of \(\textit{T}_1\), not only do \({\textbf {L}}\big (\textit{l}(\textit{u})\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}')\big )\ne \emptyset \) but the segments \(\textit{l}(\textit{u})\) and \(\textit{l}(\textit{u}')\) intersect in a point, for every vertex pair \(\textit{u}\) and \(\textit{u}\)’. Pick \(\textit{u}_1\) to be any vertex of \(\textit{T}_1\) and assume without loss of generality that \(\textit{l}(\textit{u}_1)\) is horizontal and directed towards the right; see Fig. 6b. Initialize the set \(\mathcal {L}\) to be \(\mathcal {L}:=\{\textit{u}_1\}\) and sort the remaining vertices \(\textit{u}\) on the angle the corresponding cut \(\textit{l}(\textit{u})\) makes with \(\textit{l}(\textit{u}_1)\), from 0 to \(2\pi \). Now, add vertices \(\textit{u}\) (with multiplicity), one by one, according to the sorted order to \(\mathcal {L}\), for \(\textit{u}\in \mathcal {U}\) until \(\bigcap _{\textit{u}\in \mathcal {L}}{\textbf {L}}\big (\textit{l}(\textit{u})\big )=\emptyset \). Let \(\textit{u}_2\) denote the last vertex added to \(\mathcal {L}\) during the process above, and let \(\textit{u}_3\) be a vertex in \(\mathcal {L}\) such that the intersection \(\textit{q}_1=\textit{l}(\textit{u}_3)\cap \textit{l}(\textit{u}_1)\) lies after \(\textit{q}_2=\textit{l}(\textit{u}_3)\cap \textit{l}(\textit{u}_2)\) on the directed cut \(\textit{l}\)(\(\textit{u}_3\)). To see that \({\textbf {L}}\big (\textit{l}(\textit{u}_1)\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}_2)\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}_3)\big )=\emptyset \), any point in the intersection \({\textbf {L}}\big (\textit{l}(\textit{u}_1)\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}_3)\big )\) lies above (or on) \(\textit{l}\)(\(\textit{u}_1\)) and any point in the intersection \({\textbf {L}}\big (\textit{l}(\textit{u}_2)\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}_3)\big )\) lies below \(\textit{l}\)(\(\textit{u}_1\)), since \(\textit{q}_2\) lies below \(\textit{l}\)(\(\textit{u}_1\)); see Fig. 6b. This also shows that \(\textit{u}_3\) must exist, since if, for all vertices \(\textit{u}\in \mathcal {L}\!\setminus \!\{\textit{u}_1,\textit{u}_2\}\), the point \(\textit{l}(\textit{u})\cap \textit{l}(\textit{u}_1)\) lies before \(\textit{l}(\textit{u})\cap \textit{l}(\textit{u}_2)\) on \(\textit{l}(\textit{u})\), the first such intersection point on \(\textit{l}(\textit{u}_2)\) along \(\textit{l}(\textit{u}_2)\) lies to the left (or on) each cut \(\textit{l}(\textit{u})\), for \(\textit{u}\in \mathcal {L}\), contradicting that \(\bigcap _{\textit{u}\in \mathcal {L}}{\textbf {L}}\big (\textit{l}(\textit{u})\big )=\emptyset \); see Fig. 6b. Since \({\textbf {L}}\big (\textit{l}(\textit{u}_1)\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}_2)\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}_3)\big )=\emptyset \), it also follows that \({\textbf {L}}\big (\textit{e}(\textit{u}_1)\big )\cap {\textbf {L}}\big (\textit{e}(\textit{u}_2)\big )\cap {\textbf {L}}\big (\textit{e}(\textit{u}_3)\big )=\emptyset \), as \(\Big ({\textbf {L}}\big (\textit{e}(\textit{u})\big )\!\setminus \!{\textbf {P}}_{\!\!\textit{e}(\textit{u})}\Big )\subset {\textbf {L}}\big (\textit{l}(\textit{u})\big )\), for every vertex \(\textit{u}\) of \(\textit{T}_1\). The tour \(\textit{T}_1\) has no points in any of the regions \({\textbf {L}}\big (\textit{e}(\textit{u}_1)\big )\), \({\textbf {L}}\big (\textit{e}(\textit{u}_2)\big )\), or \({\textbf {L}}\big (\textit{e}(\textit{u}_3)\big )\), so \(\textit{T}_2\) must intersect each of them. Assume that \(\textit{T}_2\) does not intersect \(\textit{l}(\textit{u}_2)\) or \(\textit{l}(\textit{u}_3)\), otherwise at least one of \(\textit{p}(\textit{u}_2)\) or \(\textit{p}(\textit{u}_3)\) is white for \(\textit{T}_2\), contradicting Lemma 3.4. However, then \(\textit{T}_2\) must have interior points in \({\textbf {L}}\big (\textit{l}(\textit{u}_2)\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}_3)\big )\) since \(\textit{T}_2\) intersects \({\textbf {L}}\big (\textit{e}(\textit{u}_2)\big )\) and \({\textbf {L}}\big (\textit{e}(\textit{u}_3)\big )\) but does not intersect \(\textit{l}(\textit{u}_2)\) or \(\textit{l}(\textit{u}_3)\). Hence, \(\textit{T}_2\) has points below \(\textit{l}(\textit{u}_1)\) and since \({\textbf {L}}\big (\textit{e}(\textit{u}_1)\big )\) lies above (or on) \(\textit{l}(\textit{u}_1)\), \(\textit{T}_2\) must intersect \(\textit{l}(\textit{u}_1)\) and thus \(\textit{p}(\textit{u}_1)\) is white for \(\textit{T}_2\), again contradicting Lemma 3.4; see Fig. 6b.

This concludes the proof. \(\square \)

Fig. 6
figure 6

Illustrating the proof of Lemma 3.5. a Illustrates the case when \(\bigcap _{\textit{u}\in \mathcal {U}}{\textbf {L}}\big (\textit{l}(\textit{u})\big )\ne \emptyset \) where \(\mathcal {U}\) is the set of vertices of \(\textit{T}_1\). b Illustrates the case when \(\bigcap _{\textit{u}\in \mathcal {U}}{\textbf {L}}\big (\textit{l}(\textit{u})\big )=\emptyset \), showing how to select \(\textit{u}_1\), \(\textit{u}_2\), and \(\textit{u}_3\), so that \({\textbf {L}}\big (\textit{l}(\textit{u}_1)\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}_2)\big )\cap {\textbf {L}}\big (\textit{l}(\textit{u}_3)\big )=\emptyset \)

4 Tentacles and Jellyfish

We will use the following definitions extensively in the sequel.

Definition 4.1

For a point \(\textit{q}\) in P and a point \(\textit{r}\) on the boundary \(\partial {\textbf {P}}\), we call the shortest path from \(\textit{q}\) to some point in P that sees \(\textit{r}\), a tentacle from \(\textit{q}\) to \(\textit{r}\), denoted \(\textit{Z}_{\textit{q}}^{\textit{r}}\). We say that \(\textit{q}\) is the head of the tentacle and that a tentacle is attached to its head. The other end point of the tentacle is called the tip.

The idea of tentacles is not new, as similar geometric objects have, for example, previously been defined to compute the quickest visibility path, the visibility center, and the geodesic center in simple polygons [2, 22, 27].

With a tentacle \(\textit{Z}_{\textit{q}}^{\textit{r}}\) (where \(\textit{q}\) does not see \(\textit{r}\)) we also associate a tentacle cut \(\textit{c}(\textit{Z}_{\textit{q}}^{\textit{r}})\). Consider the maximal line segment l in P passing through the tip \(\textit{p}\) of \(\textit{Z}_{\textit{q}}^{\textit{r}}\) and the boundary point \(\textit{r}\). If the segment l has end points \(\textit{r}\) and \(\textit{r}\)’ and (possibly) subdivides into connected pieces \(l_1,l_2,\ldots \) intersecting the boundary only at the end points and where \(l_i\) partitions P into two subpolygons, one containing \(\textit{q}\) and one containing \(\textit{r}\). The cut \(\textit{c}(\textit{Z}_{\textit{q}}^{\textit{r}})\) is the segment \(l_i\) directed so that \(\textit{q}\in {\textbf {P}}\setminus {\textbf {L}}\big (\textit{c}(\textit{Z}_{\textit{q}}^{\textit{r}})\big )\); see Fig. 7a. The first boundary vertex \(\textit{u}\) encountered as you move from \(\textit{r}\) along l towards \(\textit{p}\) is the hiding vertex of the tentacle \(\textit{Z}_{\textit{q}}^{\textit{r}}\).

We can prove the following technical lemma.

Lemma 4.1

If \(\textit{q}\) is a point in P and \(\textit{s}_{\textit{b}}\) is a subsegment of a boundary edge \(\textit{b}\) of \(\partial {\textbf {P}}\) having end points \(\textit{r}_1\) and \(\textit{r}_2\), then the two tentacles \(\textit{Z}_{\textit{q}}^{\textit{r}_1}\) and \(\textit{Z}_{\textit{q}}^{\textit{r}_2}\) together see the whole subsegment \(\textit{s}_{\textit{b}}\).

Proof

The proof is a simple modification of the proof of Lemma 3.2. Let \(\textit{p}_1\) and \(\textit{p}_2\) be the two tips of \(\textit{Z}_{\textit{q}}^{\textit{r}_1}\) and \(\textit{Z}_{\textit{q}}^{\textit{r}_2}\), respectively. Let \(\textit{r}\) be some arbitrary point in \(\textit{s}_{\textit{b}}\). If the segments \([\textit{p}_1,\textit{r}_1]\) and \([\textit{p}_2,\textit{r}_2]\) do not intersect, we construct a closed simple polygon \({\textbf {R}}\) in P as follows: follow \(\textit{s}_{\textit{b}}\) from \(\textit{r}_1\) to \(\textit{r}_2\), from \(\textit{r}_2\) to \(\textit{p}_2\), from \(\textit{p}_2\) to \(\textit{q}\) along the tentacle \(\textit{Z}_{\textit{q}}^{\textit{r}_2}\), from \(\textit{q}\) to \(\textit{p}_1\) along \(\textit{Z}_{\textit{q}}^{\textit{r}_1}\), and finally from \(\textit{p}_1\) to \(\textit{r}_1\). The only edges of the constructed polygon \({\textbf {R}}\) that are not part of the two tentacles are the three edges adjacent to \(\textit{r}_1\) and \(\textit{r}_2\) so \({\textbf {R}}\) is completely seen by the two tentacles. Hence, the point \(\textit{r}\) is also seen since it lies on \(\textit{s}_{\textit{b}}\) between \(\textit{r}_1\) and \(\textit{r}_2\).

On the other hand if the segments \([\textit{p}_1,\textit{r}_1]\) and \([\textit{p}_2,\textit{r}_2]\) intersect, let \(\textit{p}\) be an intersection point between \([\textit{p}_1,\textit{r}_1]\) and \([\textit{p}_2,\textit{r}_2]\). The three points \(\textit{r}_1\), \(\textit{r}_2\), and \(\textit{p}\) form a triangle interior to P and we construct a closed simple polygon \({\textbf {R}}'\) in P having \(\textit{p}\) as a vertex as follows: follow the tentacles from \(\textit{r}_1\) to \(\textit{r}_2\) via \(\textit{q}\), a straight edge from \(\textit{r}_2\) to \(\textit{p}\), and a straight edge from \(\textit{p}\) to \(\textit{r}_1\). If we extend the segment \([\textit{r},\textit{p}]\) inside \({\textbf {R}}'\), it must intersect a tentacle, since \(\textit{r}_1\) connects to \(\textit{r}_2\) in \({\textbf {R}}'\) using the tentacles. Hence, the point \(\textit{r}\) is also seen from the tentacles. \(\square \)

Let s be a line segment in P and let \(\textit{b}=[\textit{v},\textit{v}']\) be some boundary edge of \(\partial {\textbf {P}}\). The next lemma establishes that if we move the head of the tentacle \(\textit{Z}_{\textit{q}}^{\textit{r}}\), from \(\textit{q}\in s\), a small distance to the point \(\textit{q}'\in s\) and the point \(\textit{r}\in ]\textit{v},\textit{v}'[\) to the point \(\textit{r}'\in ]\textit{v},\textit{v}'[\) also a small distance, the difference in length between the two tentacles \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}}^{\textit{r}}\hspace{-0.08em}\Vert -\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}'}^{\textit{r}'}\hspace{-0.08em}\Vert \) is a smooth function.

Fig. 7
figure 7

a Illustrating the tentacle \(\textit{Z}_{\textit{q}}^{\textit{r}}\), its hiding vertex \(\textit{u}\), and its associated cut. b The difference between tentacle and edge restricted tentacle. Vertex \(\textit{u}\) is the hiding vertex for \(\textit{Z}_{\textit{q}}^{\textit{v}}\) and \(\textit{v}\) is the hiding vertex for \(\textit{Z}_{\textit{q}}^{\textit{v}}\!(\textit{b})\)

Lemma 4.2

Let \(\textit{q}\) move a distance \(\delta \) to \(\textit{q}\)’ on a line segment s and let \(\textit{r}\) move a distance \(\epsilon \) to \(\textit{r}\)’, where both \(\textit{r}\) and \(\textit{r}\)’ lie in the open interval \(]\textit{v},\textit{v}'[\) of a boundary edge \(\textit{b}=[\textit{v},\textit{v}']\), in such a way that the first segment of the tentacles from \(\textit{q}\) and \(\textit{q}\)’ intersect the same reflex vertex, if the tentacle consists of multiple segments, and \(\textit{c}(\textit{Z}_{\textit{q}}^{\textit{r}})\) and \(\textit{c}(\textit{Z}_{\textit{q}'}^{\textit{r}'})\) have the same hiding vertex, then

$$\begin{aligned} \Vert \hspace{-0.08em}\textit{Z}_{\textit{q}'}^{\textit{r}'}\hspace{-0.08em}\Vert = \Vert \hspace{-0.08em}\textit{Z}_{\textit{q}}^{\textit{r}}\hspace{-0.08em}\Vert + {{\mathcal {F}}}(\delta ,\epsilon ), \end{aligned}$$

where \({{\mathcal {F}}}(\delta ,\epsilon )\) is continuous and differentiable.

The proof of the lemma is a lengthy case analysis where all arguments are based on similarity and the cosine theorem and is therefore deferred to “Appendix A”.

To alleviate the fact that Lemma 4.2 only holds for points \(\textit{r}\) in the interior of boundary edges we define the edge restricted tentacle \(\textit{Z}_{\textit{q}}^{\textit{r}}\!(\textit{b})\) to be

$$\begin{aligned} \textit{Z}_{\textit{q}}^{\textit{r}}\!(\textit{b}) = \!\!\!\!\lim _{]\textit{v},\textit{v}'[\ni \textit{p}\rightarrow \textit{r}} \!\textit{Z}_{\textit{q}}^{\textit{p}}\!, \hbox {\ where}\, \textit{b}=[\textit{v},\textit{v}']. \end{aligned}$$
(4)

An edge restricted tentacle \(\textit{Z}_{\textit{q}}^{\textit{r}}\!(\textit{b})\) can differ from \(\textit{Z}_{\textit{q}}^{\textit{r}}\) only when \(\textit{r}\) is a vertex of \(\textit{b}\). If \(\textit{v}\) is a reflex vertex and \(\textit{q}\) lies to the right of extension \(\textit{e}\) collinear to boundary edge \(\textit{b}\), then \(\textit{Z}_{\textit{q}}^{\textit{v}}\!(\textit{b})\) is the shortest path from \(\textit{q}\) that sees \(\textit{b}\), not just \(\textit{v}\); see Fig. 7b. In all other cases, \(\textit{Z}_{\textit{q}}^{\textit{r}}\!(\textit{b})=\textit{Z}_{\textit{q}}^{\textit{r}}\). The proof of Lemma 4.1 does not make use of the edge restriction of a tentacle \(\textit{Z}_{\textit{q}}^{\textit{r}}\!(\textit{b})\) so it still holds for edge restricted tentacles. We can generalize Lemma 4.2 to also hold for vertices using edge restricted tentacles. We claim this as a corollary.

Corollary 4.3

Let \(\textit{q}\) move a distance \(\delta \) to \(\textit{q}\)’ on a line segment s and let \(\textit{r}\) move a distance \(\epsilon \) to \(\textit{r}\)’ along a boundary edge \(\textit{b}=[\textit{v},\textit{v}']\), in such a way that the first segment of the tentacles from \(\textit{q}\) and \(\textit{q}\)’ intersect the same reflex vertex, if the tentacle consists of multiple segments, and \(\textit{c}\big (\textit{Z}_{\textit{q}}^{\textit{r}}\!(\textit{b})\big )\) and \(\textit{c}\big (\textit{Z}_{\textit{q}'}^{\textit{r}'}\!(\textit{b})\big )\) have the same hiding vertex, then

$$\begin{aligned} \Vert \hspace{-0.08em}\textit{Z}_{\textit{q}'}^{\textit{r}'}\!(\textit{b})\hspace{-0.08em}\Vert = \Vert \hspace{-0.08em}\textit{Z}_{\textit{q}}^{\textit{r}}\!(\textit{b})\hspace{-0.08em}\Vert + \mathcal{F}(\delta ,\epsilon ), \end{aligned}$$

where \({{\mathcal {F}}}(\delta ,\epsilon )\) is continuous and differentiable.

We will henceforth only work with edge restricted tentacles and just call them tentacles.

Given two points \(\textit{q}\) and \(\textit{q}\)’ in P, consider the tentacles \(\textit{Z}_{\textit{q}}^{\textit{v}}\!(\textit{b})\) and \(\textit{Z}_{\textit{q}'}^{\textit{v}}\!(\textit{b})\), for each boundary edge \(\textit{b}\) and each vertex \(\textit{v}\) of \(\textit{b}\). We define two sets \(\mathcal {J}_{\textit{q}}\) and \(\mathcal {J}_{\textit{q}'}\) of tentacles such that \(\textit{Z}_{\textit{q}}^{\textit{v}}\!(\textit{b})\in \mathcal {J}_{\textit{q}}\) iff \(\Vert \textit{Z}_{\textit{q}}^{\textit{v}}\!(\textit{b})\Vert \le \Vert \textit{Z}_{\textit{q}'}^{\textit{v}}\!(\textit{b})\Vert \) and \(\textit{Z}_{\textit{q}'}^{\textit{v}}\!(\textit{b})\in \mathcal {J}_{\textit{q}'}\) iff \(\Vert \textit{Z}_{\textit{q}}^{\textit{v}}\!(\textit{b})\Vert >\Vert \textit{Z}_{\textit{q}'}^{\textit{v}}\!(\textit{b})\Vert \). In this way, each end point \(\textit{v}\) of each boundary edge \(\textit{b}\) has exactly one tentacle in one of \(\mathcal {J}_{\textit{q}}\) or \(\mathcal {J}_{\textit{q}'}\).

From Lemma 4.1 it is clear that if both end points of a boundary edge \(\textit{b}=[\textit{v},\textit{v}']\) have tentacles in the same set, either \(\mathcal {J}_{\textit{q}}\) or \(\mathcal {J}_{\textit{q}'}\), then the tentacles in the set sees the whole edge \(\textit{b}\). However, assume that \(\textit{Z}_{\textit{q}}^{\textit{v}}\!(\textit{b})\in \mathcal {J}_{\textit{q}}\) and \(\textit{Z}_{\textit{q}'}^{\textit{v}'}\!(\textit{b})\in \mathcal {J}_{\textit{q}'}\), then \(\Vert \textit{Z}_{\textit{q}}^{\textit{v}}\!(\textit{b})\Vert \le \Vert \textit{Z}_{\textit{q}'}^{\textit{v}}\!(\textit{b})\Vert \) and \(\Vert \textit{Z}_{\textit{q}}^{\textit{v}'}\!(\textit{b})\Vert >\Vert \textit{Z}_{\textit{q}'}^{\textit{v}'}\!(\textit{b})\Vert \). Since the length of a tentacle \(\textit{Z}_{\textit{q}}^{\textit{r}}\!(\textit{b})\) changes smoothly as \(\textit{r}\) moves along \(\textit{b}\) from \(\textit{v}\) to \(\textit{v}\)’; see Corollary 4.3, there is some point \(\textit{r}^{*}\) on \(\textit{b}\) such that \(\Vert \textit{Z}_{\textit{q}}^{\textit{r}^{*}}\!(\textit{b})\Vert =\Vert \textit{Z}_{\textit{q}'}^{\textit{r}^{*}}\!(\textit{b})\Vert \). If we include \(\textit{Z}_{\textit{q}}^{\textit{r}^{*}}\!(\textit{b})\) into \(\mathcal {J}_{\textit{q}}\) and \(\textit{Z}_{\textit{q}'}^{\textit{r}^{*}}\!(\textit{b})\) into \(\mathcal {J}_{\textit{q}'}\), this guarantees that the tentacles in \(\mathcal {J}_{\textit{q}}\) and \(\mathcal {J}_{\textit{q}'}\) together see \(\textit{b}\).

Thus, if each edge \(\textit{b}\) either has the two tentacles of its end points in one set or there is a point \(\textit{r}^{*}\) on \(\textit{b}\) such that \(\textit{Z}_{\textit{q}}^{\textit{r}^{*}}\!(\textit{b})\in \mathcal {J}_{\textit{q}}\) and \(\textit{Z}_{\textit{q}'}^{\textit{r}^{*}}\!(\textit{b})\in \mathcal {J}_{\textit{q}'}\), then the whole boundary is seen by the tentacles in the set. By considering the tour constructed by following each tentacle from the head to the tip and back in some order for each set \(\mathcal {J}_{\textit{q}}\) and \(\mathcal {J}_{\textit{q}'}\), by Lemma 3.1, the polygon P is guarded by the tentacles in the two sets. We call each of the two sets \(\mathcal {J}_{\textit{q}}\) and \(\mathcal {J}_{\textit{q}'}\) a jellyfish with head \(\textit{q}\) and \(\textit{q}\)’, respectively, and \(\mathcal {J}_{\textit{q},\textit{q}'}=\mathcal {J}_{\textit{q}}\cup \mathcal {J}_{\textit{q}'}\) the jellyfish pair with heads \(\textit{q}\) and \(\textit{q}\)’. We define \(\Vert \hspace{-0.08em}\mathcal {J}_{\textit{q},\textit{q}'}\hspace{-0.08em}\Vert \), the length of a jellyfish pair, to be the length of its longest tentacle; see Fig. 8a, b.

Fig. 8
figure 8

a A pair of tentacles \(\textit{Z}_{\textit{q}}^{\textit{r}}\!(\textit{b})\) and \(\textit{Z}_{\textit{q}'}^{\textit{r}}\!(\textit{b})\) in blue, b a jellyfish pair \(\mathcal {J}_{\textit{q},\textit{q}'}\) in blue with jellyfish \(\mathcal {J}_{\textit{q}}\) and \(\mathcal {J}_{\textit{q}'}\), c a minimum jellyfish pair \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) with minimum jellyfish \(\mathcal {J}^{\min }_{\textit{e}_1}\) and \(\mathcal {J}^{\min }_{\textit{e}_2}\) in blue (Color figure online)

Let \(\textit{e}_1\) and \(\textit{e}_2\) be two extensions intersected by \(\textit{T}_1\) and \(\textit{T}_2\) respectively. These extensions exist by Lemma 3.5 and we have the following lemma.

Lemma 4.4

If \(\textit{u}_1\) and \(\textit{u}_2\) are intersection points of \(\textit{T}_1\) and \(\textit{T}_2\) with extensions \(\textit{e}_1\) and \(\textit{e}_2\) respectively, then \(\Vert \hspace{-0.08em}\mathcal {J}_{\textit{u}_1,\textit{u}_2,}\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}/2\).

Proof

Without loss of generality, assume that a longest tentacle in \(\mathcal {J}_{\textit{u}_1,\textit{u}_2,}\) is \(\textit{Z}_{\textit{u}_1}^{\textit{r}}\!(\textit{b})\), for some point \(\textit{r}\) on boundary edge \(\textit{b}\). We distinguish five cases.

  1. 1.

    If \(\textit{r}\) is an interior point of \(\textit{b}\) seen by \(\textit{T}_1\), then follow a path from \(\textit{u}_1\) along \(\textit{T}_1\) until we reach the first point \(\textit{u}_1\)’ on \(\textit{T}_1\) that sees \(\textit{r}\). Denote the subpath of \(\textit{T}_1\) thus constructed \(\textit{T}_1[\textit{u}_1,\textit{u}_1']\) and let the other subpath \((\textit{T}_1\!\setminus \!\textit{T}_1[\textit{u}_1,\textit{u}_1'])\cup \{\textit{u}_1,\textit{u}_1'\}\) (the closure of the path) be denoted \(\textit{T}_1[\textit{u}_1',\textit{u}_1]\). The path \(\textit{T}_1[\textit{u}_1',\textit{u}_1]\) also sees \(\textit{r}\) since \(\textit{u}_1\)’ sees \(\textit{r}\). The tentacle \(\textit{Z}_{\textit{u}_1}^{\textit{r}}\!(\textit{b})\) is at most as long as the shorter of the subpaths \(\textit{T}_1[\textit{u}_1,\textit{u}_1']\) and \(\textit{T}_1[\textit{u}_1',\textit{u}_1]\), whereby \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{u}_1}^{\textit{r}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{T}_1\hspace{-0.08em}\Vert /2\) in this case.

  2. 2.

    If \(\textit{r}\) is an interior point of of \(\textit{b}\) but is not seen by \(\textit{T}_1\), then it is seen by \(\textit{T}_2\), and since \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{u}_1}^{\textit{r}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{Z}_{\textit{u}_2}^{\textit{r}}\!(\textit{b})\hspace{-0.08em}\Vert \) and by the argument in Case 1. using \(\textit{u}_2\) and \(\textit{T}_2\) instead of \(\textit{u}_1\) and \(\textit{T}_1\), giving us \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{u}_2}^{\textit{r}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert /2\), we have \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{u}_1}^{\textit{r}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert /2\) in this case.

  3. 3.

    If \(\textit{r}=\textit{v}\) is a vertex of \(\textit{b}\) seen by \(\textit{T}_1\) and \(\textit{T}_1\) also sees other points of \(\textit{b}\), then by Lemma 3.2, \(\textit{T}_1\) sees some connected set of \(\textit{b}\) that includes \(\textit{v}\). Hence \(\lim _{\textit{b}\ni \textit{p}\rightarrow \textit{v}}\Vert \textit{Z}_{\textit{u}_1}^{\textit{p}}\Vert =\Vert \textit{Z}_{\textit{u}_1}^{\textit{v}}\!(\textit{b})\Vert \) by the definition of edge restricted tentacle and using our argument from Case 1 (including the fact that \(\textit{T}_1\) sees all points \(\textit{p}\) on \(\textit{b}\) in a connected neighbourhood of \(\textit{v}\)), we have \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{u}_1}^{\textit{v}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{T}_1\hspace{-0.08em}\Vert /2\) in this case.

  4. 4.

    If \(\textit{r}=\textit{v}\) is a vertex of \(\textit{b}\) seen by \(\textit{T}_1\) but \(\textit{T}_1\) sees no other points of \(\textit{b}\), then \(\textit{T}_2\) must see \(\textit{v}\) and other points of \(\textit{b}\), otherwise there are points on \(\textit{b}\) not seen by any of \(\textit{T}_1\) and \(\textit{T}_2\). Using the same argument as in Case 3 for \(\textit{u}_2\) and \(\textit{T}_2\), we have \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{u}_2}^{\textit{v}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert /2\). Since \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{u}_1}^{\textit{v}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{Z}_{\textit{u}_2}^{\textit{v}}\!(\textit{b})\hspace{-0.08em}\Vert \) we have \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{u}_1}^{\textit{v}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert /2\) in this case.

  5. 5.

    If \(\textit{r}=\textit{v}\) is a vertex of \(\textit{b}\) not seen by \(\textit{T}_1\), then \(\textit{b}\) contains some connected set that includes \(\textit{v}\) and that is not seen by \(\textit{T}_1\). This set must be seen by \(\textit{T}_2\) and we can use the argument in the previous step to establish that \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{u}_1}^{\textit{v}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert /2\) also in this case.

This concludes the proof. \(\square \)

Given two segment s and \(s'\) in P, we define the bases along s and \(s'\) to be a pair of points having the property \(\textit{q}_{*}^{},\textit{q}_{*}^{\prime }=\mathop {\mathrm {arg\,min}}\limits _{\textit{q}\in s,\textit{q}'\in s'}\big \{\Vert \hspace{-0.08em}\mathcal {J}_{\textit{q},\textit{q}'}\hspace{-0.08em}\Vert \big \}\), i.e., two points, \(\textit{q}_{*}^{}\) on s and \(\textit{q}_{*}^{\prime }\) on \(s'\), where \(\Vert \hspace{-0.08em}\mathcal {J}_{\textit{q}_{*}^{},\textit{q}_{*}^{\prime }}\hspace{-0.08em}\Vert \) is minimal. We denote the jellyfish pair \(\mathcal {J}_{\textit{q}_{*}^{},\textit{q}_{*}^{\prime }}\) by \(\mathcal {J}^{\min }_{s,s'}\), the minimum jellyfish pair; see Fig. 8b, c.

From this definition and Lemma 4.4, we have that

$$\begin{aligned} \Vert \hspace{-0.08em}{\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}}\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\mathcal {J}_{\textit{u}_1,\textit{u}_2}\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}/2, \end{aligned}$$
(5)

where again, \(\textit{e}_1\) and \(\textit{e}_2\) are two extensions intersected by \(\textit{T}_1\) and \(\textit{T}_2\), respectively.

Let \(\textit{q}_1\) on \(\textit{e}_1\) and \(\textit{q}_2\) on \(\textit{e}_2\) be the two bases of \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\); see Fig. 8c. We denote by \(\mathcal {J}^{\min }_{\textit{e}_1}\) the subset of tentacles having their heads at \(\textit{q}_1\) and by \(\mathcal {J}^{\min }_{\textit{e}_2}\) the subset of tentacles having their heads at \(\textit{q}_2\). Each set of tentacles \(\mathcal {J}^{\min }_{\textit{e}_1}\) and \(\mathcal {J}^{\min }_{\textit{e}_2}\) is a minimum jellyfish. We call \(\textit{q}_1\) the base of \(\mathcal {J}^{\min }_{\textit{e}_1}\) and \(\textit{q}_2\) the base of \(\mathcal {J}^{\min }_{\textit{e}_2}\). Thus, \({\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}}=\mathcal {J}^{\min }_{\textit{e}_1}\cup \mathcal {J}^{\min }_{\textit{e}_2}\).

The main part of our algorithm, presented in the next section, computes, for every pair of extensions and every pair of boundary edges, the heads of the shortest tentacle pairs that see these edges. The heads are then used as potential bases and the length of the jellyfish pair with these heads as bases is computed. We keep the jellyfish pair with minimum length and its bases through the iteration and from the previous discussion we know that at the end of the iteration the final bases are \(\textit{q}_1\) and \(\textit{q}_2\).

5 The Algorithm

Our algorithm is illustrated in pseudo-code in Fig. 9 and we show that it approximates a minmax two-watchman route by a factor of \(\big (7\pi /6 + 3 - \sqrt{3} + \sqrt{5}\arcsin 1/\sqrt{5}\big )\) and therefore by Inequality (2) also a minsum two-watchman route by a factor twice as large.

The algorithm begins by running Belleville’s algorithm [3, 4] to establish if the polygon is guardable by two point guards. If this is the case, it returns the two point guards computed by the algorithm. Note that if P is two-guardable by point guards, our algorithm must obtain two such point guards to satisfy the approximation guarantee. Otherwise, it computes the set of extensions \(\mathcal {E}\) in \(O(n\log n)\) time using a dynamic ray-shooting data structure [17], and initializes the solution to be a single shortest watchman route \(\textit{W}_{{\tiny \mathsf \!opt}}\)[29, 34] together with some arbitrary point in P.

The rest of this section is devoted to showing how to implement Step 5 of the algorithm. It consists of an iteration over all pairs of extensions. For each pair, we assume that each tour in a minmax two-watchman route intersects one of the extensions in the pair.

Fig. 9
figure 9

The two-watchman-route algorithm

5.1 Computing Tentacles and Bases

The algorithm needs to find the two bases \(\textit{q}_1\) on \(\textit{e}_1\) and \(\textit{q}_2\) on \(\textit{e}_2\). To this end, let \({{{\textit{s}_{\textit{e}}}_\textit{i}}}\) be the maximal line segments through \(\textit{q}_i\), orthogonal to \(\textit{e}_i\) inside P, for \(i\in \{1,2\}\). The segment \({{{\textit{s}_{\textit{e}}}_\textit{i}}}\) partitions P into two subpolygons \({\textbf {P}}_{\!L}\) and \({\textbf {P}}_{\!R}\). The minimum jellyfish \(\mathcal {J}^{\min }_{\textit{e}_i}\) either has one tentacle that attains the length \(\Vert \hspace{-0.08em}\mathcal {J}^{\min }_{\textit{e}_i}\hspace{-0.08em}\Vert \) with its first segment orthogonal to \(\textit{e}_i\) or at an endpoint of \(\textit{e}_i\), or it has two tentacles, one in \({\textbf {P}}_{\!L}\) and the other in \({\textbf {P}}_{\!R}\), that attain this length. To prove this, note that if the single tentacle attaining the length \(\Vert \hspace{-0.08em}\mathcal {J}^{\min }_{\textit{e}_i}\hspace{-0.08em}\Vert \) does not have a first segment orthogonal to \(\textit{e}_i\), then by moving the head slightly along \(\textit{e}_i\), we can reduce the length of the tentacle and thereby the jellyfish. Similarly, if all tentacles attaining the maximal length are in the same subpolygon, say \({\textbf {P}}_{\!L}\), then we can move the head along \(\textit{e}_i\) into \({\textbf {P}}_{\!L}\), again reducing the length of the jellyfish. In both cases, this contradicts that \(\mathcal {J}^{\min }_{\textit{e}_i}\) is a minimum jellyfish from a minimum jellyfish pair on \(\textit{e}_1\) and \(\textit{e}_2\). Thus, there are at most two longest tentacle pairs of \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\), at least one pair of which attains the length \(\Vert \hspace{-0.08em}{\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}}\hspace{-0.08em}\Vert \).

We construct the data structures needed to compute the bases. These data structures are, for each reflex vertex in P and each extension endpoint, the shortest path tree to every vertex in P[13]. The shortest path trees are augmented with the additional edges and leaves obtained by extending each tree edge until it intersects a boundary edge of P without crossing any other tree edge. Also, for each augmented tree, a data structure is built, enabling us to find the common ancestor of any pair of nodes in the tree (vertices of P) in constant time [15]. These can be precomputed in linear time for each root vertex, i.e., in quadratic time in total.

Next, we do a case analysis based on the number of longest tentacles occurring in a jellyfish pair. There are six cases to deal with.

Case 1

If \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) has one unique longest tentacle, then we know from the previous discussion that it is a tentacle \(\textit{Z}_{\textit{q}_{\textit{e}_{i}}}^{\textit{v}}\!(\textit{b})\) for some vertex endpoint \(\textit{v}\) of some boundary edge \(\textit{b}\) and \(i=1\) or \(i=2\). The point \(\textit{q}_{\textit{e}_{i}}\) is the point on \(\textit{e}_i\) that minimizes this distance and furthermore \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}_{\textit{e}_{i}}}^{\textit{v}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{Z}_{\textit{q}_{\textit{e}_{3-i}}}^{\textit{v}}\!(\textit{b})\hspace{-0.08em}\Vert \). If \(\textit{v}\) is a reflex vertex, let \(\textit{e}\) be the extension associated to it and we have that \(\textit{Z}_{\textit{q}_{\textit{e}_{i}}}^{\textit{v}}\!(\textit{b})=\textit{SP}\big (\textit{e}_i,{{\textbf {VP}}(\textit{v})}\cap {\textbf {L}}(\textit{e})\big )\) and if \(\textit{v}\) is a convex vertex, \(\textit{Z}_{\textit{q}_{\textit{e}_{i}}}^{\textit{v}}\!(\textit{b})=\textit{SP}\big (\textit{e}_i,{{\textbf {VP}}(\textit{v})}\big )\). In both cases, \(\textit{q}_{\textit{e}_{i}}\) is the point of intersection between the shortest path and \(\textit{e}_i\). Given \(\textit{e}_1\) and \(\textit{e}_2\) we can, for each boundary edge \(\textit{b}\) and for each vertex end point \(\textit{v}\), verify if \(\textit{v}\) is reflex or convex, compute \(\textit{SP}\big (\textit{e}_1,{{\textbf {VP}}(\textit{v})}\cap {\textbf {L}}(\textit{e})\big )\) and \(\textit{SP}\big (\textit{e}_2,{{\textbf {VP}}(\textit{v})}\cap {\textbf {L}}(\textit{e})\big )\) or \(\textit{SP}\big (\textit{e}_1,{{\textbf {VP}}(\textit{v})}\big )\) and \(\textit{SP}\big (\textit{e}_2,{{\textbf {VP}}(\textit{v})}\big )\), depending on the case, in linear time [11, 12, 18, 19, 21, 28]. We denote these tentacles \(\textit{Z}_{\textit{e}_1}^{\textit{v}}\!(\textit{b})\) and \(\textit{Z}_{\textit{e}_2}^{\textit{v}}\!(\textit{b})\) to indicate that the intersection points with \(\textit{e}_1\) and \(\textit{e}_2\) are not fixed given points. We select the shorter of the two, \(\textit{Z}_{\textit{e}_i}^{\textit{v}}\!(\textit{b})\), identifying the intersection with the corresponding extension \(\textit{e}_i\), \(i=1\) or 2, keeping the \(\textit{q}_{\textit{e}_{i}}\) for which the tentacle is the longest. After iterating over all boundary edges, one potential base \(\textit{q}_{\textit{e}_{i}}\) remains on \(\textit{e}_i\) and one \(\textit{q}_{\textit{e}_{3-i}}\) remains on \(\textit{e}_{3-i}\). The whole process takes quadratic time and gives us the potential bases \(\textit{q}^{{(1)}}_1\) and \(\textit{q}^{{(1)}}_2\) on \(\textit{e}_1\) and \(\textit{e}_2\), respectively.

Case 2

If \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) has two longest tentacles, this can occur in three different ways. One possibility is that two tentacles \(\textit{Z}_{\textit{e}_i}^{\textit{v}}\!(\textit{b})\) and \(\textit{Z}_{\textit{e}_j}^{\textit{v}'}\!(\textit{b}')\), \(i\in \{1,2\}\), \(j\in \{1,2\}\) and different boundary edges \(\textit{b}\) and \(\textit{b}\)’, have exactly the same length. If \(i=j\), the heads of \(\textit{Z}_{\textit{e}_i}^{\textit{v}}\!(\textit{b})\) and \(\textit{Z}_{\textit{e}_j}^{\textit{v}'}\!(\textit{b}')\) also coincide in this case, otherwise the base is found in Case 3. Such tentacles are discovered using the method described in the previous case.

Fig. 10
figure 10

Computing the bases of the minimum jellyfish pair

The second way is that two tentacles in \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) are \(\textit{Z}_{\textit{e}_1}^{\textit{r}^{*}}\!(\textit{b})\) and \(\textit{Z}_{\textit{e}_2}^{\textit{r}^{*}}\!(\textit{b})\), for some boundary edge \(\textit{b}\), where \(\textit{r}^{*}\) is a point on \(\textit{b}\) such that \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}_{\textit{e}_1}}^{\textit{r}^{*}}\!(\textit{b})\hspace{-0.08em}\Vert =\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}_{\textit{e}_2}}^{\textit{r}^{*}}\!(\textit{b})\hspace{-0.08em}\Vert \), \(\textit{q}_{\textit{e}_1}\) and \(\textit{q}_{\textit{e}_2}\) being the points on \(\textit{e}_1\) and \(\textit{e}_2\) that make these tentacles as short as possible. We can, for each boundary edge \(\textit{b}=[\textit{v},\textit{v}']\), compute \(\textit{Z}_{\textit{e}_1}^{\textit{v}}\!(\textit{b})\), \(\textit{Z}_{\textit{e}_2}^{\textit{v}}\!(\textit{b})\), \(\textit{Z}_{\textit{e}_1}^{\textit{v}'}\!(\textit{b})\), and \(\textit{Z}_{\textit{e}_2}^{\textit{v}'}\!(\textit{b})\) as in Case 1. Now, if \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{e}_1}^{\textit{v}}\!(\textit{b})\hspace{-0.08em}\Vert <\Vert \hspace{-0.08em}\textit{Z}_{\textit{e}_2}^{\textit{v}}\!(\textit{b})\hspace{-0.08em}\Vert \) and \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{e}_1}^{\textit{v}'}\!(\textit{b})\hspace{-0.08em}\Vert >\Vert \hspace{-0.08em}\textit{Z}_{\textit{e}_2}^{\textit{v}'}\!(\textit{b})\hspace{-0.08em}\Vert \), or the inequalities are reversed, we let a point \(\textit{r}\) slide along \(\textit{b}\) from \(\textit{v}\) to the other end point \(\textit{v}\)’; see Fig. 10a. By Corollary 4.3, the lengths of \(\textit{Z}_{\textit{e}_1}^{\textit{r}}\!(\textit{b})\) and \(\textit{Z}_{\textit{e}_2}^{\textit{r}}\!(\textit{b})\) as \(\textit{r}\) moves along \(\textit{b}\) are smooth functions (continuous and differentiable) except at positions denoted event points where any of the participating tentacles has one of the following properties:

  1. 1.

    an interior point of the first edge of a tentacle intersects a vertex of P, or the first and second edge of the tentacle become collinear,

  2. 2.

    an interior point of the last edge of a tentacle intersects a vertex of P, or the last and penultimate edge of the tentacle become collinear,

  3. 3.

    the cut \(\textit{c}\big (\textit{Z}_{\textit{e}_i}^{\textit{r}}\!(\textit{b})\big )\), \(i\in \{1,2\}\), becomes intersects more than one vertex of P,

  4. 4.

    the head or the tip of a tentacle either hits or leaves the boundary of P, and

  5. 5.

    one tentacle goes from being shorter than the longer tentacle to becoming the longer tentacle, at which point the two tentacles have equal length.

The positions on \(\textit{b}\) for the first three event point types can be obtained in linear time, if \(\textit{Z}_{\textit{e}_i}^{\textit{r}}\!(\textit{b})\) consists of at least two segments having as common end point, the reflex boundary vertex \(\textit{u}_i\), by a traversal of the augmented shortest path tree to each vertex in P from the root \(\textit{u}_i\), giving us a total of O(n) such event points. If \(\textit{Z}_{\textit{e}_i}^{\textit{r}}\!(\textit{b})\) consists of just one segment, the positions for the first three event point types on \(\textit{b}\) can be obtained in linear time by a traversal of the augmented shortest path trees rooted at the two end points of \(\textit{e}_i\).

The fourth type is obtained by finding the point at which the first edge of the tentacle hits either end point of \(\textit{e}_i\) and where the last edge of the tentacle intersects \(\textit{c}\big (\textit{Z}_{\textit{e}_i}^{\textit{r}}\!(\textit{b})\big )\) orthogonally on the boundary which can happen only once for each tentacle in each interval between event points of the first three types. Finally, the last type of event points can occur only a constant number of times in each interval between event points of the first four types, since here each function is the sum of at most three square roots of rational polynomials of constant degree and two such functions can be equal in at most a constant number of points. The number of event points between \(\textit{v}\) and \(\textit{v}\)’ on \(\textit{b}\) is at most linear and iterating over all possible boundary edges, takes quadratic time to solve this case. This gives us the potential bases \(\textit{q}^{{(2)}}_1\) and \(\textit{q}^{{(2)}}_2\) on \(\textit{e}_1\) and \(\textit{e}_2\), respectively.

Case 3

In the third possibility that \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) has two longest tentacles, the two tentacles are \(\textit{Z}_{\textit{q}}^{\textit{v}_1^{}}\!(\textit{b}_1)\) and \(\textit{Z}_{\textit{q}}^{\textit{v}_2^{}}\!(\textit{b}_2)\) for two boundary edges \(\textit{b}_1\) and \(\textit{b}_2\) with vertex end points \(\textit{v}_1^{}\) and \(\textit{v}_2^{}\) respectively and \(\textit{q}\) on \(\textit{e}_i\) such that \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}}^{\textit{v}_1^{}}\!(\textit{b}_1)\hspace{-0.08em}\Vert =\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}}^{\textit{v}_2^{}}\!(\textit{b}_2)\hspace{-0.08em}\Vert \). We compute \(\textit{Z}_{\textit{e}_i}^{\textit{v}_1^{}}\!(\textit{b}_1)\) and \(\textit{Z}_{\textit{e}_i}^{\textit{v}_2^{}}\!(\textit{b}_2)\) and let \(\textit{q}_{\textit{e}_{i}}\) and \(\textit{q}_{\textit{e}_{i}}\)’ be the heads of \(\textit{Z}_{\textit{e}_i}^{\textit{v}_1^{}}\!(\textit{b}_1)\) and \(\textit{Z}_{\textit{e}_i}^{\textit{v}_2^{}}\!(\textit{b}_2)\), respectively, on \(\textit{e}_i\). We let a point \(\textit{q}\) slide along \(\textit{e}_i\) from \(\textit{q}_{\textit{e}_{i}}\) to \(\textit{q}_{\textit{e}_{i}}\)’. Again, by Corollary 4.3, the lengths of \(\textit{Z}_{\textit{q}}^{\textit{v}_1^{}}\!(\textit{b}_1)\) and \(\textit{Z}_{\textit{q}}^{\textit{v}_2^{}}\!(\textit{b}_2)\) as \(\textit{q}\) moves along \(\textit{e}_i\) are smooth functions (continuous and differentiable) except at the event points established in Case 2. At these event points, the structures of the tentacles are updated and we can test whether the two tentacles have equal length for some head point on \(\textit{e}_i\) before the next event point. The number of event points between \(\textit{q}_{\textit{e}_{i}}\) and \(\textit{q}_{\textit{e}_{i}}\)’ on \(\textit{e}_i\) is at most linear. We perform these steps also on \(\textit{e}_{3-i}\) and take the shortest pair as the representative base for the pair \((\textit{v}_1^{},\textit{v}_2^{})\) of vertices. Iterating over all possible pairs of boundary edges and their end points, the process takes cubic time in total and gives us the potential bases \(\textit{q}^{{(3)}}_1\) and \(\textit{q}^{{(3)}}_2\) on \(\textit{e}_1\) and \(\textit{e}_2\), respectively.

Case 4

If \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) has three longest tentacles, this can occur in two ways. The first possibility if some combination of three tentacles with common heads from the three previous cases exist, in which case these can be established using the previously described methods.

The second possibility that \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) has three longest tentacles occurs if there are two boundary edges \(\textit{b}_1=[\textit{v}_1^{},\textit{v}_1^{\prime }]\) and \(\textit{b}_2=[\textit{v}_2^{},\textit{v}_2^{\prime }]\) such that \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}^{*}}^{\textit{r}^{*}}\!(\textit{b}_1)\hspace{-0.08em}\Vert =\Vert \hspace{-0.08em}\textit{Z}_{\textit{e}_{3-i}}^{\textit{r}^{*}}\!(\textit{b}_1)\hspace{-0.08em}\Vert =\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}^{*}}^{\textit{v}_2^{}}\!(\textit{b}_2)\hspace{-0.08em}\Vert \), with \(\textit{q}^{*}\) on \(\textit{e}_i\); see Fig. 10b. We can establish the event points by a combination of the methods in Cases 2 and 3. Begin by finding the interval \([\textit{q}_{\textit{e}_{i}},\textit{q}_{\textit{e}_{i}}']\) on \(\textit{e}_i\) by computing the tentacles \(\textit{Z}_{\textit{e}_i}^{\textit{v}_1^{}}\!(\textit{b}_1)\) and \(\textit{Z}_{\textit{e}_i}^{\textit{v}_2^{}}\!(\textit{b}_2)\) having the heads \(\textit{q}_{\textit{e}_{i}}\) and \(\textit{q}_{\textit{e}_{i}}\)’, and then the event points generated by \(\textit{Z}_{\textit{q}}^{\textit{v}}\!(\textit{b})\) and \(\textit{Z}_{\textit{q}}^{\textit{v}'}\!(\textit{b}')\) in order as \(\textit{q}\) moves along \(\textit{e}_i\) from \(\textit{q}_{\textit{e}_{i}}\) to \(\textit{q}_{\textit{e}_{i}}\)’. Subsequently, establish the event points generated by \(\textit{Z}_{\textit{e}_i}^{\textit{r}}\!(\textit{b})\) and \(\textit{Z}_{\textit{e}_{3-i}}^{\textit{r}}\!(\textit{b})\) in order as \(\textit{r}\) moves along \(\textit{b}\). For each pair of intervals between event points along \(\textit{e}_i\) and along \(\textit{b}_1\), we verify if we can establish a point \(\textit{q}\) in the interval on \(\textit{e}_i\) and a point \(\textit{r}\) in the interval on \(\textit{b}_1\) such that \(\textit{Z}_{\textit{q}}^{\textit{r}}\!(\textit{b}_1)\), \(\textit{Z}_{\textit{q}}^{\textit{v}_2^{}}\!(\textit{b}_2)\), and \(\textit{Z}_{\textit{e}_{3-i}}^{\textit{r}}\!(\textit{b}_1)\) have equal length by solving the system of equalities given by the length functions of the three tentacles. Within each interval the length functions are smooth according to Corollary 4.3 so this takes constant time. In the worst case, we have to consider a linear number of intervals each on \(\textit{e}_i\) and \(\textit{b}_1\) taking quadratic time. Iterating over all possible pairs of boundary edges and their end points, the computation takes quartic time in total and gives us the potential bases \(\textit{q}^{{(4)}}_1\) and \(\textit{q}^{{(4)}}_2\) on \(\textit{e}_1\) and \(\textit{e}_2\), respectively.

Case 5

If \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) has four longest tentacles, this can occur in two ways. Again, the first possibility is if some combination of four tentacles with common heads from the four previous cases exist, in which case these can be established using the previously described methods.

The second possibility that \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) has four longest tentacles occurs if there are two boundary edges \(\textit{b}_1\) and \(\textit{b}_2\) such that \(\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}^{*}_1}^{\textit{r}^{*}_1}\!(\textit{b}_1)\hspace{-0.08em}\Vert =\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}^{*}_2}^{\textit{r}^{*}_1}\!(\textit{b}_1)\hspace{-0.08em}\Vert =\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}^{*}_1}^{\textit{r}^{*}_2}\!(\textit{b}_2)\hspace{-0.08em}\Vert =\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}^{*}_2}^{\textit{r}^{*}_2}\!(\textit{b}_2)\hspace{-0.08em}\Vert \), with \(\textit{q}^{*}_1\) on \(\textit{e}_1\), \(\textit{q}^{*}_2\) on \(\textit{e}_2\), \(\textit{r}^{*}_1\) on \(\textit{b}_1\), and \(\textit{r}^{*}_2\) on \(\textit{b}_2\); see Fig. 10c. We can establish the event points by extending the method in Case 4, giving a linear number of intervals on each segment \(\textit{e}_1\), \(\textit{e}_2\), \(\textit{b}_1\), and \(\textit{b}_2\), where the length functions of the tentacles are smooth according to Corollary 4.3. We verify if we can establish point \(\textit{q}_1\), \(\textit{q}_2\), \(\textit{r}_1\), and \(\textit{r}_2\) in their respective interval such that \(\textit{Z}_{\textit{q}_1}^{\textit{r}_1}\!(\textit{b}_1)\), \(\textit{Z}_{\textit{q}_2}^{\textit{r}_1}\!(\textit{b}_1)\), \(\textit{Z}_{\textit{q}_1}^{\textit{r}_2}\!(\textit{b}_2)\), and \(\textit{Z}_{\textit{q}_2}^{\textit{r}_2}\!(\textit{b}_2)\) have equal length by solving the system of equalities given by the length functions of the four tentacles which takes constant time in each interval. In the worst case, we have to consider a linear number of intervals each on \(\textit{e}_1\), \(\textit{e}_2\), \(\textit{b}_1\), and \(\textit{b}_2\), thus taking quartic time. Iterating over all possible pairs of boundary edges and their end points, the computation takes \(O(n^6)\) time in total and gives us the potential bases \(\textit{q}^{{(5)}}_1\) and \(\textit{q}^{{(5)}}_2\) on \(\textit{e}_1\) and \(\textit{e}_2\), respectively.

Case 6

If \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) has five or more longest tentacles, they must occur as some combination of tentacles structured as in the previous cases and they can therefore be obtained using the methods described above.

Analysis of the Preprocessing Step

The case analysis above gives us five pairs of potential bases, \(\big (\textit{q}^{{(1)}}_1\!,\textit{q}^{{(1)}}_2\big ),\big (\textit{q}^{{(2)}}_1\!,\textit{q}^{{(2)}}_2\big ),\ldots ,\big (\textit{q}^{{(5)}}_1\!,\textit{q}^{{(5)}}_2\big )\), for which we can compute the jellyfish pairs \(\mathcal {J}_{\textit{q}^{{(1)}}_1\!,\textit{q}^{{(1)}}_2},\mathcal {J}_{\textit{q}^{{(2)}}_1\!,\textit{q}^{{(2)}}_2},\ldots ,\mathcal {J}_{\textit{q}^{{(5)}}_1\!,\textit{q}^{{(5)}}_2}\), each in quadratic time, and from these we select the minimum one. By Corollary 4.3 and the previous discussion, it follows that this jellyfish pair is a minimum jellyfish pair \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) with bases \(\textit{q}_1\) and \(\textit{q}_2\) on \(\textit{e}_1\) and \(\textit{e}_2\), respectively.

In this way, we have an \(O(n^6)\) time subroutine to find the bases \(\textit{q}_1\) and \(\textit{q}_2\) on \(\textit{e}_1\) and \(\textit{e}_2\), respectively. Given the bases, the computation of \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\) takes an additional quadratic time. The whole process of Step 5.1 of the algorithm thus takes \(O(n^6)\) time.

5.2 Establishing the Tours

Given a minimum jellyfish pair \(\mathcal {J}^{\min }_{\textit{e}_1,\textit{e}_2}\), we sort the tentacles in decreasing order of length and for each tentacle \(\textit{Z}_{\textit{q}_i}^{\textit{r}}\!(\textit{b})\) in decreasing order check if \(\textit{c}\big (\textit{Z}_{\textit{q}_i}^{\textit{r}}\!(\textit{b})\big )\) is already covered by a longer tentacle. If so, \(\textit{Z}_{\textit{q}_i}^{\textit{r}}\!(\textit{b})\) is removed from the jellyfish pair. We call the resulting jellyfish pair reduced and denote it by \(\mathcal {J}^\textrm{red}_{\textit{e}_1,\textit{e}_2}\) with individual jellyfish \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) and \(\mathcal {J}^\textrm{red}_{\textit{e}_2}\).

Let \(\textit{t}({{\mathcal {J}}})\) denote the two relative convex hulls of each of the jellyfish in the jellyfish pair \({{\mathcal {J}}}\) inside P. Without loss of generality, if \({{\mathcal {J}}}={{\mathcal {J}}}_1\cup {{\mathcal {J}}}_2\) with \({{\mathcal {J}}}_1\) and \({{\mathcal {J}}}_2\) being the two jellyfish, \(\textit{t}(\mathcal{J}_1)\) and \(\textit{t}({{\mathcal {J}}}_2)\) also denote the individual relative convex hulls of \({{\mathcal {J}}}_1\) and \({{\mathcal {J}}}_2\) in P.

Let \(\textit{W}_{1}\) and \(\textit{W}_{2}\) be the relative convex hulls \(\textit{t}(\mathcal {J}^\textrm{red}_{\textit{e}_1})\) and \(\textit{t}(\mathcal {J}^\textrm{red}_{\textit{e}_2})\) in P, respectively. These tours can be computed in linear time by first following the shortest path from each tentacle tip to the next, cyclically around the corresponding head of each jellyfish and then applying the algorithm by Toussaint [35]; see Fig. 11a.

Consider a polygonal tour that has reflex vertices only at reflex vertices of P. A maximal consecutive subsequence of edges of the tour is called a reflex chain of the tour, if each interior vertex of the chain is reflex in the tour. The end vertices of a reflex chain must therefore be convex vertices of the tour. In contrast, a convex chain of the tour is a maximal consecutive subsequence of edges such that each interior and end vertex of the chain is convex in the tour. We note that a single convex vertex of a tour is a convex chain if the preceding and subsequent vertices are reflex.

Fig. 11
figure 11

Illustrating the construction of the tour and the partition into subpaths used in the proof of Lemma 5.1. a The green tour \(\textit{W}_{1}\) is the relative convex hull of the jellyfish \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) (light blue). b Partitioning the tour \(\textit{W}_{1}\) into subpaths \(\textit{C}\), \(\Pi _{R}\), and \(\Pi _{L}\), when \(\textit{W}_{1}\) does not intersect or contain \(\textit{T}_1\)(Color figure online)

Lemma 5.1

The tours \((\textit{W}_{1},\textit{W}_{2})\) obtained by algorithm Two-Watchman-Route form a two-watchman route and

$$\begin{aligned}{} & {} \Vert \hspace{-0.08em}(\textit{W}_{1},\textit{W}_{2})\hspace{-0.08em}\Vert _{{\tiny \mathsf max}} \le (7\pi /6 + 3 - \sqrt{3} + \sqrt{5}\arcsin 1/\sqrt{5})\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}\\{} & {} \quad \approx 5.969\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}. \end{aligned}$$

Proof

The correctness of the algorithm follows from Lemmas 3.14.1, and the fact that since the two tours together see every boundary edge this ensures that they form a two-watchman route.

To prove the approximation bound, we assume that \(\textit{T}_1\) and \(\textit{T}_2\) do not intersect, otherwise \(\Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{T}_1\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert \le 2\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}\) immediately proving the lemma since \(\Vert \hspace{-0.08em}(\textit{W}_{1},\textit{W}_{2})\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}\le \Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert \) and the algorithm initializes the two-watchman route with a shortest watchman tour and a point in Step 3 and then only updates its two-watchman route in Step 5.4 if its max length is strictly smaller than that of the current route pair.

The algorithm computes the reduced minimum jellyfish pair \(\mathcal {J}^\textrm{red}_{\textit{e}_1,\textit{e}_2}\) in Step 5.2. By trying all pairs of extensions in Step 5, the algorithm must necessarily consider a pair, \(\textit{e}_1\) and \(\textit{e}_2\), intersected by the tours \(\textit{T}_1\) and \(\textit{T}_2\); see Lemma 3.5. Consider the tentacles in \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) and \(\mathcal {J}^\textrm{red}_{\textit{e}_2}\) centered on the bases \(\textit{q}_1\) on \(\textit{e}_1\) and \(\textit{q}_2\) on \(\textit{e}_2\), respectively. Every tentacle has length at most \(R=\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}/2\) by Inequality (5), since we can assume that \(\textit{T}_1\) intersects \(\textit{e}_1\) and \(\textit{T}_2\) intersects \(\textit{e}_2\), whereby the geodesic radii of \(\textit{W}_{1}\) and \(\textit{W}_{2}\) are both at most R.

Each convex chain of \(\textit{W}_{1}\) has length at most \(2\pi R\), where R is an upper bound on the length of each geodesic shortest path from \(\textit{q}_1\) to any point on \(\textit{W}_{1}\), since the circle is the longest convex curve of radius R. This follows from Archimedes’ axioms for arc-length [1, 5].

We make a case analysis and bound the length of \(\textit{W}_{1}\) for each case separately. The first case when \(\textit{W}_{1}\) has one convex chain can be easily bounded. When \(\textit{W}_{1}\) has two or more convex chains, we separate that into two further cases, when \(\textit{W}_{1}\) intersects or contains both \(\textit{T}_1\) and \(\textit{T}_2\) and when it does not. The first of these cases can be bounded by estimating the total length of a tour including both \(\textit{T}_1\) and \(\textit{T}_2\). For the last case, we assume that \(\textit{W}_{1}\) does not intersect \(\textit{T}_1\) and partition \(\textit{W}_{1}\) into the subpath \(\textit{C}_1\) and the subtour \(\textit{W}'_{1}\) and bound the length of these separately. The path \(\textit{C}_1\) passes those tentacle cuts for tentacles in \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) that are covered exclusively by \(\textit{T}_1\) and the subtour \(\textit{W}'_{1}\) is the relative convex hull of the tentacles in in \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) for which the tentacle cuts are covered by \(\textit{T}_2\). The length of the subpath \(\textit{C}_1\) is bounded in Lemma 5.2 and the length of the subtour \(\textit{W}'_{1}\) is bounded in Lemma 5.3. We provide the details below.

  • \(\textit{W}_{1}\) has one convex chain. The convex chain of \(\textit{W}_{1}\) has length at most \(2\pi R\) as we noted above. The length of the possible reflex chain of \(\textit{W}_{1}\) is bounded by at most two radii from \(\textit{q}_1\) to the circle perimeter since its length is bounded by that of the two tentacles of \(\mathcal {J}^{\min }_{\textit{e}_1}\) connecting to the end points of the reflex chain. Hence,

    $$\begin{aligned} \Vert \hspace{-0.08em}\textit{W}_{1}\hspace{-0.08em}\Vert \le 2\pi R + 2R = (\pi +1)\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}. \end{aligned}$$
    (6)
  • \(\textit{W}_{1}\) has at least two convex chains. This case is further subdivided into the cases:

    • \(\textit{W}_{1}\) or its interior intersects both \(\textit{T}_1\) and \(\textit{T}_2\). If \(\textit{W}_{1}\) intersects \(\textit{T}_1\), let \(\textit{p}_1\) be an intersection point of \(\textit{W}_{1}\) with \(\textit{T}_1\). From \(\textit{p}_1\) move counterclockwise along \(\textit{W}_{1}\) until the end point of a tentacle from \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) is reached at \(\textit{p}_{{\tiny \mathsf L}}\). Similarly, move clockwise along \(\textit{W}_{1}\) until the end point of a tentacle from \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) is reached at \(\textit{p}_{{\tiny \mathsf R}}\). Since the region bounded by moving counterclockwise from \(\textit{p}_{{\tiny \mathsf R}}\) along \(\textit{W}_{1}\) to \(\textit{p}_{{\tiny \mathsf L}}\), from \(\textit{p}_{{\tiny \mathsf L}}\) along the tentacle of \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) to \(\textit{q}_1\), and from \(\textit{q}_1\) along a tentacle of \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) to \(\textit{p}_{{\tiny \mathsf R}}\) forms a pseudotriangle, relatively convex inside P, the shortest path from \(\textit{p}_1\) to \(\textit{q}_1\) has length at most that of one of the tentacles of \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\), which is bounded by R. If \(\textit{W}_{1}\) does not intersect \(\textit{T}_1\), then \(\textit{T}_1\) lies interior to \(\textit{W}_{1}\) and we let \(\textit{p}_1\) be a point closest to \(\textit{q}_1\). Again, the length of shortest path from \(\textit{p}_1\) to \(\textit{q}_1\) is bounded by R, since extending the first edge until it hits the tour \(\textit{W}_{1}\) at some point \(\textit{p}_1\)’, the shortest path from \(\textit{p}_1\)’ to \(\textit{q}_1\) contains \(\textit{p}_1\) and since \(\textit{p}_1\)’ lies on \(\textit{W}_{1}\), we can use the previous argument to show that the length of the shortest path from \(\textit{p}_1\)’ to \(\textit{q}_1\) is bounded by R. If \(\textit{W}_{1}\) intersects \(\textit{T}_2\), let \(\textit{p}_2\) be intersection point of \(\textit{W}_{1}\) with \(\textit{T}_2\), otherwise let \(\textit{p}_2\) be a point on \(\textit{T}_2\) closest to \(\textit{q}_1\). In the same way as above, we can bound the length of the shortest path from \(\textit{p}_2\) to \(\textit{q}_1\) by R. Now, construct a tour \(\textit{W}_{{\tiny \mathsf \!bnd}}\) by following \(\textit{T}_1\) from \(\textit{p}_1\) around in counterclockwise order, following the shortest path from \(\textit{p}_1\) to \(\textit{q}_1\), the shortest path from \(\textit{q}_1\) to \(\textit{p}_2\), from \(\textit{p}_2\) around \(\textit{T}_2\) in counterclockwise order, and then back along the shortest paths via \(\textit{q}_1\) to \(\textit{p}_1\). It is clear that \(\textit{W}_{{\tiny \mathsf \!bnd}}\) is a watchman tour and therefore has length no shorter than \(\textit{W}_{{\tiny \mathsf \!opt}}\) and since the algorithm initializes the two-watchman route with \(\textit{W}_{{\tiny \mathsf \!opt}}\) and an arbitrary point in Step 3 and then only updates its two-watchman route in Step 5.4 if it has max-length strictly smaller than the current route pair, the length of \(\textit{W}_{1}\) is bounded by

      $$\begin{aligned} \Vert \hspace{-0.08em}\textit{W}_{1}\hspace{-0.08em}\Vert < \Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!opt}}\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{W}_{{\tiny \mathsf \!bnd}}\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{T}_1\hspace{-0.08em}\Vert + \Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert + 4R \le 4\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}. \end{aligned}$$
      (7)
    • \(\textit{W}_{1}\) or its interior intersects at most one of \(\textit{T}_1\) or \(\textit{T}_2\). Without loss of generality, we assume that \(\textit{T}_1\) does not intersect \(\textit{W}_{1}\) or the interior of \(\textit{W}_{1}\), otherwise we interchange the roles of \(\textit{T}_1\) and \(\textit{T}_2\) in the argument below. Cut P along the segments of \(\textit{W}_{1}\) into disjoint pieces, thus partitioning P into separate components; see Fig. 11b. Let \({\textbf {Q}}\) be the component containing \(\textit{T}_1\). The subpath \(\Pi \) of \(\textit{W}_{1}\) bounding \({\textbf {Q}}\) is either a single segment connecting two reflex vertices of \(\textit{W}_{1}\) or it consists of a single convex chain \(\textit{C}\) between two segments having reflex vertices \(\textit{v}\) and \(\textit{v}\)’ at the end points. Extend \(\Pi \) at both ends along \(\textit{W}_{1}\) until convex vertices are reached at both ends, these must exist since \(\textit{W}_{1}\) has at least two convex chains. Let the path thus obtained be \(\Pi '\). If \(\Pi \) includes a convex chain, consider the two paths \(\Pi '\setminus \textit{C}\) that we denote by \(\Pi _{L}\) and \(\Pi _{R}\), where \(\Pi _{L}\) appears before \(\Pi _{R}\) during a counterclockwise traversal of \(\textit{W}_{1}\) starting at a point in \(\textit{C}\); see Fig. 11b. Walk along \(\textit{C}\) from each end point \(\textit{v}\) and \(\textit{v}\)’ until convex vertices \(\bar{\textit{v}}\) and \(\bar{\textit{v}}\)’ are reached for which the associated tentacle cuts are not covered by \(\textit{T}_2\), if there are any. These cuts must be covered by \(\textit{T}_1\). Let \(\textit{C}_1\) be the subpath of \(\textit{C}\) from \(\bar{\textit{v}}\) to \(\bar{\textit{v}}\)’. If \(\textit{C}_1=\textit{C}\), then already the end points of \(\textit{C}\) have associated tentacle cuts that are not covered by \(\textit{T}_2\) and if all associated tentacle cuts to the vertices of \(\textit{C}\) are covered by \(\textit{T}_2\), then we let \(\textit{C}_1=\emptyset \). If \(\textit{C}_1\) is not empty, Lemma 5.2 below gives us that \(\Vert \hspace{-0.08em}\textit{C}_1\hspace{-0.08em}\Vert \le 4\pi R/3\) and if it is empty or a single point \(\Vert \hspace{-0.08em}\textit{C}_1\hspace{-0.08em}\Vert =0\). Thus, we need to bound the length of the remainder of \(\textit{W}_{1}\). Let \(\textit{p}_x\) be some intersection point between \(\textit{W}_{1}\) and \(\textit{e}_1\). From \(\textit{p}_x\), walk counterclockwise along \(\textit{W}_{1}\) back to \(\textit{p}_x\), shortcutting those convex vertices associated to tentacle cuts only covered by \(\textit{T}_1\) and let \(\textit{W}'_{1}\) be the tour thus obtained. Let \(\mathcal {J}^{{\tiny \mathsf 2}}_{\textit{e}_1}\) be the subset of tentacles of \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) for which each associated tentacle cut is covered by \(\textit{T}_2\). By construction, the tour \(\textit{W}'_{1}\) is the relative convex hull of the tentacles of \(\mathcal {J}^{{\tiny \mathsf 2}}_{\textit{e}_1}\) in P. All convex vertices on \(\textit{W}_{1}\) associated to tentacle cuts covered exclusively by \(\textit{T}_1\) lie on \(\textit{C}_1\) by our observation above, giving us

      $$\begin{aligned} \Vert \hspace{-0.08em}\textit{W}_{1}\hspace{-0.08em}\Vert&\le \Vert \hspace{-0.08em}\textit{W}'_{1}\hspace{-0.08em}\Vert +2R+\Vert \hspace{-0.08em}\textit{C}_1\hspace{-0.08em}\Vert , \end{aligned}$$
      (8)

      since the union of the two tentacles connecting \(\textit{q}_1\) with the end points of \(\textit{C}_1\) intersects \(\textit{W}'_{1}\), they together cover the tentacle cuts covered by \(\textit{W}_{1}\) at the same points, and \(\textit{W}_{1}\) is relatively convex. From Inequality (8), Lemmas 5.2 and 5.3 below, bounding the lengths of \(\textit{C}_1\) and \(\textit{W}'_{1}\), we have for this case

      $$\begin{aligned} \Vert \hspace{-0.08em}\textit{W}_{1}\hspace{-0.08em}\Vert&\le \Vert \hspace{-0.08em}\textit{W}'_{1}\hspace{-0.08em}\Vert + 2R + \Vert \hspace{-0.08em}\textit{C}_1\hspace{-0.08em}\Vert \nonumber \\ {}&\le \left( \pi /2+2-\sqrt{3}+\sqrt{5}\arcsin 1/\sqrt{5}\right) \Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}} + 2R + 4\pi R/3 \nonumber \\ {}&= \big (7\pi /6 + 3 - \sqrt{3} + \sqrt{5}\arcsin 1/\sqrt{5}\big ) \Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}. \end{aligned}$$
      (9)

From the three cases that we have dealt with, Inequalities (6), (7), and (9), we have

$$\begin{aligned} \Vert \hspace{-0.08em}\textit{W}_{1}\hspace{-0.08em}\Vert&\le \max \left\{ \begin{array}{l} \big (\pi +1\big )\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}, \\ 4\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}, \\ \big (7\pi /6 + 3 - \sqrt{3} + \sqrt{5}\arcsin 1/\sqrt{5}\big )\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}. \end{array} \right. \end{aligned}$$
(10)

The last case has the worst upper bound

\(\Vert \hspace{-0.08em}\textit{W}_{1}\hspace{-0.08em}\Vert \le \big (7\pi /6 + 3 - \sqrt{3} + \sqrt{5}\arcsin 1/\sqrt{5}\big )\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}} \approx 5.969\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}.\)

We can make the same argument for the second tour \(\textit{W}_{2}\), obtaining the same bound, whereby the lemma follows. \(\square \)

We bound the length of the subpath \(\textit{C}_1\) next.

Lemma 5.2

Given a jellyfish \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) with relative convex hull \(\textit{W}_{1}\) that does not intersect \(\textit{T}_1\), let \(\textit{C}_1\) be the maximal subpath of \(\textit{W}_{1}\) connecting convex vertices of \(\textit{W}_{1}\) such that the corresponding tentacle cuts are covered by \(\textit{T}_1\). We have

$$\begin{aligned} \Vert \hspace{-0.08em}\textit{C}_1\hspace{-0.08em}\Vert \le \frac{4\pi \cdot R}{3}. \end{aligned}$$

Proof

Consider the two end points \(\bar{\textit{v}}\) and \(\bar{\textit{v}}\)’ of \(\textit{C}_1\) (if the end points coincide, \(\textit{C}_1\) is a single point and has length 0, so we assume that the end points do not coincide); see Fig. 11b. Let \(\textit{e}\) and \(\textit{e}\)’ be the two tentacle cuts covered by the two end points \(\bar{\textit{v}}\) and \(\bar{\textit{v}}\)’ of \(\textit{C}_1\). Since \(\textit{T}_2\) does not cover any of \(\textit{e}\) or \(\textit{e}\)’, \(\textit{T}_1\) must have points to the left of these cuts. Without loss of generality, we assume that \(\bar{\textit{v}}\) is passed before \(\bar{\textit{v}}\)’ during a counterclockwise traversal of \(\textit{W}_{1}\) starting at a point interior to \(\textit{C}_1\). We make the additional observation that any tentacle cut associated to convex vertices of \(\textit{W}_{1}\setminus \textit{C}_1\) must be covered by \(\textit{T}_2\), otherwise \(\textit{T}_1\) would intersect \(\textit{W}_{1}\) or have points in its interior.

Fig. 12
figure 12

Illustrating the proof of Lemma 5.2. Bounding the length of \(\textit{C}_1\)

Let l and \(l'\) be the lines through \(\textit{e}\) and \(\textit{e}\)’ and let \(\textit{p}\) be the intersection point between l and \(l'\), assuming that it exists. If l and \(l'\) are parallel or \(\textit{p}\) lies after \(\bar{\textit{v}}\) on l in the direction of \(\textit{e}\), then the angle between the tentacle of \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) connecting \(\textit{q}_1\) and \(\bar{\textit{v}}\) and the tentacle of \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) connecting \(\textit{q}_1\) and \(\bar{\textit{v}}\)’ containing \(\textit{C}_1\) is at most \(\pi \), since \(\textit{q}_1\), \(\bar{\textit{v}}\)’, \(\textit{p}\), and \(\bar{\textit{v}}\) form a convex quadrilateral (\(\textit{p}\) can be taken to be a point on l implicitly at infinity, if l and \(l'\) are parallel); see Fig. 12a. Each segment of \(\textit{C}_1\) can be projected onto a half circle centered at \(\textit{q}_1\) having radius R without overlap so the length of \(\textit{C}_1\) is therefore bounded by \(\pi R\) in this case.

Now, if \(\textit{p}\) lies before \(\bar{\textit{v}}\) on l in the direction of \(\textit{e}\); see Fig. 12b, then since \(\textit{T}_1\) lies in \({\textbf {Q}}\) without intersecting \(\textit{C}_1\), \(\textit{T}_1\) must intersect the two cuts \(\textit{e}\) and \(\textit{e}\)’. Assume these intersection points are \(\textit{r}\) and \(\textit{r}\)’. The distance between \(\textit{r}\) and \(\textit{r}\)’ is at most R since \(\Vert \hspace{-0.08em}\textit{T}_1\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}=2R\) by Inequality 5. Assume that the longest tentacle of \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) connecting \(\textit{q}_1\) with a convex vertex of \(\textit{C}_1\) has length \(D\le R\) and let \(d\) and \(d\)’ be the points at distance exactly D from \(\textit{q}_1\) to l and \(l'\), respectively. The point \(d\) must lie between \(\bar{\textit{v}}\) and \(\textit{r}\) on \(\textit{e}\), otherwise \(\textit{T}_1\) intersects the longest tentacle of \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) and therefore also \(\textit{C}_1\). For the same reason, the point \(d\)’ must lie between \(\bar{\textit{v}}\)’ and \(\textit{r}\)’ on \(\textit{e}\)’. The distance \(\Vert \hspace{-0.08em}d,d'\hspace{-0.08em}\Vert \le R\) since \(\textit{T}_1\) does not intersect \(\textit{W}_{1}\). Given that the angle at \(d\), \(\textit{q}_1\), \(\bar{\textit{v}}\), and the angle at \(d\)’, \(\textit{q}_1\), \(\bar{\textit{v}}\)’, are each at most \(\pi /2\), that the angle at \(d\), \(\textit{q}_1\), \(d\)’ is \(\theta \), the segments of \(\textit{C}_1\) can be projected onto a semicircle centered at \(\textit{q}_1\) having radius D without overlap. The length of this semicircle is \((\pi +\theta )D\), which is maximized for \(\theta =\pi /3\) and \(D=R\) as obtained by standard analytic methods. Thus, \( \Vert \hspace{-0.08em}\textit{C}_1\hspace{-0.08em}\Vert \le 4\pi R/3 \) is the maximum bound in all cases. \(\square \)

It only remains to show the bound for the length of the subtour \(\textit{W}'_{1}\).

Lemma 5.3

Given a jellyfish \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) with base \(\textit{q}_1\) and relative convex hull \(\textit{W}_{1}\) that does not intersect \(\textit{T}_1\), let \(\textit{W}'_{1}\) be the relative convex hull of \(\mathcal {J}^{{\tiny \mathsf 2}}_{\textit{e}_1}\), the subset of tentacles \(Z_{\textit{q}_1}\) in \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) for which each tentacle cut \(\textit{c}(Z_{\textit{q}_1})\) is covered by \(\textit{T}_2\). We have

$$\begin{aligned} \Vert \hspace{-0.08em}\textit{W}'_{1}\hspace{-0.08em}\Vert \le \left( \frac{\pi }{2}+2-\sqrt{3}+\sqrt{5}\arcsin \frac{1}{\sqrt{5}}\right) \Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}. \end{aligned}$$
Fig. 13
figure 13

Illustrating the proof of Lemma 5.3. a Tours \(\textit{T}_2\) and \(\textit{W}'_{1}\) intersect if \(\textit{W}'_{1}\) has reflex vertices. be Constructing the chain \(\bar{\textit{C}}^{{(i)}}\) from \(\textit{C}^{{(i)}}\). b The base case of one extension, c the inductive case with obtuse angle between two extensions, d  the inductive case with acute angle between two extensions

Proof

Let \(\textit{e}\) be an extension covered by \(\textit{T}_1\) such that \(\textit{T}_1\) makes a reflection on \(\textit{e}\). Such an extension must exist by Lemma 3.5 since, if \(\textit{T}_1\) properly covers \(\textit{e}\), then it must cover some other extension in \({\textbf {L}}(\textit{e})\). Without loss of generality, we can therefore assume that \(\textit{e}_1=\textit{e}\) and thus that all but one point of \(\textit{T}_1\) lie in \({\textbf {P}}\setminus {\textbf {L}}(\textit{e}_1)\). It also follows that \(\textit{T}_2\) cannot cover \(\textit{e}_1\), since this would mean that \(\textit{T}_1\) could be made shorter contradicting that \(\textit{T}_1\) and \(\textit{T}_2\) are as short as possible. Hence, all points of \(\textit{T}_2\) lie in \({\textbf {P}}\setminus {\textbf {L}}(\textit{e}_1)\).

We identify two different cases. In the first case, \(\textit{W}'_{1}\) has at least two convex chains, we bound the length of \(\textit{W}'_{1}\) by considering a tour \(\textit{V}_2\) that contains \(\textit{W}'_{1}\) and show inductively on the number number of convex chains it contains that \(\Vert \hspace{-0.08em}\textit{V}_2\hspace{-0.08em}\Vert \le 2\sqrt{2}\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}\). In the second case, \(\textit{W}'_{1}\) has one convex chain and we bound its length by a short sequence of circular arcs. We provide the details below.

  • \(\textit{W}'_{1}\) has at least two reflex chains or one reflex chain with both end points in \({\textbf {P}}\setminus {\textbf {L}}(\textit{e}_1)\) We prove that \(\textit{T}_2\) must intersect \(\textit{W}'_{1}\). Let \(\textit{e}\)’ and \(\textit{e}\)” be the two tentacle cuts associated to convex vertices of \(\textit{W}'_{1}\) on either side of a reflex chain with both end points in \({\textbf {P}}\setminus {\textbf {L}}(\textit{e}_1)\). The cuts \(\textit{e}\)’ and \(\textit{e}\)” must exist and do not intersect in \({\textbf {P}}\setminus {\textbf {L}}(\textit{e}_1)\), otherwise \(\textit{W}'_{1}\) does not have the stated reflex chain. Now, \(\textit{T}_2\) must cover \(\textit{e}\)’ and \(\textit{e}\)” so it either covers \(\textit{e}\)’ exactly at the reflection point of \(\textit{W}'_{1}\) and \(\textit{e}\)’ or \(\textit{T}_2\) covers \(\textit{e}\)” exactly at the reflection point of \(\textit{W}'_{1}\) and \(\textit{e}\)”, giving us an intersection point between \(\textit{W}'_{1}\) and \(\textit{T}_2\) in either case, or \(\textit{T}_2\) contains a path that connects a point in \(\big ({\textbf {P}}\setminus {\textbf {L}}(\textit{e}_1)\big )\cap {\textbf {L}}(\textit{e}')\) with a point in \(\big ({\textbf {P}}\setminus {\textbf {L}}(\textit{e}_1)\big )\cap {\textbf {L}}(\textit{e}'')\) which must intersect \(\textit{W}'_{1}\) since \(\textit{e}\)’ and \(\textit{e}\)” are separated by reflex vertices on \(\textit{W}'_{1}\) touching the boundary of P and \(\textit{T}_2\) has no point in the interior of \({\textbf {L}}(\textit{e}_1)\); see Fig. 13a. We can construct a tour that connects \(\textit{q}_1\) with the closest point on \(\textit{T}_2\), follows \(\textit{T}_2\) around in counterclockwise order and then connects to \(\textit{q}_1\). This tour has the following properties, that we call bounding properties,

    1. 1.

      it covers all the tentacle cuts covered by \(\textit{W}'_{1}\) (and thus by \(\mathcal {J}^{{\tiny \mathsf 2}}_{\textit{e}_1}\)),

    2. 2.

      it lies completely in \(\textit{e}_1\cup ({\textbf {P}}\setminus {\textbf {L}}(\textit{e}_1))\),

    3. 3.

      it has a convex vertex at \(\textit{q}_1\), and

    4. 4.

      it has length at most \(2R+\Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert \).

    The last bounding property follows since \(\textit{T}_2\) intersects \(\textit{W}'_{1}\) (or its interior). Now, let \(\textit{U}_2\) be the shortest tour that obeys the bounding properties. We show how to extend \(\textit{U}_2\) to a new tour \(\textit{V}_2\) so that \(\textit{W}'_{1}\) is contained in \(\textit{V}_2\) and \(\Vert \hspace{-0.08em}\textit{V}_2\hspace{-0.08em}\Vert \le \sqrt{2}\Vert \hspace{-0.08em}\textit{U}_2\hspace{-0.08em}\Vert \). Since \(\textit{W}'_{1}\) is relatively convex and contained in \(\textit{V}_2\), we immediately have

    $$\begin{aligned} \Vert \hspace{-0.08em}\textit{W}'_{1}\hspace{-0.08em}\Vert&\le \Vert \hspace{-0.08em}\textit{V}_2\hspace{-0.08em}\Vert \le \sqrt{2}\Vert \hspace{-0.08em}\textit{U}_2\hspace{-0.08em}\Vert \le 2\sqrt{2}R+\sqrt{2}\Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert . \end{aligned}$$
    (11)

    To prove Inequality (11), follow \(\textit{U}_2\) counterclockwise from \(\textit{q}_1\), subdividing the tour into convex chains \(\textit{C}^{{(i)}}\), \(1\le i\le k\), such that \(\textit{u}^{{(i)}}_1\) is the reflex vertex before \(\textit{C}^{{(i)}}\) on \(\textit{U}_2\), and \(\textit{u}^{{(i)}}_2\) is the reflex vertex after \(\textit{C}^{{(i)}}\) on \(\textit{U}_2\). In the cases where the first vertex after \(\textit{q}_1\) or before \(\textit{q}_1\) is convex, we consider \(\textit{q}_1\) to be the vertex \(\textit{u}^{{(1)}}_1\) and \(\textit{u}^{{(k)}}_2\) according to the case. For each convex chain \(\textit{C}^{{(i)}}\), let \(m^{{(i)}}\) be the number of convex vertices on the chain, denoted by , these are the tips of the tentacles of \(\mathcal {J}^{{\tiny \mathsf 2}}_{\textit{e}_1}\), and let be the corresponding associated tentacle cuts; see Fig. 13b–e. It is clear that no tentacle of \(\mathcal {J}^{{\tiny \mathsf 2}}_{\textit{e}_1}\) intersects the interior of \({\textbf {L}}(\textit{e}^{{(i)}}_j)\), for any tentacle cut \(\textit{e}^{{(i)}}_j\), since \(\mathcal {J}^{{\tiny \mathsf 2}}_{\textit{e}_1}\subseteq \mathcal {J}^\textrm{red}_{\textit{e}_1}\) and if it did, it would cover \(\textit{e}^{{(i)}}_j\) whereby \(\textit{e}^{{(i)}}_j\) and its associated tentacle would be discarded as \(\mathcal {J}^\textrm{red}_{\textit{e}_1}\) is constructed. (To guarantee this property is in fact the reason why the algorithm constructs \(\mathcal {J}^\textrm{red}_{\textit{e}_1,\textit{e}_2}\) in Step 5.2.) To obtain \(\textit{V}_2\) from \(\textit{U}_2\), we replace each convex chain \(\textit{C}^{{(i)}}\), from \(\textit{u}^{{(i)}}_1\) to \(\textit{u}^{{(i)}}_2\) by a different path \(\bar{\textit{C}}^{{(i)}}\). If \(m^{{(i)}}=1\), i.e., \(\textit{C}^{{(i)}}\) has only one convex vertex \(\textit{v}^{{(i)}}_{1}\), then let \(\textit{r}^{{(i)}}_{1,1}\) be the end point of \(\textit{SP}(\textit{u}^{{(i)}}_1\!,\textit{e}^{{(i)}}_1)\) on the tentacle cut \(\textit{e}^{{(i)}}_1\). Similarly, let \(\textit{r}^{{(i)}}_{1,2}\) be the end point of \(\textit{SP}(\textit{u}^{{(i)}}_2\!,\textit{e}^{{(i)}}_1)\) on \(\textit{e}^{{(i)}}_1\). We let \(\bar{\textit{C}}^{{(i)}}\) be the shortest path from \(\textit{u}^{{(i)}}_1\) to \(\textit{e}^{{(i)}}_1\), the path from \(\textit{r}^{{(i)}}_{1,1}\) to \(\textit{r}^{{(i)}}_{1,2}\) on \(\textit{e}^{{(i)}}_1\), followed by the shortest path from \(\textit{e}^{{(i)}}_1\) to \(\textit{u}^{{(i)}}_2\); see Fig. 13b. The convex vertex \(\textit{v}^{{(i)}}_{1}\) lies on the segment from \(\textit{r}^{{(i)}}_{1,1}\) to \(\textit{r}^{{(i)}}_{1,2}\) on \(\textit{e}^{{(i)}}_1\), otherwise \(\textit{U}_2\) can be made shorter contradicting that \(\textit{U}_2\) is the shortest tour obeying the bounding properties. The length of the subpath of \(\bar{\textit{C}}^{{(i)}}\) from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_{1}\) is upper bounded by the length of the two catheti connecting \(\textit{u}^{{(i)}}_1\) with \(\textit{v}^{{(i)}}_{1}\), one being parallel to \(\textit{e}^{{(i)}}_1\) and the other orthogonal to \(\textit{e}^{{(i)}}_1\). Similarly, the length of the subpath of \(\textit{C}^{{(i)}}\) from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_{1}\) is lower bounded by the length of the line segment from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_{1}\) forming the hypotenuse of a right angled triangle with \(\textit{u}^{{(i)}}_1\) and \(\textit{v}^{{(i)}}_{1}\) as two corners. From elementary geometry it follows that the sum of the lengths of the catheti is bounded by \(\sqrt{2}\) times the length of the hypotenuse in a right angled triangle. Thus, the length of the subpath of \(\bar{\textit{C}}^{{(i)}}\) from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_{1}\) is at most \(\sqrt{2}\) times the length of the subpath of \(\textit{C}^{{(i)}}\) from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_{1}\). The same argument ensures that the length of the subpath of \(\bar{\textit{C}}^{{(i)}}\) from \(\textit{v}^{{(i)}}_{1}\) to \(\textit{u}^{{(i)}}_2\) is also at most \(\sqrt{2}\) times the length of the subpath of \(\textit{C}^{{(i)}}\) from \(\textit{v}^{{(i)}}_{1}\) to \(\textit{u}^{{(i)}}_2\). We proceed inductively on the parameter \(m^{{(i)}}\), the number of tentacle cuts covered along the path \(\textit{C}^{{(i)}}\), as follows. Let \(\textit{p}^{{(i)}}_1\) be the intersection of \(\textit{e}^{{(i)}}_1\) and \(\textit{e}^{{(i)}}_2\) (or the directed lines along \(\textit{e}^{{(i)}}_1\) and \(\textit{e}^{{(i)}}_2\)). The point \(\textit{p}^{{(i)}}_1\) must exist, otherwise \(\textit{C}^{{(i)}}\) is not a convex chain but contains reflex vertices. Let \(\alpha ^{{(i)}}_{1}\) be the angle of the wedge \({\textbf {P}}\setminus \big ({\textbf {L}}(\textit{e}^{{(i)}}_1)\cap {\textbf {L}}(\textit{e}^{{(i)}}_2)\big )\) at \(\textit{p}^{{(i)}}_1\); see Fig. 13c–e. We let be the path from \(\textit{u}^{{(i)}}_1\) to \(\textit{u}^{{(i)}}_2\), where \(\bar{\textit{C}}^{{(i)}}\!\big ({\textit{u}^{{(i)}}_1,\textit{v}^{{(i)}}_2}\big )\) is a path from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_2\) that covers \(\textit{e}^{{(i)}}_1\), contains \(\textit{v}^{{(i)}}_{1}\), and is at most \(\sqrt{2}\) times longer than the path from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_2\) along \(\textit{C}^{{(i)}}\). Since \(\textit{C}^{{(i)}}\) from \(\textit{v}^{{(i)}}_2\) to \(\textit{u}^{{(i)}}_2\) covers fewer than \(m^{{(i)}}\) tentacle cuts, we can assume that from \(\textit{v}^{{(i)}}_2\) to \(\textit{u}^{{(i)}}_2\) constructed inductively covers the remaining tentacle cuts, contains the vertices , and is at most \(\sqrt{2}\) times longer than the path from \(\textit{v}^{{(i)}}_2\) to \(\textit{u}^{{(i)}}_2\) along \(\textit{C}^{{(i)}}\). It remains to describe the construction of \(\bar{\textit{C}}^{{(i)}}\!\big ({\textit{u}^{{(i)}}_1,\textit{v}^{{(i)}}_2}\big )\) from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_2\), that covers one tentacle cut \(\textit{e}^{{(i)}}_1\), passes one vertex \(\textit{v}^{{(i)}}_{1}\), and is at most \(\sqrt{2}\) times longer than the path from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_2\) along \(\textit{C}^{{(i)}}\).

    • If \(\alpha ^{{(i)}}_{1}\) is obtuse or a right angle, let \(\textit{SP}(\textit{e}^{{(i)}}_1,\textit{e}^{{(i)}}_2)\) be the shortest path between \(\textit{e}^{{(i)}}_1\) end \(\textit{e}^{{(i)}}_2\). The path either degenerates into the single point \(\textit{p}^{{(i)}}_1\), if \(\textit{e}^{{(i)}}_1\) end \(\textit{e}^{{(i)}}_2\) intersect, or it is a path connecting a point \(\textit{r}^{{(i)}}_{1,2}\) on \(\textit{e}^{{(i)}}_1\) to a point \(\textit{r}^{{(i)}}_{2,1}\) on \(\textit{e}^{{(i)}}_2\). In this case, \(\bar{\textit{C}}^{{(i)}}\!\big ({\textit{u}^{{(i)}}_1,\textit{v}^{{(i)}}_2}\big )\) is the shortest path from \(\textit{u}^{{(i)}}_1\) to \(\textit{e}^{{(i)}}_1\), the path from \(\textit{r}^{{(i)}}_{1,1}\) to \(\textit{r}^{{(i)}}_{1,2}\) (or \(\textit{p}^{{(i)}}_1\)) on \(\textit{e}^{{(i)}}_1\), followed by the shortest path from \(\textit{e}^{{(i)}}_1\) to \(\textit{e}^{{(i)}}_2\), the path from \(\textit{r}^{{(i)}}_{2,1}\) (or \(\textit{p}^{{(i)}}_1\)) to \(\textit{v}^{{(i)}}_2\); see Fig. 13c, d. As previously noticed, the length of the subpath of \(\bar{\textit{C}}^{{(i)}}\!\big ({\textit{u}^{{(i)}}_1,\textit{v}^{{(i)}}_2}\big )\) from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_{1}\) is upper bounded by the length of the two catheti connecting \(\textit{u}^{{(i)}}_1\) with \(\textit{v}^{{(i)}}_{1}\), one being parallel to \(\textit{e}^{{(i)}}_1\) and the other orthogonal to \(\textit{e}^{{(i)}}_1\). Similarly, the length of the subpath of \(\textit{C}^{{(i)}}\) from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_{1}\) is lower bounded by the length of the line segment from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_{1}\) forming the hypotenuse of a right angled triangle with \(\textit{u}^{{(i)}}_1\) and \(\textit{v}^{{(i)}}_{1}\) as two corners. From elementary geometry it follows that the sum of the lengths of the catheti is bounded by \(\sqrt{2}\) times the length of the hypotenuse in a right angled triangle. Thus, the length of the subpath of \(\bar{\textit{C}}^{{(i)}}\!\big ({\textit{u}^{{(i)}}_1,\textit{v}^{{(i)}}_2}\big )\) from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_{1}\) is at most \(\sqrt{2}\) times the length of the subpath of \(\textit{C}^{{(i)}}\) from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_{1}\). The same argument ensures that the length of the subpath of \(\bar{\textit{C}}^{{(i)}}\!\big ({\textit{u}^{{(i)}}_1,\textit{v}^{{(i)}}_2}\big )\) from \(\textit{v}^{{(i)}}_{1}\) to \(\textit{v}^{{(i)}}_2\) is also at most \(\sqrt{2}\) times the length of the subpath of \(\textit{C}^{{(i)}}\) from \(\textit{v}^{{(i)}}_{1}\) to \(\textit{v}^{{(i)}}_2\), since the angle \(\alpha ^{{(i)}}_{1}\) is obtuse or a right angle.

    • If \(\alpha ^{{(i)}}_{1}\) is acute, consider the segment \(\textit{s}{\mathop {=}\limits ^{\text {def}}}[\textit{q}_1,\textit{p}^{{(i)}}_1]\) allowed to pass through the boundary of P, if \(\textit{e}^{{(i)}}_1\) and \(\textit{e}^{{(i)}}_2\) do not intersect. Let \(\textit{l}\) be the line orthogonal to \(\textit{s}\) passing through \(\textit{p}^{{(i)}}_1\). We slide \(\textit{l}\) along the segment \(\textit{s}\) from \(\textit{p}^{{(i)}}_1\) towards \(\textit{q}_1\) until \(\textit{l}\) touches a point of \(\textit{C}^{{(i)}}\) between \(\textit{v}^{{(i)}}_{1}\) and \(\textit{v}^{{(i)}}_2\) inclusive, giving the line \(\textit{l}^{*}\). In fact, this intersection point is one of \(\textit{v}^{{(i)}}_{1}\) or \(\textit{v}^{{(i)}}_2\). Let \(\textit{r}^{{(i)}}_{1,2}\) be the intersection point of \(\textit{SP}(\textit{e}^{{(i)}}_1\!,\textit{l}^{*})\) on \(\textit{e}^{{(i)}}_1\) and \(\textit{r}^{{(i)}}_{1,*}\) the intersection point of \(\textit{SP}(\textit{e}^{{(i)}}_1\!,\textit{l}^{*})\) on \(\textit{l}^{*}\). Similarly, let \(\textit{r}^{{(i)}}_{2,1}\) be the intersection point of \(\textit{SP}(\textit{e}^{{(i)}}_2\!,\textit{l}^{*})\) on \(\textit{e}^{{(i)}}_2\) and \(\textit{r}^{{(i)}}_{2,*}\) the intersection point of \(\textit{SP}(\textit{e}^{{(i)}}_2\!,\textit{l}^{*})\) on \(\textit{l}^{*}\). As before, \(\textit{r}^{{(i)}}_{1,1}\) is the intersection point of \(\textit{SP}(\textit{u}^{{(i)}}_1\!,\textit{e}^{{(i)}}_1)\) with \(\textit{e}^{{(i)}}_1\). Now, \(\bar{\textit{C}}^{{(i)}}\!\big ({\textit{u}^{{(i)}}_1,\textit{v}^{{(i)}}_2}\big )\) is the shortest path from \(\textit{u}^{{(i)}}_1\) to \(\textit{e}^{{(i)}}_1\), the path from \(\textit{r}^{{(i)}}_{1,1}\) to \(\textit{r}^{{(i)}}_{1,2}\), followed by the shortest path from \(\textit{e}^{{(i)}}_1\) to \(\textit{l}^{*}\) at \(\textit{r}^{{(i)}}_{1,*}\), the path from \(\textit{r}^{{(i)}}_{1,*}\) to \(\textit{r}^{{(i)}}_{2,*}\) on \(\textit{l}^{*}\), the shortest path from \(\textit{l}^{*}\) to \(\textit{e}^{{(i)}}_2\) ending at \(\textit{r}^{{(i)}}_{2,1}\), followed by the path from \(\textit{r}^{{(i)}}_{2,1}\) to \(\textit{v}^{{(i)}}_2\); see Fig. 13e. Since \(\alpha ^{{(i)}}_{1}\) is acute, the interior angles between \(\textit{e}^{{(i)}}_1\) and \(\textit{l}^{*}\) and between \(\textit{e}^{{(i)}}_2\) and \(\textit{l}^{*}\) are both obtuse or right angles. Hence, the lengths of the subpaths of \(\bar{\textit{C}}^{{(i)}}\) from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_{1}\) and from \(\textit{v}^{{(i)}}_{1}\) to \(\textit{v}^{{(i)}}_2\) are upper bounded by the lengths of the corresponding catheti of the right angled triangles, one connecting \(\textit{u}^{{(i)}}_1\) and \(\textit{v}^{{(i)}}_{1}\), with one catheter being parallel to \(\textit{e}^{{(i)}}_1\), and one connecting \(\textit{v}^{{(i)}}_{1}\) to \(\textit{v}^{{(i)}}_2\), with one catheter parallel to \(\textit{l}^{*}\). As before, the length of this subpath of \(\bar{\textit{C}}^{{(i)}}\!\big ({\textit{u}^{{(i)}}_1,\textit{v}^{{(i)}}_2}\big )\) is at most \(\sqrt{2}\) times the length of the subpath of \(\textit{C}^{{(i)}}\) from \(\textit{u}^{{(i)}}_1\) to \(\textit{v}^{{(i)}}_2\).

    Thus, we have proved Inequality (11) for both cases.

  • \(\textit{W}'_{1}\) has no reflex chain or one reflex chain with at most one end point in \({\textbf {P}}\setminus {\textbf {L}}(\textit{e}_1)\) If there is a point of \(\textit{T}_2\) at distance at most R from \(\textit{q}_1\), then there exists a tour having the bounding properties as defined above and we can bound the length of \(\textit{W}'_{1}\) in exactly the same way as in the previous case. Hence, from now on, we assume that all points of \(\textit{T}_2\) have distance greater than R from \(\textit{q}_1\). Since each tentacle of \(\mathcal {J}^{{\tiny \mathsf 2}}_{\textit{e}_1}\) has length at most R, every point of the tour \(\textit{W}'_{1}\) has distance at most R to \(\textit{q}_1\) and each tentacle is perpendicular to the tentacle cut which in turn intersects \(\textit{T}_2\), except where \(\textit{W}'_{1}\) has a reflex chain. Let \({\textbf {D}}_{1}\) be the possible set of points that can be points of \(\textit{W}'_{1}\), given \(\textit{T}_2\) but for any possible set of tentacle cuts. Thus, \(\textit{W}'_{1}\) is contained in \({\textbf {D}}_{1}\). The perimeter of \({\textbf {D}}_{1}\) consists of connected circular arcs with possible line segments in between. If \(\textit{W}'_{1}\) has a reflex chain, the perimeter alternates between circular arcs centered at \(\textit{q}_1\) and straight line segments connecting those reflex boundary vertices where \(\textit{W}'_{1}\) also has reflex vertices. Any other polygon boundary part intersecting the interior of the region is disregarded as we want to obtain the maximum possible perimeter length in relation to R, given that \(\textit{W}'_{1}\) has at most one reflex chain. \({\textbf {D}}_{1}\) is the region painted light green in Fig. 14a. Since \(\textit{W}'_{1}\) passes \(\textit{q}_1\) and the remaining perimeter of \({\textbf {D}}_{1}\) is convex (except where \(\textit{W}'_{1}\) follows the reflex chain), it follows that \(\Vert \hspace{-0.08em}\textit{W}'_{1}\hspace{-0.08em}\Vert \le \sup \Vert \hspace{-0.08em}\partial {\textbf {D}}_{1}\hspace{-0.08em}\Vert \) over the set of all possible tentacle cuts. We bound the length of the perimeter of \({\textbf {D}}_{1}\) as follows. Consider the smallest angle cone \(\angle \textit{T}_2\) with apex \(\textit{q}_1\) that contains \(\textit{T}_2\). Let \(\textit{t}_1\) and \(\textit{t}_2\) be two points of \(\textit{T}_2\) that touch the sides of this cone; see Fig. 14a. We assume a coordinate system where \(\textit{q}_1\) is at the origin, \(\textit{t}_1\) is at distance \(R+y_1\), with \(y_1>0\), directly above \(\textit{q}_1\) and \(\textit{t}_2\) lies in the first quadrant in this coordinate system at distance \(R+y_2\), with \(y_2>0\), from \(\textit{q}_1\). We can also assume that any reflex chain of \(\textit{W}'_{1}\) lies in the first quadrant in the coordinate system. If the reflex chain has points in the fourth quadrant, the length of \({\textbf {D}}_{1}\) can never attain its maximum possible ratio to R since all tentacle cuts then lie in quadrants three and four and have positive slope. Thus, all tentacles of \(\mathcal {J}^{{\tiny \mathsf 2}}_{\textit{e}_1}\) lie in the fourth quadrant and \(\Vert \hspace{-0.08em}\textit{W}'_{1}\hspace{-0.08em}\Vert \le \sup \Vert \hspace{-0.08em}\partial {\textbf {D}}_{1}\hspace{-0.08em}\Vert \le (\pi /2+2)R\) in this case, which is not maximal as we shall see below. Denote the part of \({\textbf {D}}_{1}\) in the fourth quadrant (to the left of \(\angle \textit{T}_2\)) by \({\textbf {D}}^{\tiny \mathsf L}_{1}\). We can bound the length of the two circular arcs that form part of the perimeter of \({\textbf {D}}^{\tiny \mathsf L}_{1}\) by

    $$\begin{aligned} \Vert \hspace{-0.08em}\partial {\textbf {D}}^{\tiny \mathsf L}_{1}\hspace{-0.08em}\Vert = \pi R/2 - \alpha _1 R/2 + \alpha _1(R+y_1) = (\pi +\alpha _1)R/2 + \alpha _1\cdot y_1, \end{aligned}$$
    (12)

    where \(\alpha _1=2\arcsin \big (R\big /(2R+2y_1)\big )\); see Fig. 14c. If we denote the part of \({\textbf {D}}_{1}\) inside the cone \(\angle \textit{T}_2\) by \({\textbf {D}}^{\tiny \mathsf C}_{1}\), the light green region in the cone \(\angle \textit{T}_2\) in Fig. 14a, we can bound the length of the circular arc perimeter of \({\textbf {D}}^{\tiny \mathsf C}_{1}\) by \(\Vert \hspace{-0.08em}\partial {\textbf {D}}^{\tiny \mathsf C}_{1}\hspace{-0.08em}\Vert \le R\cdot \beta \), where \(\Vert \hspace{-0.08em}[\textit{t}_1,\textit{t}_2]\hspace{-0.08em}\Vert ^2 = (R+y_1)^2 + (R+y_2)^2 -2(R+y_1)(R+y_2)\cos \beta \) and \(\beta \) is the angle of the cone \(\angle \textit{T}_2\), by the cosine theorem; see Fig. 14a. Again, we can assume that any reflex chain of \(\textit{W}'_{1}\) does not intersect the cone \(\angle \textit{T}_2\) and therefore also not inside \({\textbf {D}}^{\tiny \mathsf C}_{1}\), otherwise the length of the perimeter of \({\textbf {D}}_{1}\) can never attain its maximum possible ratio to R since this would give a coarse bound of \(\Vert \hspace{-0.08em}\textit{W}'_{1}\hspace{-0.08em}\Vert \le \sup \Vert \hspace{-0.08em}\partial {\textbf {D}}_{1}\hspace{-0.08em}\Vert \le (\pi +2)R\) in this case, which again is not maximal. If the remaining part of \({\textbf {D}}_{1}\) intersects the single reflex chain of \(\textit{W}'_{1}\), the length of the sequence of alternating circle arcs and line segments is bounded be the length of two line segments along two radii from \(\textit{q}_1\) of length R and \(\textit{t}_2\) of length \(R+y_2\), from their intersection point to their respective ends at \(\textit{p}_1\) and \(\textit{p}_2\); see Fig. 14a, b. We denote these segments by \(s_1\) and \(s_2\) as in Fig. 14b. Denote the angle between \(s_1\) and \(s_2\) by \(\gamma \). Let \(\textit{p}_3\) be the intersection point of the two circular arcs with center at \(\textit{q}_1\) and length R and center at \(\textit{t}_2\) and length \(R+y_2\) having positive x-coordinate in our coordinate system and let \(l_1\) and \(l_2\) be the subarcs of these two circular arcs from \(\textit{p}_3\) to \(\textit{p}_1\) and \(\textit{p}_2\), respectively; see Fig. 14b. Let the radius \([\textit{q}_1,\textit{p}_1]\) have angle \(\theta _1\) to the radius \([\textit{q}_1,\textit{p}_3]\) and let the radius \([\textit{t}_2,\textit{p}_2]\) have angle \(\theta _2\) to the radius \([\textit{t}_2,\textit{p}_3]\). Thus, \(\gamma =\pi /2-\alpha _2/2+\theta _1+\theta _2\). Let \(s'_1\) be the subsegment of \(s_1\) outside the triangle \(\bigtriangleup \textit{q}_1,\textit{t}_2,\textit{p}_3\) and let \(s'_2\) be the subsegment of \(s_2\) outside \(\bigtriangleup \textit{q}_1,\textit{t}_2,\textit{p}_3\). The angle of the triangle at \(\textit{p}_3\) is \(\pi /2-\alpha _2/2\le \gamma \) so \(\Vert \hspace{-0.08em}s_1\hspace{-0.08em}\Vert -\Vert \hspace{-0.08em}s'_1\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}s_2\hspace{-0.08em}\Vert -\Vert \hspace{-0.08em}s'_2\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}l_1\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}s'_1\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}l_2\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}s'_2\hspace{-0.08em}\Vert \) giving \(\Vert \hspace{-0.08em}s_1\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}s_2\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}l_1\hspace{-0.08em}\Vert +2\Vert \hspace{-0.08em}s'_1\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}l_2\hspace{-0.08em}\Vert +2\Vert \hspace{-0.08em}s'_2\hspace{-0.08em}\Vert \). Let the two circle arcs symmetric to \({\textbf {D}}^{\tiny \mathsf L}_{1}\) in the first quadrant, to the right of \(\angle \textit{T}_2\) bound the region \({\textbf {D}}^{\tiny \mathsf R}_{1}\) and we have

    $$\begin{aligned} \Vert \hspace{-0.08em}\partial {\textbf {D}}^{\tiny \mathsf R}_{1}\hspace{-0.08em}\Vert = (\pi +\alpha _2)R/2 + \alpha _2\cdot y_2, \end{aligned}$$
    (13)

    where \(\alpha _2=2\arcsin \big (R\big /(2R+2y_2)\big )\); see Fig. 14a, c. Define \({\textbf {D}}^{\tiny \mathsf X}_{1}\) to be the union of \({\textbf {D}}^{\tiny \mathsf L}_{1}\), \({\textbf {D}}^{\tiny \mathsf C}_{1}\), and \({\textbf {D}}^{\tiny \mathsf R}_{1}\), i.e., the locus \({\textbf {D}}_{1}\) when\(\textit{W}'_{1}\) does not have a reflex chain in the interior of \({\textbf {D}}_{1}\); see Fig. 14c. Since \(\Vert \hspace{-0.08em}s_1\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}s_2\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}l_1\hspace{-0.08em}\Vert +2\Vert \hspace{-0.08em}s'_1\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}l_2\hspace{-0.08em}\Vert +2\Vert \hspace{-0.08em}s'_2\hspace{-0.08em}\Vert \), we have that

    $$\begin{aligned} \Vert \hspace{-0.08em}\partial {\textbf {D}}_{1}\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\partial {\textbf {D}}^{\tiny \mathsf X}_{1}\hspace{-0.08em}\Vert +2\Vert \hspace{-0.08em}s'_1\hspace{-0.08em}\Vert +2\Vert \hspace{-0.08em}s'_2\hspace{-0.08em}\Vert \end{aligned}$$
    (14)

    and we bound the length of these three parts separately. To maximize the length of the perimeter of \({\textbf {D}}^{\tiny \mathsf X}_{1}\) we observe that the angle \(\beta \) is as large as possible when the segment \([\textit{t}_1,\textit{t}_2]\) is as large as possible and the values \(y_1\) and \(y_2\) are as small as possible. The length of \([\textit{t}_1,\textit{t}_2]\) is bounded above by R and \(y_1\) and \(y_2\) are minimal if the segment \([\textit{t}_1,\textit{t}_2]\) is almost tangent to the circle of radius R centered at \(\textit{q}_1\). With this setup we can write the length of the perimeter of \({\textbf {D}}^{\tiny \mathsf X}_{1}\) as a function of \(y_1\), where \(0\le y_1\le (\sqrt{2}-1)R\), and using standard variational calculus we obtain that

    $$\begin{aligned} \sup _{0\le y_1\le (\sqrt{2}-1)R}\!\!\!\!\!\!\!\!\Vert \hspace{-0.08em}\partial {\textbf {D}}^{\tiny \mathsf X}_{1}(y_1)\hspace{-0.08em}\Vert < \left( \pi +2\sqrt{5}\arcsin \frac{1}{\sqrt{5}}\right) R, \end{aligned}$$
    (15)

    which occurs when \(y_1=y_2=(\sqrt{5}/2-1)R\). To maximize the lengths of \(s'_1\) and \(s'_2\), we realize that they are the longest when the radius \([\textit{q}_1,\textit{p}_1]\) intersects the segment \([\textit{t}_2,\textit{p}_3]\) perpendicularly and when the radius \([\textit{t}_2,\textit{p}_2]\) intersects the segment \([\textit{q}_1,\textit{p}_3]\) perpendicularly, i.e., when \(\theta _1=\theta _2=\alpha _2/2\). Hence, the two segments are the longest when \(\alpha _2\) is as large as possible, which occurs when the triangle \(\bigtriangleup \textit{q}_1,\textit{t}_2,\textit{p}_3\) is equilateral, whereby

    $$\begin{aligned} \sup _{0\le \alpha _2\le \pi /6}\!\!\!\!\Vert \hspace{-0.08em}s'_1\hspace{-0.08em}\Vert =\!\!\!\!\sup _{0\le \alpha _2\le \pi /6}\!\!\!\!\Vert \hspace{-0.08em}s'_2\hspace{-0.08em}\Vert = (1-\sqrt{3}/2)R. \end{aligned}$$
    (16)

    This gives us a final bound of

    $$\begin{aligned} \Vert \hspace{-0.08em}\textit{W}'_{1}\hspace{-0.08em}\Vert&< \left( \pi +4-2\sqrt{3}+2\sqrt{5}\arcsin 1/\sqrt{5}\right) R \nonumber \\&= \left( \pi /2+2-\sqrt{3}+\sqrt{5}\arcsin 1/\sqrt{5}\right) \Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}. \end{aligned}$$
    (17)
Fig. 14
figure 14

Illustrating the proof of Lemma 5.3. Bounding the length of \(\textit{W}'_{1}\) when it has at most one reflex chain with at most one end point in \({\textbf {P}}\setminus {\textbf {L}}(\textit{e}_1)\) and the distance from \(\textit{T}_2\) to \(\textit{q}_1\) is greater than R. a \({\textbf {D}}_{1}\) in green is the locus of possible points for \(\textit{W}'_{1}\). b The worst case placement of \(\textit{T}_2\) relative to \({\textbf {D}}_{1}\) maximizing its boundary length. c Partitioning \({\textbf {D}}_{1}\) into \({\textbf {D}}^{\tiny \mathsf L}_{1}\), \({\textbf {D}}^{\tiny \mathsf C}_{1}\), and \({\textbf {D}}^{\tiny \mathsf R}_{1}\). d Detail of \({\textbf {D}}^{\tiny \mathsf R}_{1}\) indicating the subsegments \(s'_1\) and \(s'_2\) outside the triangle \(\bigtriangleup \textit{q}_1,\textit{t}_2,\textit{p}_3\) (Color figure online)

We have from the two cases above, Inequalities (11) and (17), that

$$\begin{aligned} \!\!\!\!\Vert \hspace{-0.08em}\textit{W}'_{1}\hspace{-0.08em}\Vert&\le \max \left\{ \begin{array}{l} 2\sqrt{2}R+\sqrt{2}\Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert = 2\sqrt{2}\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}} \approx 2.8284\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}, \\ \!\!\left( \pi /2+2-\sqrt{3}+\sqrt{5}\arcsin 1/\sqrt{5}\right) \Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}} \approx 2.8754\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}. \end{array} \right. \end{aligned}$$
(18)

The larger of the two values is our bound for the length of \(\textit{W}'_{1}\). \(\square \)

We note that we have made a slight overestimation when bounding the length of the perimeter of \({\textbf {D}}_{1}\) as we are maximizing the length of the perimeter of \({\textbf {D}}^{\tiny \mathsf X}_{1}\) and the lengths of \(s'_1\) and \(s'_2\) separately; see Inequalities (15) and (16). Some numerical experimentation indicates that our overestimation only affects the approximation bound in the second decimal, leading us to not pursue any improvement further.

5.3 Complexity Analysis of the Algorithm

The complexity analysis of the algorithm is straightforward. The for-loop in Step 5 considers \(O(n^2)\) pairs of extensions. Computing the tentacles and bases in Step 5.1 takes \(O(n^6)\) time as established in Section 5.1. The work in Step 5.2 takes \(O(n\log n)\) time since it is dominated by sorting the tentacles by length. Step 5.3 requires linear time using the algorithm by Toussaint [35] and the test in Step 5.4 takes constant time. Hence, the total time complexity for the algorithm is \(O(n^{8})\). The running time analysis together with Lemma 5.1 give us our main result.

Theorem 1

The Two-Watchman-Route algorithm computes a 5.969-approximation of the minmax two-watchman route and a 11.939-approximation of the minsum two-watchman route in \(O(n^8)\) time.

6 A Trade-off Between Computation Time and Accuracy

We can trade the approximation bound for computational efficiency by realizing that relaxing the computation as described in Sect. 5.1 still provides base positions \(\textit{q}_1\) and \(\textit{q}_2\) sufficiently close to their optimal positions on \(\textit{e}_1\) and \(\textit{e}_2\). To do this, we reduce the computation in Sect. 5.1 to only use the first two cases, taking \(O(n^2)\) time rather than \(O(n^6)\) time. Let \(\textit{q}_1\) be the base placement on \(\textit{e}_1\) using the reduced computation and let \(\textit{q}^{*}_1\) be its optimal placement on \(\textit{e}_1\). Let \(\textit{Z}_{\textit{q}_1}^{\textit{r}}\!(\textit{b})\) be a longest tentacle in the jellyfish \(\mathcal {J}^{\min }_{\textit{q}_1}\). Now, consider the tentacle \(\textit{Z}_{\textit{q}^{*}_1}^{\textit{r}^{*}}\!(\textit{b})\), taking into account that \(\textit{r}\) moves to \(\textit{r}^{*}\) on \(\textit{b}\) when the head moves from \(\textit{q}_1\) to \(\textit{q}^{*}_1\) on \(\textit{e}_1\). There must exist a boundary edge \(\textit{b}\)’ such that the tentacle \(\textit{Z}_{\textit{q}^{*}_1}^{\textit{r}'}\!(\textit{b}')\) intersects the line through \(\textit{q}_1\) orthogonal to \(\textit{e}_1\), otherwise \(\textit{q}_1\) would be closer to \(\textit{q}^{*}_1\); see Fig. 15. Hence, \(\Vert \hspace{-0.08em}\textit{q}_1^{},\textit{q}^{*}_1\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{Z}_{\textit{q}^{*}_1}^{\textit{r}'}\!(\textit{b}')\hspace{-0.08em}\Vert \) and we have

$$\begin{aligned} \Vert \hspace{-0.08em}\textit{Z}_{\textit{q}_1}^{\textit{r}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{Z}_{\textit{q}_1}^{\textit{r}^{*}}\!(\textit{b})\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{Z}_{\textit{q}^{*}_1}^{\textit{r}^{*}}\!(\textit{b})\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}\textit{q}_1^{},\textit{q}^{*}_1\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{Z}_{\textit{q}^{*}_1}^{\textit{r}^{*}}\!(\textit{b})\hspace{-0.08em}\Vert +\Vert \hspace{-0.08em}\textit{Z}_{\textit{q}^{*}_1}^{\textit{r}'}\!(\textit{b}')\hspace{-0.08em}\Vert \le 2R, \end{aligned}$$
(19)

since R is the length of the longest tentacle in \(\mathcal {J}^{\min }_{\textit{e}_1}\). We can argue similarly for \(\mathcal {J}^{\min }_{\textit{q}_2}\) giving us the jellyfish pair \(\mathcal {J}^{\min }_{\textit{q}_1,\textit{q}_2}\) for which we can compute the reduced jellyfish pair and then the relative convex hulls.

Fig. 15
figure 15

Illustrating the trade-off between the optimal base placement and the approximate base placement

Using \(R'=2R\) in the proofs of Lemmas 5.15.2 and 5.3 instead of R, all the arguments hold, giving us a tour with an approximation ratio at worst twice that of Theorem 1. We state this as a corollary.

Corollary 2

The simplified Two-Watchman-Route algorithm computes a 11.939-approximation of the minmax two-watchman route and a 23.879-approximation of the minsum two-watchman route in \(O(n^4)\) time.

7 Computing the Fixed Two-Watchman Route

Since the heads \(\textit{q}_1\) and \(\textit{q}_2\) are given as input in this simpler case of the problem, it suffices to compute the Jellyfish pairs \(\mathcal {J}_{\textit{q}_1,\textit{q}_2}\) with \(\textit{q}_1\) and \(\textit{q}_2\) as heads which takes \(O(n^2)\) time as explained in Sect. 5.1 and since \(\textit{W}_{1}\) intersects \(\textit{T}_1\) and \(\textit{W}_{2}\) intersects \(\textit{T}_2\), the second case in the proof of Lemma 5.3 cannot occur, whereby the approximation bound for \(\textit{W}_{1}\) becomes

$$\begin{aligned}{} & {} \Vert \hspace{-0.08em}\textit{W}_{1}\hspace{-0.08em}\Vert \le \Vert \hspace{-0.08em}\textit{W}'_{1}\hspace{-0.08em}\Vert + 2R + \Vert \hspace{-0.08em}\textit{C}_1\hspace{-0.08em}\Vert \le 2\sqrt{2}R+\sqrt{2}\Vert \hspace{-0.08em}\textit{T}_2\hspace{-0.08em}\Vert + 2R + 4\pi R/3 \nonumber \\{} & {} = (2\sqrt{2}+1+2\pi /3)\Vert \hspace{-0.08em}(\textit{T}_1,\textit{T}_2)\hspace{-0.08em}\Vert _{{\tiny \mathsf max}}. \end{aligned}$$
(20)

However, we note that this tour does not necessarily pass through \(\textit{q}_1\), unless \(\textit{q}_1\) lies on the polygon boundary, hence we have to account for an extra reflex chain of length at most 2R to guarantee this. Making the same analysis for \(\textit{W}_{2}\), the approximation factor becomes \(2\sqrt{2}+2+2\pi /3\approx 6.922\) in this case. The time complexity is dominated by computing the jellyfish, giving us the following theorem.

Theorem 3

The algorithm computes a 6.922-approximation of the fixed minmax two-watchman route and a 13.845-approximation of the fixed minsum two-watchman route in \(O(n^2)\) time given two starting points for the two tours. If both starting points lie on the boundary, the approximation factors are 5.922 and 11.845, respectively.

8 Conclusions

We have shown a polynomial time algorithms for computing constant factor approximations for the minmax and minsum two-watchman route in a simple polygon.

Our algorithms rely heavily on the fact that for two tours it is sufficient to guarantee that the boundary is seen to ensure that the complete polygon is seen. This does not hold for three or more tours. Thus, our method for the two-watchman tours does not generalize to the problem for three or more watchmen. Solving these problems within a constant factor bound remains elusive.

Establishing the complexity for the minsum two-watchman route is still open although our algorithm provides a polynomial time 11.939-approximation.

The authors would like to thank Doc. Åse Jevinger and Prof. Paweł Żyliński for fruitful discussions that have improved the text immensely.