Computing skeletons for rectilinearly-convex obstacles in the rectilinear plane

04/09/2020
by   Marcus Volz, et al.
The University of Melbourne
0

We introduce the concept of an obstacle skeleton which is a set of line segments inside a polygonal obstacle ω that can be used in place of ω when performing intersection tests for obstacle-avoiding network problems in the plane. A skeleton can have significantly fewer line segments compared to the number of line segments in the boundary of the original obstacle, and therefore performing intersection tests on a skeleton (rather than the original obstacle) can significantly reduce the CPU time required by algorithms for computing solutions to obstacle-avoidance problems. A minimum skeleton is a skeleton with the smallest possible number of line segments. We provide an exact O(n^2) algorithm for computing minimum skeletons for rectilinear obstacles in the rectilinear plane that are rectilinearly-convex. We show that the number of edges in a minimum skeleton is generally very small compared to the number of edges in the boundary of the original obstacle, by performing experiments on random rectilinearly-convex obstacles with up to 1000 vertices.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

03/09/2018

Geodesic Obstacle Representation of Graphs

An obstacle representation of a graph is a mapping of the vertices onto ...
07/22/2011

Computing the obstacle number of a plane graph

An obstacle representation of a plane graph G is V(G) together with a se...
02/25/2022

Outside-Obstacle Representations with All Vertices on the Outer Face

An obstacle representation of a graph G consists of a set of polygonal o...
11/23/2020

Characterization and Computation of Feasible Trajectories for an Articulated Probe with a Variable-Length End Segment

An articulated probe is modeled in the plane as two line segments, ab an...
11/17/2021

Barrier Forming: Separating Polygonal Sets with Minimum Number of Lines

In this work, we carry out structural and algorithmic studies of a probl...
02/03/2021

Interaction with an obstacle in the 2d focusing nonlinear Schrödinger equation

We present a numerical study of solutions to the 2d focusing nonlinear S...
06/20/2018

Learning what is above and what is below: horizon approach to monocular obstacle detection

A novel approach is proposed for monocular obstacle detection, which rel...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Obstacle-avoiding shortest network problems arise in many applications in industry. In these problems it may be necessary to perform intersection tests to determine whether a part of the network intersects one or more obstacles, since a network that intersects an obstacle is not a feasible solution. For polygonal obstacles, the number of edges can significantly contribute to the CPU time required by algorithms for computing shortest obstacle-avoiding networks. It is therefore desirable to reduce the number of edges that need to be considered for a given obstacle, since this will reduce the number of obstacle intersection tests that need to be performed.

Throughout this paper an obstacle (denoted by ) is a simple polygon, i.e. a closed and bounded polygonal region that does not have holes and whose boundary does not intersect itself. We will make the further assumption that is in general position, by which we mean that no three of its vertices are colinear. In obstacle-avoiding network problems the network is not permitted to intersect the interior of . In this paper we introduce the concept of a skeleton, which is a representation of an obstacle that consists of a set of line segments inside the obstacle. A skeleton can have a significantly reduced number of line segments compared to the number of line segments in the boundary of the original obstacle, and therefore performing intersection tests on a skeleton (rather than the original obstacle) can significantly reduce the CPU time required by algorithms for computing shortest obstacle-avoiding networks.

In this paper we focus on computing minimum skeletons for obstacles in the context of shortest networks with respect to the rectilinear metric (Figure 1). Obstacle-avoiding rectilinear network problems and shortest rectilinear path problems have been well studied (lee1996rectilinear, macgregor1979steiner, ganley1994routing, lin2007efficient, li2008obstacle, lin2008obstacle, long2008eboarst, liu2009high, huang2010obstacle, huang2011exact, ajwani2011foars, huang2011construction, liu2012obstacle, huang2013obsteiner, chow2014obstacle, held2014fast, brazil2015optimal, volz2019) and have a range of applications including VLSI design and motion planning. When represented as an embedding in the Euclidean plane, each edge is then a rectilinear shortest path between its endpoints; that is, a shortest path composed only of horizontal and vertical line segments.

Shortest rectilinear networks can be constructed from two types of edges (which represent geodesics in the rectilinear metric): a straight edge is a single line segment that is either horizontal or vertical; and a bent edge consists of a series of horizontal and vertical line segments where each adjacent pair of orthogonal line segments meet at a corner point. Any bent edge connecting a given pair of points can be embedded with a single corner point and has exactly two such embeddings. In many problem contexts, it is sufficient to consider shortest networks for which each edge has at most one corner point (see for example the discussion below on obstacle-avoiding rectilinear Steiner trees).

Figure 1: A shortest obstacle-avoiding rectilinear network interconnecting points , , and . The network has two straight edges ( and ) and four bent edges ( and ).

On this basis we provide a formal definition of skeletons for obstacles in the context of rectilinear shortest networks as follows (note that a set of embedded edges is considered to be inside if ):

Definition 1.

Let be a set of closed line segments inside a polygonal obstacle . Then is said to be a skeleton for if for any given pair of points outside the interior of , if every rectilinear shortest path with at most one corner point between the pair of points meets the interior of , then each such path intersects an element of . A minimum skeleton is a skeleton with the smallest possible number of line segments.

An example of a minimum skeleton for an obstacle is given in Figure 2. Note that shortest rectilinear paths between points outside the interior of with more than one corner point (i.e. zigzag paths) that pass through need not intersect a skeleton. For example in Figure 2, a shortest rectilinear path between and with multiple corner points (shown as a red line) intersects but does not intersect the skeleton. The skeleton is legitimate, however, because the two shortest rectilinear paths with one corner point (i.e. and ) intersect the skeleton.

The requirement in Definition 1 that a skeleton edge be inside ensures that all shortest rectilinear paths with at most one corner point that intersect the interior of a skeleton also intersect . This requirement makes it necessary to treat obstacles individually when determining their skeletons (since any one skeleton constructed for multiple disjoint obstacles would in part lie outside the interior of the obstacles). The related question, of whether a rectilinear path that intersects a skeleton edge (say, at an endpoint of the skeleton edge) actually enters the interior of the obstacle or simply runs along part of the obstacle boundary, is addressed in Section 1.1.

