Self-approaching paths in simple polygons
Prosenjit Bose, Irina Kostitsyna, Stefan Langerman

TL;DR
This paper investigates the properties and characterization of shortest self-approaching paths within simple polygons, introduces methods to find such paths using advanced curves, and provides an algorithm to determine if a polygon is self-approaching.
Contribution
It offers a characterization of shortest self-approaching paths, demonstrates the complexity involving non-algebraic curves, and presents algorithms for path finding and polygon classification.
Findings
Shortest self-approaching paths can involve non-algebraic curves.
An algorithm exists to test if a polygon is self-approaching.
Methods are developed to find self-approaching paths using high-order involute curves.
Abstract
We study self-approaching paths that are contained in a simple polygon. A self-approaching path is a directed curve connecting two points such that the Euclidean distance between a point moving along the path and any future position does not increase, that is, for all points , , and that appear in that order along the curve, . We analyze the properties, and present a characterization of shortest self-approaching paths. In particular, we show that a shortest self-approaching path connecting two points inside a polygon can be forced to use a general class of non-algebraic curves. While this makes it difficult to design an exact algorithm, we show how to find a self-approaching path inside a polygon connecting two points under a model of computation which assumes that we can calculate involute curves of high order. Lastly, we provide an algorithm to test if a given…
Click any figure to enlarge with its caption.
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Figure 14Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Self-approaching paths in simple polygons††thanks: A shorter version of this paper is to be presented at the 33rd International Symposium on Computational Geometry [6].
Prosenjit Bose School of Computer Science, Carleton University, Ottawa, Canada, [email protected]
Irina Kostitsyna Computer Science Department, Université libre de Bruxelles (ULB), Brussels, Belgium, {irina.kostitsyna,stefan.langerman}@ulb.ac.be
Stefan Langerman33footnotemark: 3
Abstract
We study self-approaching paths that are contained in a simple polygon. A self-approaching path is a directed curve connecting two points such that the Euclidean distance between a point moving along the path and any future position does not increase, that is, for all points , , and that appear in that order along the curve, . We analyze the properties, and present a characterization of shortest self-approaching paths. In particular, we show that a shortest self-approaching path connecting two points inside a polygon can be forced to use a general class of non-algebraic curves. While this makes it difficult to design an exact algorithm, we show how to find a self-approaching path inside a polygon connecting two points under a model of computation which assumes that we can calculate involute curves of high order.
Lastly, we provide an algorithm to test if a given simple polygon is self-approaching, that is, if there exists a self-approaching path for any two points inside the polygon.
1 Introduction
The problem of finding an optimal obstacle-avoiding path in a polygonal domain is one of the fundamental problems of computational geometry. Often a desired path has to conform to certain constraints. For example, a path may be required to be monotone [3], curvature-constrained [10], have no more than links [17], etc. A natural requirement to consider is that a point moving along a desired path must always be getting closer to its destination. Such radially monotone paths appear, for example, in greedy geographic routing in network setting [11] and beacon routing in geometric setting [5]. A strengthening of a radially monotone path is a self-approaching path [13, 14, 1]: a point moving along a self-approaching path is always getting closer not only to its destination but also to all the points on the path ahead of it. There are several reasons to prefer self-approaching paths over radially monotone paths. First, unlike for a radially monotone path, any subpath of a self-approaching path is self-approaching. Therefore, if the destination is not known in advance and the desired path is required to be radially monotone, one will have to resort to using self-approaching paths. Second, the length of a radially monotone path can be arbitrarily large in comparison with the Euclidean distance between the source and the destination points, whereas self-approaching paths have a bounded detour [14].
In this paper we study self-approaching paths that are contained in a simple polygon. We consider the following questions:
- •
Given two points and inside a simple polygon , does there exist a self-approaching - path inside ?
- •
Find the shortest self-approaching - path.
- •
Given a point in a simple polygon , what is the set of all points reachable from with self-approaching paths?
- •
Given a point , what is the set of all points from which is reachable with a self-approaching path?
- •
Given a polygon , test if it is self-approaching, i.e., if there exists a self-approaching path between any two points in .
Related work.
Self-approaching curves were first introduced in the context of online searching for a kernel of a polygon [13]. They were further studied in [14], where among other results, the authors prove that the length of any self-approaching path connecting two points is not greater than times the Euclidean distance between the points. An equivalent definition of a self-approaching path is that for every point on the path there has to be a angle containing the rest of the path. Aichholzer et al. [1] developed a generalization of self-approaching paths for an arbitrarily fixed angle instead of . A relevant type of paths is the increasing chords paths [19], which are self-approaching in both directions. The nice properties of self-approaching and increasing chords paths and their potential to be applied in network routing were recognized by the graph drawing community. As a result, a number of papers appeared in the recent years on self-approaching and increasing chords graphs [2, 9, 18].
This paper is organized in the following way. We introduce a few definitions and concepts in Section 2. In Section 3, we characterize a shortest self-approaching path between two points in a simple polygon. In Section 4 we present an algorithm to construct the shortest self-approaching path between two points if it exists, or to report that it does not exist, by assuming a model of computation in which we can solve certain transcendental equations. Finally, in Section 5 we present a linear-time algorithm to decide if a polygon is self-approaching, that is, if there is a self-approaching path between any two point of the polygon. In Section 6, we discuss some properties of reachable and reverse-reachable regions.
2 Preliminaries
For two points and on a directed path that starts in point , we shall say that if lies between and along . For a directed path and two points on it, denote the sub-path from to by .
Definition 1**.**
A self-approaching path in a continuous domain is a piece-wise smooth111Some previous works do not require the curve to be smooth. However in this paper we will be mostly considering shortest self-approaching paths, and thus the requirement on smoothness is justified. oriented curve such that for any three points , , and on it, such that : , where and are Euclidean distances.
Icking et al. [14] showed the following normal property of a self-approaching path, that we will be using extensively in this paper,
Lemma 1** (the normal property [14]).**
An - path is self-approaching if and only if any normal to at any point does not cross .
Definition 2**.**
A normal to a directed curve at some point defines two half-planes. Let the positive half-plane be the open half-plane which is congruent with the direction of at point .
We can rephrase the normal property in the following way.
Lemma 2** (the half-plane property).**
An - path is self-approaching if and only if, for any normal to at any point , the subpath lies completely in the positive half-plane .
Definition 3**.**
A bend of a self-approaching path is a point of discontinuity of the first derivative of .
Definition 4**.**
A reachable region , for a given point in a polygon , is the set of all points for which there exists a self-approaching - path .
Definition 5**.**
A reverse-reachable region , for a given point in a polygon , is a set of all points for which there exists a self-approaching - path .
2.1 Involutes
Next we introduce involute curves of th order that will appear later as parts of shortest self-approaching paths.
An involute of a convex curve is a curve traced by an end point of an unwinding pull-taut string rolled on . Consider a parameterization of the curve, and let be oriented in the direction of growth of the parameter . The involute of can be computed by the following formula:
[TABLE]
where is the length of the tangent segment ,
[TABLE]
The constant defines the point at which the involute will start unwinding around (see Figure 1). The involute has two branches: the positive branch has the tangent point moving in the positive direction of , and the negative branch has the tangent point moving in the negative direction of . If the curve is defined on the interval , then the positive branch of its involute is defined on the interval , and the negative—on the interval .
We define an involute of order of a curve to be an involute of one branch (that contains the point corresponding to parameter ) of an involute of order of , with an involute of order [math] being the curve itself,
[TABLE]
In the following sections we will show that shortest self-approaching paths consist of straight-line segments, circular arcs, and involutes of circular arcs of some order. Next we will derive a formula for an involute of a circle of order .
Consider a circular arc that is given by formula
[TABLE]
and is defined for angles in the range .
Involute of order .
Let be the involute of that passes through some point with polar coordinates .
[TABLE]
Denote the parameter value at which passes through as . Then from the following system of equations
[TABLE]
it follows that
[TABLE]
This system has a closed form solution for and :
[TABLE]
Depending on whether the value of in a given solution falls into the range , the involute can have two branches, one branch, or be undefined.
Let the tangent line drawn from touch at point . By definition of an involute, point coincides with . Then the length of a tangent segment from to is exactly the coefficient at the last term of evaluated at parameter :
[TABLE]
Involute of order .
Next, for a selected branch of , we compute an involute of the second order that passes through some point :
[TABLE]
where
[TABLE]
and subsequently,
[TABLE]
These equations can no longer be solved analytically. In this case one has to resort to iterative methods to obtain an approximate solution. Similarly to the previous case, the involute , if defined, can have one or two branches.
Let the tangent line drawn from touch at point . Then,
[TABLE]
Involute of order .
Continuing previous calculations in a similar matter we can obtain the following formulas for involutes of order and :
[TABLE]
or shorter,
[TABLE]
where
[TABLE]
Given a point for each involute of order (for all ), the constants can be found from the following equations:
[TABLE]
And the length of a tangent segment is:
[TABLE]
3 Properties of a shortest self-approaching path
In this section we will prove the following properties of a shortest self-approaching path from to inside a simple polygon :
- •
A shortest self-approaching path is unique.
- •
The shortest self-approaching path consists of straight segments, circular arcs and involutes to the latter pieces of the path.
We begin with proving several lemmas:
Lemma 3**.**
For any two points on a self-approaching - path in , the perpendicular bisector of straight-line segment does not intersect sub-path .
Proof.
Let be the half-plane defined by the perpendicular bisector of segment that contains . Assume there is a point on the subpath that is interior to (refer to Figure 4). Then , which contradicts the definition of a self-approaching path. ∎
Lemma 4**.**
Bends of a shortest self-approaching path in a simple polygon form a subset of vertices of .
Proof.
Suppose a shortest self-approaching - path bends at some point interior to polygon . Then consider an -neighborhood of for some small such that it is interior to , and only contains one connected component of path . Let and be two perpendiculars to at point . Let be a bisector of an angle formed by and (as in Figure 4). Then, construct a segment , perpendicular to , such that point , point , and two lines parallel to that pass through and intersect and inside the -neighborhood of . By the half-plane property, the subpath lies completely inside the intersection of two positive half-planes . And, because the -neighborhood of contains only one connected component of , none of the normal lines to intersects . Therefore, is self-approaching and is shorter than . ∎
Thus, any point of a shortest self-approaching - path which is interior to has a well-defined tangent. This point is an inflection point, if its tangent separates the self-approaching path in a small enough -neighborhood. We can also introduce a notion of an inflection segment for a path that contains a straight-line segment as a sub-path. A straight-line segment of a smooth path is an inflection segment if its supporting line separates the path in a small enough -neighborhood around the segment (refer to Figure 5).
Lemma 5**.**
A shortest self-approaching - path in a simple polygon cannot have an inflection point (or an inflection segment) that is interior to .
Proof.
Suppose a shortest self-approaching - path has an inflection point (or an inflection segment ) interior to polygon . Consider an -neighborhood of (or ) for some small such that it is interior to polygon , and it does not contain other inflection points. Choose a point on subpath close to and draw a tangent through it to a subpath of contained in the -neighborhood (refer to Figure 5). Let be the tangent point. We can always choose point to be such that segment lies inside the -neighborhood. Let be the normal line to drawn through . Because is self-approaching, the subpath lies in the positive half-plane . Therefore, none of the normal lines to segment intersects subpath . Thus, is self-approaching and is shorter than . ∎
Define the inflection points of a directed geodesic path from to as the first points of the inflection segments of , i.e., the set of last points in the maximal subchains of with the same direction of turn.
Lemma 6**.**
A shortest self-approaching path from to in a simple polygon contains all the inflection points of the geodesic path from to .
Proof.
Consider an inflection segment of the geodesic path from to , is one of its inflection points. Any shortest self-approaching path intersects . If the intersection point were not , then would contain an inflection point that is interior to , but this would contradict Lemma 5. ∎
Consider two self-approaching paths and from to in a simple polygon that do not have other points in common. Let be a geodesic path from to inside the area bounded by and . Then, the following lemma holds.
Lemma 7**.**
A geodesic path between two self-approaching paths and is also self-approaching.
Proof.
We use the fact that the geodesic lies inside of the convex hull of each side of the boundaries between which it is constrained, i.e., and .
Any point either lies on one of the paths and or on a straight line segment that is bitangent to the boundary (refer to Figure 6).
Consider the case when lies on or , and is not a bend point (as point in the figure). Let, without loss of generality, . The positive half-plane of the normal to at contains the rest of the path . Therefore it contains the convex hull of , and the subpath of the geodesic.
When lies on a path and is a bend point, the two normals to the path at define two positive half-planes whose intersection contains the rest of the path from to . The two normals to the geodesic path at this point will lie in between the to normals to the boundary path (as in the figure for point ). Thus, the intersection of the two positive half-planes of the normals to the geodesic contains the convex hull of the subpath from to , and, therefore, the rest of the geodesic path .
In the case when lies on a bitangent, consider its end point . The normal to at is parallel to the normal to at . By one of the cases considered above, the positive half-plane at (or the intersection of two positive half-planes) will contain , and, therefore, the positive half-plane of normal to at point will contain the subpath .
Thus, by the half-plane property, is self-approaching. ∎
As a corollary to this lemma, for two self-approaching paths from to , a path, composed of geodesics in the areas bounded by subpaths of the two paths between each pair of consecutive intersection points, is also self-approaching. In other words, let be all the intersection points of and in the order they appear on and . Observe, that the intersection points must appear in the same order along the both paths, otherwise there would exist three points on one of these paths for which the inequality in the definition of a self-approaching path would not be satisfied. Let be the geodesic from to in the area between two subpaths and . Then,
Lemma 8**.**
The concatenation of the geodesics is self-approaching.
Proof.
By a similar argument as in Lemma 7, for any normal to at point , its positive half-plane either contains the convex hull of , or it contains the convex hull of . In both cases, that implies that the subpath lies in the positive half-plane of the normal. Therefore, is self-approaching. ∎
The next theorem is a direct corollary of Lemma 8.
Theorem 9**.**
A shortest self-approaching - path is unique.
Figure 9 shows an example of a shortest self-approaching path inside a polygon. In the next theorem we give its characterization.
Theorem 10**.**
A shortest self-approaching - path in a simple polygon consists of straight segments, circular arcs and circle involutes of some order.
Proof.
Let be the points of the shortest self-approaching - path in the order from to , where it touches the boundary of the polygon . Consider the last segment . It is a straight-line segment. Otherwise it could be shortened in the following way. Consider the last segment of a geodesic path from to , and extend it in the direction from to until intersecting path ; denote the intersection point as . Then, can be shortened by replacing by the segment .
Now, suppose that all the segments consist of straight-line segments, circular arcs, or involutes of a circle of some order for all for some . We will show, that then, the segment consists of straight-line segments, circular arcs, and/or involutes.
Denote . Let, without loss of generality, touch the boundary of the polygon at point on its left side (refer to Figure 7). Then construct an involute of the convex hull starting at point with the tangent point moving in the clockwise direction around until the first intersection point of the involute with the boundary of the polygon . The area on the concave side of the involute that it cuts off of the polygon is a “dead” region for any self-approaching path that ends with the subpath (red area in the Figure 7). In other words, for any point , any path connecting to will have a normal that intersects , and therefore the subpath . To show that, consider any piecewise-smooth path from to . Parameterize for some parameter , where and . Consider the distance function from a point moving along to the involute . This function will be piecewise smooth as both of the paths are piecewise-smooth. As a point, moving along , has to eventually coincide with , there exists parameter at which the distance function is decreasing, and therefore, the angle between a tangent vector to at the point and a tangent from to the convex hull is greater than . Therefore, a positive half-plane of the normal to at point does not fully contain the convex hull , and therefore, the path is not self-approaching.
Now, consider a geodesic path from to in the region , and consider its last segment , where is the last point before that belongs to the boundary of . This segment can be a straight-line segment, or a straight-line segment followed by a piece of the involute , where is tangent to . If segment is not on , then, by a similar argument as above, we can show that can be shortened. Extend the segment beyond the point until the intersection with . Then, can be shortened if the subpath is replaced by the segment of the geodesic.
The boundary of the convex hull consists of straight-line segments and pieces of the subpath , which we assumed were straight segments, arcs, and circle involutes. Therefore, the segment of the geodesic path also consists of straight segments, circular arcs, and circle involutes, possibly, of one order higher than the following subpath. Therefore, the shortest self-approaching path consists of straight-line segments, circular arcs, and circle involutes of some order, that is not higher than the number of bends on the path. ∎
In the last proof, the point of the last segment of the geodesic path from to in does not necessarily belong to the geodesic path from to . Consider an example in Figure 8. In it, several vertices of the geodesic path are in the dead region (on the concave side of the involute). The tangent line from the last vertex ( in the left example, and in the right example) of before that is not in the dead region intersects the boundary of the polygon. Angle , where is the intersection point of with the involute, is an obtuse angle. This follows from the fact that the intersection angle between the straight-line segment and the tangent to the involute at the intersection point must not be greater than , otherwise the point would not lie in the positive half-plane of the normal to the involute at the intersection point. Then, the total turn angle of the self-approaching path from to is less than , and thus, the subpath consists of straight-line segments. Let the previous inflection point of before be , and the next inflection point of on or after be . It follows then that the subpath is geodesically convex, that is, the shortest path between any two points on lies completely on one (and the same side) of the path. We obtain the following lemma.
Lemma 11**.**
A shortest self-approaching - path in a simple polygon consists of geodesically convex paths between inflection points of the geodesic from to .
Theorem 12**.**
*A shortest self-approaching - path in a simple polygon with vertices consists of segments. There exists a simple polygon and two points and in it, such that the shortest self-approaching from to has segments. *
Proof.
To prove the upper bound, we will show that the number of segments on the convex hull of a shortest self-approaching path with bends is . Consider a bend of , and let the convex hull of subpath have segments. Let the previous bend before on be , and denote the subpath of from to as . The subpath consists of a straight segment, possibly, followed by several involute segments. Consider the evolute222If curve is an involute of curve , then is called the evolute of . curves of these involutes. Except for maybe the last segment of the chain, each involute segment covers the complete range of the values of parameter of its evolute segment. Thus, this evolute lies completely inside the convex hull of the subpath , and will no longer define other involutes. Notice, that this evolute can belong to the subpath itself, if it winds around the convex hull of multiple times. This fact does not change the size of the convex hull. Therefore, the convex hull of consists of no more than segments: the number of involute segments grows by at most , plus one new straight-line segment on , plus at most two straight-line segments of the common tangents to the convex hull of and the convex hull of . Setting the boundary condition , we conclude, that the number of segments on the convex hull of a shortest self-approaching path with bends is . The number of segments on a subpath of between two bends is bounded by the size of the convex hull of the following path times the winding number of . And because has at most bends, and it takes a constant number of vertices of to form a spiral for the path to wind around itself, its total size is .
Consider a construction of a shortest self-approaching path in Figure 9. It shows how to linearly grow the number of segments on each subpath between the consecutive pairs of bends. Moreover, it is possible to force each bend with only a constant (specifically, four) number of the polygon boundary vertices per bend. Thus, for any there exists a polygon of size and two points and in it, such that the shortest self-approaching path between the points has segments. ∎
4 Existence of a self-approaching path
In this section we consider the question of testing whether, for given points and in a polygon , they can be connected with a self-approaching path. In Theorem 10 we proved that a shortest self approaching path can consist of involutes of a circle of a high order, and in Section 2 we showed that such an involute is defined by a system of transcendental equations. In [16] Laczkovich proved a strengthening of Richardson’s theorem, which states that in general the statement is undecidable, where is an expression generated by the rational numbers, the variable , the operations of addition, multiplication, and composition, and the sine function. The Equations (1) that we need to solve to obtain formulas for the involutes are a special case of the class of expressions in Laczkovich’s theorem. Nevertheless, it strongly suggests that an involute of a circle of order higher than one cannot be computed.
Next, we show an algorithm to test whether there exists a self-approaching path connecting two points and , and if so, to compute the shortest path, under the assumption that we can solve Equations (1). Subsequently, it is possible to release this assumption, and modify the algorithm to build an approximate solution, given that the shortest self-approaching path from -to- exists and there is a corridor of size around it free of the polygon boundary points.
4.1 Shortest path algorithm
The proof of Theorem 10 is constructive. Let us assume that we can solve equations of the form as Equations (1) for an involute of order in time , and evaluate the formula of the involute of order for a given parameter in time . Then, we can decide if two points and can be connected by a self-approaching path, and we can construct the shortest path between the points. The outline of the algorithm:
- •
Starting at , move backwards along a geodesic - path . Maintain the convex hull of the final part of the shortest self-approaching path to the destination built so far.
- •
At every bend point :
- –
Calculate the appropriate branch of an involute of the convex hull . If intersects the opposite boundary of the polygon, thus, cutting off from , report that a self-approaching path from to does not exist and terminate the algorithm.
- –
Otherwise, find a geodesic path from the preceding inflection point of to in , and add its last segment as a prefix to .
- –
Update the convex hull . Repeat for the new bend point , until is reached. Report the found path .
To obtain an algorithm with an optimal running time, there are a few considerations to take into account when constructing the shortest path. First, instead of unnecessarily calculating the whole involute until the intersection point with the boundary of , and then discarding the part of it under the tangent line from , its segments can be calculated one by one as needed until the tangent point. Second, to optimally test if intersects the opposite boundary of the polygon, we can maintain a shortest path tree that will allow us to build funnels from the opposite sides of the polygon boundary. Third, it is not necessary to construct the whole geodesic to be able to compute its last segment . Instead, we can move backwards along , vertex by vertex, until we reach a point from which a tangent to can be computed (possibly with adding new points along it).
Let the edges of be oriented in the counter-clockwise order. We shall call the two ends of an edge , the front-point, and the end-point.
Next, we present the details of the algorithm.
Initialization step.
Compute a shortest path tree with the root [12], and preprocess it to answer the lowest common ancestor query [4]. Compute the geodesic from to , and store as a stack of vertices. Let the first and the last segments of be and respectively. Extend beyond until intersection with at some point , and extend beyond until intersection with at some point . This can be done in time with a ray-shooting query after linear-time preprocessing of the polygon [8]. Let be the chain of the boundary of from to in the counter-clockwise order, we shall call it the left chain. Similarly, let the right chain be the chain of the boundary of from to in the counter-clockwise order. Initialize and with the last segment of , and pop the point from .
The main loop.
Let, before the beginning of the current iteration of the loop, be the point on top of the stack . Let touch in point on its left side (the case when touches on its right side is equivalent). Let be the convex hull of the already built subpath .
Pop from the top of the stack . Consider the previous segment of (point is currently on top of the stack ).
Case 1. If the angle between and the tangent in the clockwise direction to at point form an angle that is not less than , then lies on the shortest self-approaching path from to ; append with in the front, and update the convex hull.
Case 2. If the angle between and the tangent in the clockwise direction to form an angle that is less than , we need to calculate the involute of the convex hull for the tangent point moving clockwise around the boundary of starting at . We first will determine until which point to calculate .
First, we check whether the points on the geodesic path before lie in the dead region defined by . To do that without explicitly constructing first, for each point on top of the stack , we construct a tangent line to which is leaving it on its right side (refer to Figure 10 (left)). Let be the tangent point on , and let for some involute segment on the boundary of the convex hull. Let intersect at point . We know that the length of the segment is equal to the length of the boundary of the convex hull from to . Thus, to check whether lies in the dead region we can compare the length of the segment with the length of the boundary of from to . If does lie in the dead region, we simply remove it from the top of the stack , and proceed. If at some moment becomes empty, i.e., the point lies in the dead region, we report that a self-approaching path from to does not exist and terminate the algorithm.
Now, let be the first point on before that does not lie in the dead region of . As in Figure 8, the tangent segment from to the involute may intersect the right chain of the boundary of . Moreover, the right chain of the boundary of may intersect . To test and account for that case, we do the following. Let be the tangent vector to at point . Run a ray shooting query from in the direction . Let it intersect an edge of , and denote its front-point as (refer to Figure 10 (right)). Then, find a vertex in the shortest path tree that is the lowest common ancestor of and . Let and be the two shortest paths from to and to respectively. Paths and form two convex chains. If does not intersect , then either a common tangent to and , or a common tangent to and , will belong to . To be able to compute the common tangents, we now explicitly construct segment by segment until a certain point. Let be the last segment of constructed so far (with the curve orientation from to ). We stop the construction of when the segment makes a left turn with respect to the tangent vector , where .
Whether intersects can be found during the computation of the common tangent. If it does, report that and cannot be connected with a self-approaching path and terminate the algorithm.
Let and be the two tangent points on and respectively of the common tangent lines with . One of the points and , or both, will be equal to .
- •
If , then append with , where is the tangent point on .
- •
If , then append with , where is the tangent point on of the common tangent with .
- •
If , then append with , where is the tangent point on of the common tangent with .
Remove the points from until is on top of the stack, and update . Iterate over the main loop until is empty, and return .
Computing common tangents.
During the execution of the algorithm, we need to be able to compute common tangents between a convex polygonal chain and a convex chain of involutes, and between two convex chains of involutes. It is possible to compute a common tangent of two non-intersecting simple polygons of size and in time [15]. We will use this as the first step in finding a common tangent to our chains.
Consider a convex polygonal chain of size and a convex chain of involutes of size , with points ordered in the counter-clockwise order. First, we will show how to compute an outer common tangent. Without loss of generality, we will show how to compute a tangent , where , , and and lie on the left of . Denote to be a polygonal chain connecting the end points of segments of in the consistent order. Let the convex hulls of and be disjoint. Build a common tangent between and in time (refer to Figure 11), where and . The common tangent between and does not necessarily go through the point , but it does touch one of the adjacent segment to the point . Let, without loss of generality, the common tangent touch the segment of . Then, using a binary search on the chain we can find a point which will belong to the common tangent. For that point , the ray intersects , and the ray does not. To test whether a line intersects a given involute, we can compute the tangent line to this involute parallel to , and check in which half-plane of the tangent point belongs to. Computing the tangent point is equivalent to evaluating the formula of the involute of for the parameter which corresponds to the direction perpendicular to . Thus, the tangent point can be found in time, where is the order of the involute. After that, we check if the ray intersects the involute by checking the turn angle of the segment of defining the ray, and the segment from its end point to the tangent point . Consider ray . If is making a right turn under , the ray intersects the involute segment . The last step is to calculate the tangent segment from to in time. Therefore, a common tangent to a polygonal chain and a chain of involutes can be constructed in time.
To compute an inner common tangent of a convex polygonal chain of size and a convex chain of involutes of size , we follow the same steps as in the case of the outer common tangent, except for the rays from the segments of which will be emanating in the opposite direction.
A small modification will allow us to construct a common tangent between two convex chains of involutes and . Start with computing a common tangent for the two polygonal chains and connecting the end points of segments of and respectively. Let touch and at points and . If does not intersect any of the four adjacent involute segments to and , then we have found the common tangent segment . If intersects two involute segments adjacent to and , then the common tangent line to and will touch these involute segments. Let, without loss of generality, intersect two involute segments and . The common tangent line to these two segments will define the parameter which, in its turn, will determine the tangent points and on the two involute segments. Note, that it follows that the orders of involutes of and must both be even, or must both be odd. The common tangent line can be found by solving one of the following equations (depending on the parity of the order of the involutes):
[TABLE]
This system of equations is similar to the one of Equations 1. We find the tangent segment in time, where is the maximum order of the two involutes. Finally, if intersects only one involute segment, we repeat similar steps to finding the tangent between the polygonal chain and the chain of involutes. Overall, it takes the same asymptotic running time to compute the tangent segment.
If the two chains and may be intersecting, we start with checking if and are intersecting in time [7]. Afterwards, during the binary search, for each point of considered, we check in time if the point is inside the involute. If no points inside the involute were found, and the binary search returned a candidate point , we check if segment intersects the involute (with both points and being outside). We do this again by finding the tangent point and checking which half-plane it lies in. Overall, for two chains and , we can test if they intersect, and if not, find the inner tangent segment, in time.
Maintaining .
At the end of each iteration of the main algorithm, we need to update the convex hull of the subpath of the shortest self-approaching path built so far. This can involve finding a tangent from a point to a chain of involutes, or finding a common tangent of two chains of involutes.
Moreover, we want to be able to optimally calculate the length of a boundary from the current point to some point . For that, associate two values and with each end point of a segment on that will contain the distance to (up to some constant that will be equal for all the points) along the boundary in the clockwise and counter-clockwise direction respectively. Moreover, for two points and on , the length of the boundary between them can be calculated by , if the chain of between and in the counter-clockwise order does not contain . This fact will allow us to maintain the values in the points unchanged when updating the convex hull.
At every iteration of the algorithm, the distance from some tangent point on an involute segment to in the clockwise direction can be computed by formula , where is the arc length of the involute from point to . Analogously, the distance from to in the counter-clockwise direction can be computed by taking .
When updating the convex hull after extending the path , we calculate the lengths of the tangent segments and the new involute arcs, and set the values and to the new points of relatively to the values of the points remaining on . This will take time to compute the arc length per segment of an involute of order .
Taking these considerations into account, we conclude with the following theorem:
Theorem 13**.**
The algorithm above constructs a shortest self-approaching path from to or reports that it does not exist in running time, where is the size of the output.
Proof.
At every iteration of the algorithm, new segments are added to , and thus, by Theorem 12, the algorithm will terminate.
First, we prove that the path that the algorithm produces is self-approaching. In Case 1, a straight-line segment is added to . A normal to any point not his segment does not intersect the convex hull of the future path, and thus does not intersect the future path itself. In Case 2, an involute segment and one or a number of straight-line segments are added to . Consider a point on the involute part. By construction, a normal to the involute at the point is tangent to the convex hull of the future path, and thus does not intersect it. The rest of the path added to is either a straight-line segment tangent to the involute, or a convex polygonal chain which is bending in the opposite direction as the involute segment and has the total turn angle not more than . In both cases, the normals to any point on these segments do not intersect the future path. Thus, if the algorithm outputs a path, it is self-approaching.
Moreover, by construction, the path does not have convex bends, and only has a positive curvature at on the boundaries of dead regions. In other words, the path is geodesic in . Any shorter path will intersect one of the dead regions, and thus will not be self-approaching.
The algorithm reports that a self-approaching path does not exist only in two cases: (1) if lies in a dead region; (2) if an involute to a convex hull separates from . In both cases, any path from to will have to cross some dead region, and thus cannot be self-approaching.
The running time of the initialization step of the algorithm is .
The bottleneck in the running time of one iteration of the algorithm for Case 1 is the time it takes to update the convex hull. In the case when only one segment is being added to , the update consists of computing two tangents from a point to the convex hull. This can be done in time, where is the order of the involute to which the range point belongs. After that, the values and are updated in constant time.
In Case 2, we spend time for each vertex of the geodesic path on the left polygonal boundary that lies in the dead region. One ray-shooting query takes time. Building an outer tangent between the chain from to and the involute takes time, where is the length of the chain, and the number of segments on the convex hull of the involute is bounded by the size of the convex hull . Note, that the length of the involute chain may be more than if it winds around the convex hull several times. However, we only need its outer layer to be able to construct the tangent line. Building an inner tangent between the chain from to and the involute, including testing for intersections, takes time, where is the length of the chain. Updating the convex hull includes, possibly, computing a tangent from a point to , or a common tangent between and a chain of involutes. This can take up to time. After that, the values and are updated in constant time per segment, that is in total in time. If is the size of the output, i.e., the number of segments of , and is about to maximize the value of , the total running time adds up to . ∎
5 Self-approaching polygon
A polygon is self-approaching, if for any two points there exists a self-approaching path connecting them.
Theorem 14**.**
Polygon is self-approaching if and only if for any disk centered at any point , the intersection has one connected component.
Proof.
Let polygon be self-approaching. We will show that for any disk centered at any point , the intersection has one connected component. Assume that there exist a point and a disk centered at such that intersection has more than one connected component. Then choose any point inside a connected component other than the one containing . Then any -to- path will cross the boundary of the disk, and therefore such path will not be self-approaching.
Let the intersection have one connected component for any disk centered at any point . We will show that for any two points and in there exists an - self-approaching path inside . Consider a disk centered at with radius . has one connected component, therefore a geodesic from to lies completely inside . We will show that is self-approaching. Suppose that is not self-approaching, then consider a segment of closest to such that a perpendicular to drawn through intersects subpath . Let be the next vertex of after , and let be a perpendicular to drawn through . Without loss of generality, let make a right turn (refer to Figure 12). By assumption is the last segment of such that intersects , therefore does not intersect , and therefore intersects to the right from . Consider segment on the boundary of polygon such that is facing . Then a strip between two perpendiculars to drawn through and intersects . Select any point on inside the strip. There exists a disk centered at that intersects the segment twice, and therefore has more than one connected component. Thus, a geodesic between any two points in is self-approaching. ∎
Recall, that a path is increasing chord if it is self-approaching in both directions.
Corollary 15**.**
Any self-approaching polygon is also increasing-chord.
Next, we present an algorithm to test whether a given simple polygon is self-approaching. Observe, that from the proof of Theorem 14 the following property holds: the polygon is self-approaching if and only if, for all edges on the boundary of directed in the counter-clockwise order, an area bounded between the two normals to at its two end points in the right half-plane of is free of . We call this area the half-strip of . We will use this property to test efficiently if the polygon is self-approaching.
Let be given as a set of points in the counter-clockwise order around the boundary. We will start at , move along the boundary in the counter-clockwise order and maintain the union of all the half-strips of the edges visited so far. More precisely, we will maintain the left and the right sides, and , of the hour-glass shape that is the union of the half-strips; and are convex polygonal chains (refer to Figure 13). Store the segments of and as two lists, the last segments in the lists are infinite rays.
At every iteration of the algorithm, perform the following steps. Let be the current point of the polygon . The chain contains the right side of the union of all the half-strips up to point . Consider the next boundary segment , and a perpendicular ray at the point (refer to Figure 13 (a)). To update the chain , do the following: Traverse , and for every its segment ,
- •
if intersects , then report that is not self-approaching and terminate;
- •
if intersects , calculate the intersection point , and replace the first elements of the list up to with two segments, and ; repeat for the next point .
Traverse the boundary of polygon twice in the counter-clockwise order, and then repeat the same algorithm traversing the boundary of twice in the clockwise order. If none of the segments intersected a segment of , report that is self-approaching.
Theorem 16**.**
Given a simple polygon with vertices, the presented algorithm tests in time if it is self-approaching.
Proof.
Consider the counter-clockwise traversal of the boundary of . There are two cases when the boundary segment intersects . In the first case, intersects , and does not intersect it (refer to Figure 13 (b)). Let us call it the intersection of type . In the second case, intersects after intersects it (refer to Figure 13 (c)). Let us call it the intersection of type . Moreover, the boundary segment may intersect (refer to Figure 13 (d)). Let us call it the intersection of type .
When traversing the polygon counter-clockwise, the presented algorithm will recognize the first type of the intersection, but not the second or third type. In case of the second type, during one iteration, the algorithm stops traversing after finding the intersection point of , and thus will not find the intersection of the segment with . And in case of the third type, the algorithm does not check for intersection with at all.
Nevertheless, we will prove, that by repeating the checks above twice and in two directions, counter-clockwise from to , and clockwise from to , the algorithm will correctly decide if the polygon is self-approaching or not.
Case 0. If the polygon is self-approaching, then none of the segments will intersect or . The algorithm will traverse the polygon twice, then twice in the clockwise direction, and report that it is self-approaching.
Case 1. If only the first intersection type occurs, then the algorithm will traverse the boundary of until the first violation of the half-strip property, correctly report that the polygon is not self-approaching, and terminate.
Case 2. Suppose that the second intersection type occurs. Consider the first segment , such that both and intersect . Let intersect the normal to some preceding segment at the point . As the ray intersects before does, it also intersects the polygon boundary between the points and . And, therefore, the ray perpendicular to at the point also intersects the polygon boundary between the points and . Then, consider the behavior of the algorithm during the backwards traversal. Let for be the first point on the left side of the ray . Then the segment intersects , and either the segment intersects the left chain or there was another segment before that intersected . Note, that because the intersection of and was the first violation of the half-strip property in the counter-clockwise order, the intersection of and cannot be of the second type, otherwise would already lie on the right side of a normal to at the point . Therefore, this intersection can only be of type one, and the algorithm will recognize it during the backwards traversal.
Case 3. Suppose that the third intersection type occurs. Then, there will be a segment (where ), for which the first or the second intersection type occurs when traversing the polygon in the opposite direction, and thus either case 1 or case 2 applies.
Thus, we only need to explicitly check for the first intersection type. The running time of the algorithm is . At every iteration, the number of segments removed from the list is equal to half the number of tests for intersections the algorithm makes, and the number of segments added back is at most . Therefore, the total number of segments that can be removed from over one traversal of the boundary is not more than . Similarly, the total number of segments that can be removed from over one traversal of the boundary is not more than . Therefore, the algorithm performs intersection tests. ∎
6 Reachable and reverse-reachable regions
Recall, that the set of points that can be reached from by a self-approaching path in is the reachable region of ; and the set of points from which point can be reached with a self-approaching path in is the reverse-reachable region of .
Reachable regions.
A region, reachable from a point in a simple polygon, can have a complicated structure, and have transcendental equations defining its boundary. Figure 14 shows an example of a reachable region, whose boundary is described by a transcendental equation already after the second turn of a self-approaching path.
Nevertheless, reachable regions seem to have some nice properties. We conjecture that,
Conjecture 1**.**
Reachable region is geodesically convex. That is, for any two points and that are reachable from by two self-approaching paths, any point on the shortest path connecting and is also reachable from by a self-approaching path.
Reverse-reachable regions.
Reverse-reachable regions (or their approximations) can be constructed by a modified algorithm for finding a shortest self-approaching path for two given points. We start at the destination point and traverse the shortest path tree in a breadth-first search manner, building a self-approaching shortest path tree. For every iteration, we construct a dead region by building an involute of the convex hull of the current leaf-to-root self-approaching path, and check for the intersections of the dead regions with the boundary of that may cut off parts of the polygon. The remaining region is the reverse-reachable region. As for the algorithm of computing the shortest self-approaching path, it takes time to construct the reverse-reachable region. Then, a shortest - path query for a query point can be answered by finding a tangent from to the boundary of , and then following the appropriate branch of the shortest path tree.
Acknowledgements
This work was begun at the CMO-BIRS Workshop on Searching and Routing in Discrete and Continuous Domains, October 11–16, 2015. Irina Kostitsyna was supported in part by the NWO under project no. 612.001.106, and by F.R.S.-FNRS.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] O. Aichholzer, F. Aurenhammer, C. Icking, R. Klein, E. Langetepe, and G. Rote. Generalized self-approaching curves. Discrete Applied Mathematics , 109(1-2):3–24, 2001.
- 2[2] S. Alamdari, T. M. Chan, E. Grant, A. Lubiw, and V. Pathak. Self-approaching Graphs. In 20th International Symposium on Graph Drawing (GD) , pages 260–271, 2012.
- 3[3] E. M. Arkin, R. Connelly, and J. S. B. Mitchell. On monotone paths among obstacles with applications to planning assemblies. In 5th Annual Symposium on Computational Geometry (SCG) , pages 334–343. ACM Press, 1989.
- 4[4] M. A. Bender and M. Farach-Colton. The LCA Problem Revisited. In Latin American Symposium on Theoretical Informatics , pages 88–94, 2000.
- 5[5] M. Biro, J. Iwerks, I. Kostitsyna, and J. S. B. Mitchell. Beacon-Based Algorithms for Geometric Routing. In 13th Algorithms and Data Structures Symposium (WADS) , pages 158–169. 2013.
- 6[6] P. Bose, I. Kostitsyna, and S. Langerman. Self-approaching paths in simple polygons. In 33rd International Symposium on Computational Geometry (So CG) , 2017. (to appear).
- 7[7] B. Chazelle and D. P. Dobkin. Intersection of convex objects in two and three dimensions. Journal of the ACM , 34(1):1–27, 1987.
- 8[8] B. Chazelle, H. Edelsbrunner, M. Grigni, L. Guibas, J. Hershberger, M. Sharir, and J. Snoeyink. Ray shooting in polygons using geodesic triangulations. Algorithmica , 12(1):54–68, 1994.