Figure 2: (a) A rectilinearly-convex obstacle . (b) A minimum skeleton for with four line segments.

In this paper we focus on computing minimum skeletons for obstacles that are themselves rectilinear, i.e. simple polygons for which each edge of the polygon is either horizontal or vertical. In particular, we focus on rectilinear obstacles that are rectilinearly-convex, meaning that any two points in can be joined by a shortest rectilinear path that is inside . This is a reasonable restriction of the problem to study initially, as it provides insight into the structure of minimum skeletons, and the intuition gained through studying minimum skeletons for rectilinearly-convex obstacles can then be extended to other contexts. Moreover, rectilinearly-convex obstacles are often found in VLSI problem instances (see for instance the many examples in the SteinLib database koch2001steinlib). For the remainder of this paper, the term rectilinearly-convex will be used to refer to an obstacle that is both rectilinear and rectilinearly-convex.

1.1 Obstacle-avoiding rectilinear Steiner trees and other applications of skeletons

We now discuss the application of skeletons to the obstacle-avoiding rectilinear Steiner tree problem, a problem which is applicable to physical networks in VLSI design (or microchip design); see Section 3.6 of brazil2015optimal. The following properties of rectilinear Steiner trees are from Section 3.1 of brazil2015optimal. Given a set of simple rectilinearly-convex obstacles in the Euclidean plane with a collective set of vertices, called virtual terminals, and a set of points, called terminals, that are outside the interiors of the obstacles, an obstacle-avoiding rectilinear minimum Steiner tree (OARMST) is a shortest network interconnecting the terminals, where each edge of the network is composed of horizontal and vertical line segments, and no point (vertex or interior point of an edge) on the network lies in the interior of an obstacle. This is equivalent to finding a shortest embedded obstacle-avoiding network in which the length of each edge is determined by the rectilinear metric (i.e. the length of an edge is the length of a shortest rectilinear path between the endpoints of the edge).

An exact algorithm huang2013obsteiner exists for computing OARMSTs which is based on the GeoSteiner algorithm warme2000exact. GeoSteiner uses the fact that OARMSTs decompose into full components, each of which is a full minimum Steiner tree (FST) on a subset of , meaning it is a minimum Steiner tree in which every terminal and every virtual terminal of each component has degree one. In the generation phase of GeoSteiner, a set of candidate full components is computed such that the set is guaranteed to contain all full components of a minimum solution. Then in the concatenation phase, a minimum interconnection network is constructed from the candidate full components.

The generation phase of GeoSteiner consists of a bottom-up construction of full components via the construction of branches in which one of the edges is a ray. At each stage in the construction of the branch it is necessary to check for intersections with the boundary of any obstacle. If such an intersection occurs, the branch, and hence the family of full components it would have generated, can be discarded. Large complex obstacles with many edges can therefore significantly contribute to the CPU time required by the algorithm. It is therefore desirable to reduce the number of edges that need to be considered for a given obstacle, since this will reduce the number of obstacle intersection tests that need to be performed in the generation phase of GeoSteiner.

The most effective GeoSteiner algorithms assume that each edge of the minimum network contains at most one corner point. This also makes sense in VLSI applications as any change in direction in an edge incurs a cost, since it usually involves moving from one layer of the microchip to another. Other related problems with applications to VLSI physical design include obstacle avoiding minimum rectilinear spanning trees, and obstacle avoiding minimum rectilinear visibility graphs, where again in each case all edges are assumed to contain at most one corner point. In all of these cases, any rectilinear edge embedded with at most one corner point that does not intersect any skeleton edges has an embedding that is obstacle avoiding. It now remains to specify the conditions under which such a rectilinear edge that does intersect a skeleton edge also intersects the interior of the obstacle.

Let be a closed line segment inside a rectilinearly-convex obstacle with both endpoints on the boundary of

. We can classify each point on

as either a boundary point if it lies on the boundary of , or a non-boundary point if it lies in the interior of . Let be a rectilinear path connecting two points outside the interior of , and containing at most one corner point. We first define what it means for to block .

Definition 2.

With , and defined as above, we say that blocks if:

  1. intersects at a non-boundary point; or

  2. meets a boundary point of not at a corner point of , and the direction of at this meeting point is not equal to the direction of any edge of the boundary of containing this boundary point of ; or

  3. is neither horizontal nor vertical, and meets an endpoint of at a corner point of , and includes part or all of the interior of a rectilinear bounding box edge of that intersects the interior of .

It is straightforward to see that this definition is precisely what is required to get the following theorem.

Theorem 1.1.

Let be a skeleton for a rectilinearly-convex obstacle . Let be a rectilinear path connecting two points outside the interior of , and containing at most one corner point. Then an edge of blocks if and only if every embedding of with at most one corner point intersects the interior of .

Once a skeleton has been constructed for a given obstacle , information about how each skeleton edge interacts with the boundary of can be recorded. This means that it is simple to check whether a skeleton edge blocks a given rectilinear path using only this supplementary information, and without needing to refer back to .

2 General properties of rectilinearly-convex obstacles

A rectilinearly-convex obstacle is a simple polygon for which each edge of the polygon is either horizontal or vertical and such that for any two points in there is a shortest rectilinear path between the two points that is inside . In this section we identify some useful general properties of rectilinearly-convex obstacles.

2.1 Classification of rectilinearly-convex obstacles

Throughout this paper we will use the terms “edges of ” and “vertices of ” as shorthand to refer to the edges and vertices of the boundary of (since is a region). The extreme edges of are the edges of that intersect its bounding box, where the bounding box is the smallest closed axis-oriented rectangle that encloses . The term bounding box will be similarly applied more generally to any set of line segments, such as skeletons. The function that returns the bounding box for a given set of line segments will be denoted by . An extreme corner of is a vertex of at the intersection of two extreme edges. A rectilinearly-convex obstacle has exactly four extreme edges and up to four extreme corners.

A staircase walk of is a shortest rectilinear path on the boundary of between adjacent extreme edges (including the extreme edges themselves). A pair of extreme corners (edges) will be called adjacent if they coincide with adjacent vertices (edges) of the bounding box of , or opposite otherwise. An extreme corner and an extreme edge are opposite if lies on an edge of the bounding box of that does not intersect . For example, if lies at the bottom-left corner of , then the right and top extreme edges of are opposite to .

Rectilinearly-convex obstacles can be categorised into six types based on the number and relative locations of extreme corners (see Figure 3):

Figure 3: Classification of rectilinearly-convex obstacles based on the relative locations of extreme corners. Extreme edges are shown as red lines, and extreme corners as red dots.
  • A rectangle has exactly four extreme corners.

  • An L-obstacle has exactly three extreme corners.

  • A T-obstacle has exactly two extreme corners, which are adjacent.

  • A staircase obstacle has exactly two extreme corners, which are opposite.

  • A partial staircase has exactly one extreme corner.

  • A general obstacle has no extreme corners.

2.2 Sub-classification of general obstacles

Let be a general obstacle. A pair of parallel extreme edges of will be said to overlap if the orthogonal projection of one edge onto the other is not empty, and a pair of non-overlapping extreme edges will be called positively (negatively) sloped if the absolute gradient of the line segment between the midpoints of the two edges is positive (negative). Up to symmetry, can be sub-classified into four types as shown in Figure 4:

Figure 4: Sub-classification of general obstacles based on the relative positions of parallel extreme edges.
  • Type (a): Both pairs of parallel extreme edges overlap.

  • Type (b): Exactly one pair of parallel extreme edges overlaps.

  • Type (c): Neither pair of parallel extreme edges overlap and the two pairs of parallel extreme edges have different slopes.

  • Type (d): Neither pair of parallel extreme edges overlap and the two pairs of parallel extreme edges have the same slope.

2.3 Obstacle ends

Let and be adjacent extreme edges of a rectilinearly-convex obstacle and assume that is horizontal and is vertical. Then is called an end of if: (1) and do not overlap with their corresponding opposite parallel extreme edges, and (2) there exists a corner of such that is the closest horizontal extreme edge to in the horizontal direction and is the closest vertical extreme edge to in the vertical direction.

A staircase or partial staircase obstacle with overlapping parallel extreme edges has no ends; otherwise, a staircase obstacle has two ends, one corresponding to each extreme corner, while a partial staircase has one end corresponding to its extreme corner and the other end corresponding to the two extreme edges that are not incident to . Rectangles, L-obstacles and T-obstacles do not have ends, since their pairs of parallel extreme edges overlap. Type (a), (b) and (c) general obstacles do not have ends, while Type (d) general obstacles have two ends. For example, the obstacle in Figure 4 (d) has two ends: and corresponding to and .

2.4 Point and edge visibility

Two points, and , inside a rectilinearly-convex obstacle will be called mutually visible if the line segment between and is inside . Two line segments and in are mutually visible if there exists a point on and a point on such that and are mutually visible. A point and a line segment in are mutually visible if there exists a point on such that and are mutually visible.

A visibility edge is any line segment that is inside . An auxiliary point is an endpoint of a visibility edge that lies in the interior of an edge in the boundary of . We define the following special types of visibility edge configurations, which may or may not exist for a given obstacle (refer to Figure 5):

Figure 5: Special types of edge configurations: (a) Diagonal. (b) Opposite extreme visibility edge. (c) Maximum length adjacent extreme visibility edge. (d) Cross. (e) Perpendicular extreme visibility edge.
  • A diagonal of is a line segment inside between a pair of opposite extreme corners.

  • An opposite (adjacent) extreme visibility edge is a line segment inside that has endpoints on parallel (orthogonal) extreme edges.

  • A maximum length adjacent extreme visibility edge is an adjacent extreme visibility edge with the maximum length among all adjacent extreme visibility edges for a given pair of extreme edges (for example, if and are the left and bottom extreme edges respectively, then the maximum length extreme visibility edge connects the top endpoint of and the right endpoint of ).

  • A perpendicular extreme visibility edge is a visibility edge that is perpendicular to its corresponding extreme edge.

  • A cross is a pair of opposite extreme visibility edges, where () has a endpoint on each horizontal (vertical) extreme edge.

3 General properties of skeletons

In this section we present some general properties of skeletons. Consider a visibility edge inside a rectilinearly-convex obstacle. Then will be called a maximum length visibility edge if it extends as far as possible in both directions to the boundary of , subject to remaining inside .

Lemma 1.

Let be a rectilinearly-convex obstacle. Then there exists a minimum skeleton for such that each edge in is a maximum length visibility edge.

Proof. Suppose is an edge of a skeleton . Then, since is inside some obstacle , any transformation of formed by extending at one or both ends to the boundary of is also a skeleton. The lemma immediately follows.  

For the remainder of this paper we will assume that all skeleton edges and visibility edges have the property of Lemma 1.

Lemma 2.

Let be a rectilinearly-convex obstacle and let be a skeleton for . Then for each extreme edge of , there exists an edge in with an endpoint on .

Proof. Without loss of generality, assume that there exists a skeleton that does not have an edge with an endpoint on the left extreme edge of , and let denote the -coordinate of . Since edges of the skeleton are closed line segments, there exists an (where is strictly less than the length of the shortest horizontal edge of ) such that the -distance of every point on the skeleton from is strictly greater than . Let be a vertical line whose -coordinate is . Then passes through without intersecting , giving a contradiction.  

We define an extreme skeleton edge to be a skeleton edge with at least one endpoint on an extreme edge.

3.1 Horizontal and vertical projections

The following is a useful property of skeletons.

Lemma 3.

Let be a rectilinearly-convex obstacle. If is a skeleton for , then the horizontal and vertical projections of cover the horizontal and vertical projections of .

Proof. Without loss of generality, suppose that a subset of the horizontal projection of is not covered by the horizontal projection of , and let be a vertical line that intersects the interior of . Then passes through without intersecting , and is therefore not a skeleton.  

Lemma 3 gives a necessary but not sufficient condition for to be a skeleton, as demonstrated by the example in Figure 6. In this example, the projections of the two skeleton edges cover the projections of the obstacle, however the two line segments clearly do not constitute a skeleton.

Figure 6: The set of line segments is not a skeleton even though its horizontal and vertical projections cover the horizontal and vertical projections of the obstacle.

3.2 Connectivity

Let be a set of line segments embedded in the plane. Then we say is connected if contains a path between every pair of points in . The following lemma provides sufficient conditions for a set of line segments to be a skeleton.

Lemma 4.

Let be a rectilinearly-convex obstacle, and let be a set of line segments inside such that (1) intersects the four extreme edges of and (2) is connected. Then is a skeleton for .

Proof. Let be a connected set of line segments inside that intersects the four extreme edges of , and suppose that is not a skeleton for . Then there exist points and outside the interior of such that all shortest rectilinear paths between and with at most one corner point intersect the interior of , but at least one such path does not intersect .

If and lie on a horizontal or vertical line, then there is a unique shortest rectilinear path between and (i.e. the line segment ) which enters and exits at distinct points on the boundary of . The obstacle can be partitioned into two regions, one on each side of , and each region contains exactly one extreme edge of that is parallel to , each of which is intersected by . If does not intersect , it follows that must be disconnected, giving a contradiction.

Now suppose that and do not lie on a horizontal or vertical line. Then there are two shortest rectilinear paths with at most one corner point between and , which we denote by and . Since both and intersect , it follows that cannot enter and exit on the same staircase walk; otherwise would be outside the interior of (due to the convexity of ).

Suppose that does not intersect . If lies outside the interior of , then at least one of the line segments and enters and exits at distinct points on the boundary of , and the argument above (for the case where and are on a vertical or horizontal line) can be applied to arrive at the same contradiction. Otherwise, is in the interior of , and enters and exits at two locations on distinct staircase walks. Therefore partitions into two regions, one on each side of , and each region contains at least one extreme edge of (due to the convexity of ), each of which is intersected by . If does not intersect , it follows that must be disconnected, giving a contradiction.  

3.3 Weak connectivity

The converse of Lemma 4 is not true. That is, a skeleton is not necessarily connected, as demonstrated by the example in Figure 7, in which the three solid line segments form a minimum skeleton for the staircase obstacle. We therefore require a different kind of connectivity, which we will refer to as weak connectivity, which is formally defined below:

Figure 7: An example of a minimum skeleton that is not connected.
Definition 3.

Let be a rectilinearly-convex obstacle, and let be a set of line segments inside . Let be the set of maximal connected sub-components of .

  • Two sub-components and will be called weakly connected if and where and are the respective (closed) bounding boxes of and .

  • A skeleton is called weakly connected if, when each sub-component is treated as a single vertex and an edge inserted between each pair of weakly connected sub-components, the resulting graph is connected.

We can now state necessary and sufficient conditions for a set of line segments to be a skeleton.

Theorem 3.1.

Let be a rectilinearly-convex obstacle and let be a set of line segments inside . Then is a skeleton for iff (1) intersects the four extreme edges of and (2) is weakly connected.

Proof.  Refer to Figure 8 and assume that is a skeleton. By Lemma 2, necessarily intersects the four extreme edges of . Now assume contrary to the theorem that is not weakly connected. Then can be partitioned into two disjoint subsets and such that . Since is a skeleton, then by Lemma 3 the projection of must cover the projection of , and therefore . Hence there exists a shortest rectilinear path with one corner point between and (where the path follows the boundary of at some small distance outside ) that is not intersected by (as illustrated in Figure 8). Therefore is not a skeleton, giving a contradiction.

Now assume that intersects the four extreme edges of and that is weakly connected, and assume contrary to the theorem that is not a skeleton for . Then there exist points and outside the interior of such that each shortest rectilinear path between and with at most one corner point intersects but at least one of these paths, say , does not intersect . Then partitions into two sets (as in the proof of Lemma 4), and since each set necessarily intersects at least one extreme edge, part of the skeleton must lie strictly on each side of . This contradicts the assumption that is weakly connected.  

Figure 8: Proof of Theorem 3.1.

3.4 Uniqueness

Figure 7 illustrates a case where the minimum skeleton is unique. We will see, however, that minimum skeletons are, in general, not unique. The example also demonstrates that both endpoints of an edge in a minimum skeleton can be auxiliary points.

4 Minimum skeletons by obstacle type

In this section we present methods for constructing minimum skeletons by obstacle type (based on the classification in Section 2.1).

4.1 Minimum skeletons for rectangles, L-obstacles and T-obstacles

Let denote the cardinality of as a set of line segments.

Lemma 5.

Let be a rectilinearly-convex obstacle and let be a minimum skeleton for . Then iff has a diagonal.

Proof.  If , then the single edge in must intersect the four extreme edges of by Lemma 2. This is only possible if the endpoints of are mutually visible opposite extreme corners of . A diagonal is a connected set of edges inside that intersects the four extreme edges of . Therefore is a skeleton for by Lemma 4. It is also a minimum skeleton since a skeleton clearly must have at least one edge.  

Corollary 1.

Let be a rectangle. Then is a minimum skeleton for , where is either of the two diagonals of .

Corollary 1 is known in the literature, as discussed in Section 4.2.3 of brazil2015optimal (see Theorem 4.18). The result is also related to the observation in huang2010obstacle that for a given rectangular obstacle, only the two endpoints of a diagonal of the obstacle need to be considered when constructing an obstacle-avoiding rectilinear minimum Steiner tree.

Lemma 6.

Let be a rectilinearly-convex obstacle that does not have a diagonal. If has a cross , then is a minimum skeleton for .

Proof.  is a connected set of line segments that intersects the extreme edges of , and is therefore a skeleton for by Lemma 4. By Lemma 5, must have at least two line segments. Therefore has the smallest possible number of line segments since .  

Lemma 7.

Let be an L-obstacle. If has a diagonal , then is a minimum skeleton for . Otherwise, a cross is a minimum skeleton for .

Proof. If has a diagonal , then is a minimum skeleton for by Lemma 5. Otherwise, an L-obstacle always has a cross (for instance the two extreme edges whose endpoints are extreme corners) which, by Lemma 6 is a minimum skeleton for .  

Lemma 8.

Let be a T-obstacle. Then a minimum skeleton for is any cross of .

Proof. A T-obstacle does not have a diagonal, but necessarily has a cross (for example, the pair of edges consisting of the extreme edge of whose endpoints are both extreme corners and a second edge that is an opposite extreme visibility edge orthogonal to ). Therefore is a minimum skeleton for by Lemma 6.  

Note that minimum skeletons for L-obstacles without diagonals and T-obstacles are not unique; there are infinitely many configurations of crosses that constitute minimum skeletons.

4.2 Minimum skeletons for staircase obstacles

While minimum skeletons for rectangles, L-obstacles and T-obstacles have either one or two edges, there is no fixed upper bound (independent of the number of obstacle vertices) on the number of edges in minimum skeletons for the remaining three types in the classification, and constructing minimum skeletons for these types is in general nontrivial. In this section we develop an iterative procedure for constructing minimum skeletons for staircase obstacles. We start by introducing the concept of a maximal extreme visibility edge.

4.2.1 Maximal extreme visibility edges

Let be a rectilinearly-convex obstacle and let be a skeleton for some connected subregion of . Then the vertical (horizontal) projection of is a single vertical (horizontal) line segment. Adding a new edge to potentially extends this line segment in one direction or the other, or both. The vertical (horizontal) advancement of is the length of the vertical (horizontal) projection of that is not covered by the corresponding projection of .

Definition 4.

A maximal extreme visibility edge is an extreme visibility edge for an extreme edge , such that:

  • If is horizontal, then maximises its vertical advancement and, subject to this, maximises its horizontal advancement towards the other horizontal extreme edge.

  • If is vertical, then maximises its horizontal advancement and, subject to this, maximises its vertical advancement towards the other vertical extreme edge.

The importance of maximising the secondary advancement towards the opposite extreme edge is highlighted in the example of Figure 9 (a partial staircase). It can be shown in this case that is a minimum skeleton for the obstacle shown. If the first edge added to the skeleton is a maximal extreme visibility edge associated with , then , rather than , should be chosen since has greater horizontal advancement towards , even though has a larger horizontal projection (note that if is added first, then has no horizontal advancement). Any set of line segments containing will not be a minimum skeleton.

Figure 9: A minimum skeleton does not contain even though the horizontal projection of is greater than the horizontal projection of , since maximises its horizontal advancement towards .

If a maximal extreme visibility edge has an endpoint at an extreme corner, we refer to it as a maximal extreme corner visibility edge. In the following lemma we show that for each extreme corner of a staircase obstacle there exists an associated maximal extreme corner visibility edge.

Lemma 9.

Let be a staircase obstacle with an extreme corner at the intersection of extreme edges and , and let and be maximal extreme visibility edges with endpoints on and respectively. Then is an endpoint of at least one of and .

Figure 10: Proof of Lemmas 9 and 10.

Proof. We can assume, without loss of generality, that is vertical and is horizontal; let and denote the respective endpoints of and that are opposite and . Then (with reference to Figure 10 (a)) must be on the bottom-right staircase walk and on the top-left staircase walk (if is on the top-left staircase walk then it must lie on a horizontal edge of , and moving it to the right will increase its horizontal advancement). Therefore the two line segments must intersect at some point . Suppose that neither nor have an endpoint at . Let denote the point at the intersection of the vertical line through and the horizontal line through . Since is a staircase obstacle, the polygon with vertices is inside . Let denote the line segment between and , where is the point on the ray from through that intersects the rectilinear path . If is on the line segment , then has the same horizontal advancement as and has additional vertical advancement, and therefore is not maximal, leading to a contradiction. Otherwise, is on the line segment , and in this case has the same vertical advancement as and has additional horizontal advancement. Therefore is not maximal, again leading to a contradiction.  

In the following lemma we show that a maximal extreme corner visibility edge is unique for a given extreme corner of a staircase obstacle.

Lemma 10.

Let be a staircase obstacle and let be a maximal extreme corner visibility edge in . Then maximises both its vertical and horizontal advancement.

Proof. Without loss of generality, assume that is an extreme corner at the bottom-left corner of (see Figure 10 (b)). Let and be maximal extreme visibility edges which maximise their horizontal and vertical advancements of , respectively and, subject to this, maximise their respective vertical and horizontal advancements. Let and denote the endpoints of and that are opposite to , and suppose and are distinct points. Let denote the point at the intersection of the vertical line through and the horizontal line through . Since is a staircase obstacle, the polygon with vertices is contained in . Hence the edge between and lies in , and this edge has the same horizontal and vertical advancement as and (respectively), but it has greater advancement in the respective orthogonal directions. Hence and are not maximal, giving a contradiction.  

We now show that for any staircase obstacle there exists a minimum skeleton that contains maximal extreme corner visibility edges.

Lemma 11.

Let be a staircase obstacle with extreme corners and . Then there exists a minimum skeleton for containing maximal extreme corner visibility edges at and .

Proof. Let and denote the extreme edges that intersect at (Figure 11). By Lemma 2, both and must be intersected by any minimum skeleton for . Let and denote maximal extreme skeleton edges with respective endpoints on and . By Lemma 9, at least one of and has an endpoint at . Denote this edge by . By Lemma 10, is the unique edge that maximises both its horizontal and vertical advancement. Clearly is a skeleton for the part of that intersects the bounding box of , since is connected and intersects all four extreme edges of this part of the obstacle.

Let be a skeleton edge with an endpoint at that is not maximal. Let () denote the part of that remains when the bounding box of () is subtracted from . Let () denote the minimum sets of edges required to construct skeletons for given the inclusion of () in the skeleton respectively. Then (since ). Therefore requires the minimum possible number of additional edges to construct a skeleton for , and hence a minimum skeleton for exists that contains .  

Figure 11: Proof of Lemma 11.

4.2.2 Frontiers and maximal frontier visibility edges

Let be a set of line segments inside a rectilinearly-convex obstacle such that is a skeleton for , where is the bounding box of . A frontier is the closure of a maximal connected component of the intersection of the boundary of and the interior of . Examples of frontiers are shown in Figure 12. The function that returns the set of frontiers for a given set of line segments will be denoted by .

Figure 12: Examples of frontiers (frontiers shown as red lines).

A frontier can be a single (horizontal or vertical) line segment, or it can be L-shaped, as shown in Figure 12 (c). An L-shaped frontier, which we will treat as a single frontier, can only occur if the intersection of the interior of the frontier with is empty (provided that all elements of are maximum length visibility edges). A set can have multiple associated frontiers (Figure 12 (a)). Frontiers provide a mechanism for constructing skeletons in an iterative fashion. The following lemma provides a useful general property of frontiers which is applicable to any rectilinearly-convex obstacle.

Lemma 12.

Let be a rectilinearly-convex obstacle and let be a minimum skeleton for . Let be a connected or weakly connected set of line segments in and let be the set of frontiers associated with . Then for all .

Proof. Suppose that there exists a frontier that is not intersected by . Since is convex and given the assumption that all elements of are maximum length visibility edges, it follows that divides into two regions, one containing and the other containing a set that lies on the opposite side of to . Clearly , and therefore and are not weakly connected. This contradicts the assumption that is a skeleton.  

A frontier visibility edge is a visibility edge that intersects a frontier . A maximal frontier visibility edge is a frontier visibility edge with the following properties:

  • If is a vertical line segment, then maximises its horizontal advancement and, subject to this, maximises its vertical advancement towards the opposite (vertical) extreme edge that is parallel to .

  • If is a horizontal line segment, then maximises its vertical advancement and, subject to this, maximises its horizontal advancement towards the opposite (horizontal) extreme edge that is parallel to .

  • If is L-shaped, then maximises either its horizontal or vertical advancement and, subject to this, maximises its vertical or horizontal advancement (respectively) towards the opposite vertical or horizontal extreme edge.

Lemma 13.

Let be a staircase obstacle or a partial staircase obstacle such that has a top-right extreme corner and let be a frontier associated with a connected or weakly connected set line segments inside that intersects the left and bottom extreme edges of . Let be a maximal frontier visibility edge associated with . Then maximises both its vertical and horizontal advancement.

Proof. The proof is similar to the proofs of Lemmas 9 and 10. Assume, without loss of generality, that the direction of advancement is towards the top-right, as in Figure 13. Let be a set of skeleton edges for that intersects the bottom and left extreme edges of , and let be the bounding box of . We initially assume that the frontier corresponding to is vertical, as in Figure 13 (a). Suppose contrary to the lemma that and are maximal frontier visibility edges which maximise their horizontal and vertical advancements respectively and, subject to this, maximise their respective vertical and horizontal advancements. (Note that in this case the part of below , the horizontal line through the topmost point of , has already been covered in the vertical direction.) Let and denote the endpoints of and not in . Let denote the point at the intersection of the vertical line through and the horizontal line through . Let denote the intersection of and . Since and are visibility edges (and are therefore in ), it follows that must be inside , and therefore the polygon with vertices is inside . Let denote the line segment between and the point where the ray from through intersects the boundary of . Hence the edge is inside , and this edge has the same horizontal and vertical advancement as and (respectively), and greater advancement in the respective orthogonal directions. Hence and are not maximal, giving a contradiction. Similar arguments apply if the frontier is horizontal or L-shaped (an example of the latter case is shown in Figure 13 (b)).  

Figure 13: Proof of Lemma 13.
Lemma 14.

Let be a staircase obstacle and let be a set of line segments inside such that intersects an extreme corner of and is a minimum skeleton for . Let denote the frontier for , and let be the (unique) maximal frontier visibility edge associated with . Then there exists a minimum skeleton for such that contains .

Proof. By Lemma 13, maximises both its horizontal and vertical advancement. Therefore requires the fewest possible number of edges to complete the skeleton. By Theorem 3.1, is a skeleton for since and are weakly connected.  

4.2.3 Iterative algorithm for computing minimum skeletons for staircase obstacles

The preceding results allow us to construct an iterative procedure for computing a minimum skeleton for a staircase obstacle (Algorithm 1). Note that the algorithm is stated here in a general form in which the inputs include an initial frontier and a termination frontier. This is because the algorithm will be used later as a sub-routine for computing minimum skeletons for partial staircases and general obstacles. For staircase obstacles, the initial frontier and termination frontiers are considered to be points, namely the extreme corners of the obstacles.

Input: (1) A staircase obstacle . (2) An initial frontier . (3) A termination frontier .
Output: A minimum skeleton for .
1 (initialise the skeleton).
2 (initialise the current frontier).
3 (initialise the termination variable).
4 while  do
      5 a maximal frontier visibility edge for .
      6 .
      7 if  then
            8 .
      9else
            10 the new frontier for .
            
      
11return
Algorithm 1 StaircaseSkeleton

Methods for efficiently constructing a maximal frontier visibility edge in Line 1 and the new frontier in Line 1 are provided in Section 5.1. Note that Algorithm 1 could alternatively be implemented as a recursive algorithm. We demonstrate the application of Algorithm 1 to the example provided in Figure 14. At the first iteration (Figure 14 (a)), the (unique) maximal extreme corner visibility edge is added to and the frontier associated with is computed. In the second and third iterations, the maximal frontier visibility edges and then are added to and in each case the corresponding frontier is computed. Finally, in the fourth iteration, the maximal frontier visibility edge is added to . In this case there are a number of candidate frontier skeleton edges that complete the skeleton; our current implementation selects the longest edge from these candidates. The algorithm now terminates since intersects the termination frontier .

Figure 14: Constructing a minimum skeleton using Algorithm 1.
Theorem 4.1.

computes a minimum skeleton for a given staircase obstacle , where and are the extreme corners of .

Proof. The correctness of the algorithm follows from a straightforward inductive argument. By Lemma 9, a minimum skeleton for exists such that contains a maximal extreme corner skeleton edge , and by Lemma 10, is unique. The inductive step makes use of Lemma 14. At each iteration, the algorithm adds a new maximal frontier visibility edge to the existing set of skeleton edges such that the resulting edge set, , is a minimum skeleton for .  

4.3 Minimum skeletons for partial staircase obstacles

A partial staircase has exactly one extreme corner, which will be denoted by . Denote the two extreme edges that do not have an endpoint at by and . By Lemma 2, both and must be intersected by . The example in Figure 15 demonstrates that a minimum skeleton for a partial staircase does not necessary intersect . In this case, any edge that has at endpoint at will be redundant, since is not visible to or , and therefore two additional edges are required with endpoints on and to complete the skeleton (since and are not mutually visible).

Figure 15: A minimum skeleton for a partial staircase does not necessary intersect the extreme corner of .

The following lemma provides a method for constructing skeleton edges at the end of corresponding to and .

Lemma 15.

Let be a partial staircase obstacle with extreme edges and that are opposite to the extreme corner of , and assume that does not admit a cross. Let and be maximal extreme visibility edges with endpoints on and respectively. If has a maximum length adjacent extreme visibility edge between and , then there exists a minimum skeleton such that . Otherwise, there exists a minimum skeleton such that and .

Proof. Suppose that has a maximum length adjacent extreme visibility edge between and (Figure 16 (a)). Let denote the frontier associated with ( is either L-shaped as in Figure 16 (a), or it is a horizontal or vertical line). Let denote the maximal frontier visibility edge for (where the uniqueness of follows from Lemma 13). Assume, without loss of generality, that the extreme corner of is at the top right of , and hence that is negatively sloped (as in Figure 16 (a)). Then can be assumed to be positively sloped, since any line segment intersecting with a negative slope can be reflected about the vertical line through its midpoint and at least one of the endpoints of the resulting line segment can be extended to increase its horizontal and/or vertical advancement towards . Any positively sloped line segment inside (whose endpoints lie on the boundary of ) that intersects must have an endpoint on the bottom-left staircase walk of . By the convexity of and since is a maximum length adjacent extreme visibility edge, we can assume that is the diagonal of the bounding box for , and therefore is connected. It is also clear that both the horizontal and vertical advancement of is at least as great as that of each of and . It follows that is a minimum skeleton for , and the region requires the fewest number of edges to complete the skeleton.

Now suppose that and are not mutually visible (Figure 16 (b)). Using an argument similar to the argument used in Lemma 13, it can be shown that and are unique, and since and are maximal, the region requires the fewest number of edges to complete the skeleton.  

Figure 16: Proof of Lemma 15.

Consider a partial staircase obstacle that has a maximum length adjacent extreme visibility edge , and let denote the bounding box of . When is subtracted from , the remaining obstacle has two possible forms (see Figure 17): (a) is a sub-staircase with a frontier that is either horizontal or vertical. (b) can be treated as a sub-staircase with a ‘notch’ removed from it and an L-shaped frontier. Using the same argument used in the proof of Lemma 15, it can be seen that in both cases a maximal frontier visibility edge associated with necessarily passes through and intersects , thereby forming a connected network. We now show that if the minimum skeleton for is not a cross, then there exists a minimum skeleton that intersects the extreme corner of .

Figure 17: (a) is a sub-staircase with a frontier that is either horizontal or vertical. (b) can be treated as a sub-staircase with a notch and an L-shaped frontier
Lemma 16.

Let be a partial staircase obstacle. If has a cross , then is a minimum skeleton for ; otherwise, there exists a minimum skeleton for such that intersects the extreme corner of .

Proof. A partial staircase does not contain a diagonal, since by definition it has exactly one extreme corner. Therefore by Lemma 5. If has a cross , then is a skeleton for and ; hence is a minimum skeleton for . Now suppose that does not contain a cross. When the bounding box of the extreme visibility edge or extreme visibility edges that are incident to and (i.e. either or using the notation of Lemma 15) is subtracted from , then a sub-staircase is obtained. The argument used in the proof of Lemma 9 can be applied to to show that there exists a minimum skeleton for such that intersects the extreme corner of .  

Algorithm 2 provides a procedure for computing a minimum skeleton for a partial staircase obstacle.

Input: A partial staircase obstacle .
Output: A minimum skeleton for .
1 if  has a cross  then
      2 return .
3else
      4 Let denote the extreme edges of , such that the extreme corner of is at the intersection of and .
      5 if  and are mutually visible then
            6 Construct the maximum length adjacent extreme visibility edge .
            7 .
            
      8else
            9 Construct maximal extreme visibility edges and for and respectively.
            10 .
            
      11.
      12 .
      13 return fc.
Algorithm 2 PartialStaircaseSkeleton

An efficient procedure for determining if two edges are mutually visible (as required in Lines 2 and 2) will be discussed in Section 5.1.

Theorem 4.2.

computes a minimum skeleton for a given partial staircase obstacle .

Proof. There are three possibilities for that need to be considered (note that by definition a partial staircase obstacle does not have a diagonal):

  1. has a cross: The existence, or otherwise, of a cross can be determined by checking for the existence of opposite extreme visibility edges. The correctness of Line 2 of the algorithm follows from Lemma 6.

  2. does not have a cross and has a maximum length adjacent extreme visibility edge : By Lemma 15 there exists a minimum skeleton such that . After constructing the frontier associated with , the remainder of the skeleton can be constructed using StaircaseSkeleton with initial frontier and termination frontier .

  3. does not have a cross or a maximum length adjacent extreme visibility edge: By Lemma 15, there exists a minimum skeleton such that and . After constructing the frontier associated with , the remainder of the skeleton can be constructed using StaircaseSkeleton with initial frontier and termination frontier .

 

4.4 Minimum skeletons for general obstacles

Finally, we examine general obstacles (obstacles with no extreme corners), starting with the special cases where and .

Lemma 17.

Let be a general obstacle and let be a minimum skeleton for . Then iff has a cross .

Proof.  If , then each extreme edge of contains an endpoint of one of the two edges of , say and , by Lemma 2. Therefore and are either both opposite extreme visibility edges or they are both maximum length adjacent extreme visibility edges. In the former case and form a cross. In the latter case, recall that a necessary condition for to be a skeleton is that the projections of and cover the projections of . It follows that the bounding boxes of and must intersect, and a cross can be constructed between the endpoints of and (see Figure 18 (a)). A cross is a connected set of edges inside that intersects the four extreme edges of . Therefore is a skeleton for by Lemma 4. It is also a minimum skeleton since has no extreme corners and hence does not have a diagonal, and therefore .  

Figure 18: (a) An obstacle with a pair of adjacent extreme visibility edges and also has a cross and . (b) A minimum skeleton for an obstacle that has an opposite extreme visibility edge has exactly three edges.
Corollary 2.

Let be a minimum skeleton for a general obstacle that does not admit a cross. Then .

The following lemma deals with the case when has exactly one opposite extreme visibility edge.

Lemma 18.

Let be a general obstacle that does not admit a cross. If has an opposite extreme visibility edge between extreme edges and , then is a minimum skeleton for , where and are perpendicular extreme visibility edges for and respectively.

Proof. Let and be the two extreme edges of corresponding to and respectively (Figure 18 (b)). When the bounding box of is subtracted from , two rectilinearly-convex pieces remain, one containing and the other containing . From the convexity of , the perpendicular extreme edges and clearly intersect . The three edges together form a connected set of line segments that intersect all four extreme edges of with the least possible number of line segments.  

The following lemma addresses the case where has an adjacent extreme visibility edge.

Lemma 19.

Let be a general obstacle with extreme edges such that the ends of (if they exist) are and , and such that does not admit a cross or an opposite extreme visibility edge. If has an adjacent extreme visibility edge then is a minimum skeleton for , where and are perpendicular extreme visibility edges for and respectively.

Proof. When the bounding box of is subtracted from , two rectilinearly-convex pieces remain, one piece containing and the other piece containing . The perpendicular extreme visibility edges and necessarily intersect (from the convexity of ), and the three edges together form a connected set of line segments that intersect all four extreme edges of with the least possible number of line segments.  

4.4.1 Type (c) general obstacles

The following result is required to construct minimum skeletons for Type (c) general obstacles.

Lemma 20.

Let be a Type (c) general obstacle such that no pair of extreme edges of are mutually visible, and let denote a perpendicular extreme visibility edge for extreme edge . Then is a minimum skeleton for .

Proof. The proof is similar to the proof of Lemma 18. Suppose that , , and correspond to the left, bottom, right and top extreme edges respectively and assume that is vertically higher than (and therefore is horizontally to the left of ). From the convexity of , extends from to a point that is at least as far to the right as the right-most endpoint of , and extends from to a point that is at least as far to the left as the left-most endpoint of . Therefore the horizontal projection of covers the horizontal projection of . When the bounding box of is subtracted from , two rectilinearly-convex pieces remain, one containing and the other containing . From the convexity of , the perpendicular extreme visibility edges and clearly intersect . The four edges together form a connected set of line segments that intersect all four extreme edges of with the least possible number of line segments.  

4.4.2 Type (d) general obstacles

The following lemma provides a result for constructing skeleton edges at the ends of Type (d) general obstacles.

Lemma 21.

Let be a general obstacle with ends and such that does not have a cross, an opposite extreme visibility edge or an adjacent extreme visibility edge between extreme edges at opposite ends of . If has an adjacent extreme visibility edge for the end , then there exists a minimum skeleton such that . Otherwise, there exists a minimum skeleton such that and , where and are maximal extreme visibility edges with endpoints on and respectively.

Proof. Refer to Figure 19. Without loss of generality, let and denote the left and bottom extreme edges of respectively. Suppose initially that and are mutually visible and let denote an adjacent extreme visibility edge of . Let denote the frontier associated with . Let denote the maximal extreme visibility edges associated with respectively. Let and denote the two candidates for the maximal frontier visibility edge associated with (depending on the orientation of ), where is the line segment intersecting that maximises its vertical advancement and subject to this then maximises its horizontal advancement, while is the line segment intersecting that maximises its horizontal advancement and subject to this then maximises its vertical advancement. Now we have two cases (illustrated in Figure 19):

  • Case (a): Suppose that (this is equivalent to saying that the endpoint of opposite and does not meet the top-right staircase walk of ). Then has at least as much horizontal and vertical advancement as , and therefore requires the fewest possible number of edges to complete the skeleton.

  • Case (b): Now suppose that and assume initially that has an endpoint on the top-right staircase walk of . If and are mutually visible (and have a corresponding adjacent extreme visibility edge ), then necessarily intersects , and therefore is a minimum skeleton for . If and are not mutually visible, then necessarily intersects both of the extreme visibility edges and . In this case is a minimum skeleton for . The preceding arguments are also applicable if has an endpoint on the top-right staircase walk of . If both and have an endpoint on the top-right staircase walk of , then either of the two edges can be selected for inclusion in .

Now suppose that and are not mutually visible. Again there are two cases (shown in Figure 19):

  • Case (c) If is a single region , then requires the fewest possible number of edges to complete the skeleton.

  • Case (d) Suppose is comprised of two disjoint regions. If exists then is a minimum skeleton for ; otherwise, is a minimum skeleton for .

 

Figure 19: Constructing skeleton edges at the ends of a general obstacle. The sub-figure labels correspond to the cases in the proof of Lemma 21

Algorithm 3 provides a procedure for computing a minimum skeleton for a general obstacle.

Input: A general obstacle .
Output: A minimum skeleton for .
1 Find the extreme edges of .
2 For each extreme edge , let be the corresponding maximal extreme visibility edge and let be any perpendicular extreme visibility edge.
3 if  has a cross  then
      4 return .
5else if  has an opposite extreme visibility edge  then
      6 return .
7else if  has an adjacent extreme visibility edge and is not a Type (d) obstacle then
      8 return .
9else if  is a Type (c) obstacle then
      10 return .
11 else
      12 Determine the two ends and of (as per Figure 4 (d)).
      13 if There exists an adjacent extreme visibility edge  then
            14 return .
      15else if There exists an adjacent extreme visibility edge  then
            16 return .
      17if There exists an adjacent extreme visibility edge for and  then
            18 .
      19else
            20 .
      21if There exists an adjacent extreme visibility edge for and  then
            22 .
      23else
            24 .
      
25.
26 if  and are weakly connected then
      27 return