Rectilinear link diameter and radius in a rectilinear polygonal domain☆
Introduction
Diameters and radii are popular characteristics of metric spaces. For a compact set S with a metric , its diameter is defined as , and its radius is defined as . The pair and the point p that realize these distances are called the diametral pair and center, respectively. These terms are the natural extension of the same concepts in a disk and give some interesting properties of the environment, such as the worst-case response time or ideal location of a serving facility.
Much research has been devoted towards finding efficient algorithms to compute the diameter and radius for various types of sets and metrics. In computational geometry, one of the most well-studied and natural metric spaces is a polygon in the plane. This paper focuses on the computation of the diameter and the radius of a rectilinear polygon, possibly with holes (i.e., a rectilinear polygonal domain) under the rectilinear link distance. Intuitively, this metric measures the minimum number of links (segments) required in any rectilinear path connecting two points in the domain, where rectilinear indicates that we are restricted to horizontal and vertical segments only.
The ordinary link distance is a very natural metric and simple to describe. Initially, the interest was motivated by the potential robotics applications (i.e., having some kind of robot with wheels for which moving in a straight line is easy, but making turns is costly in time or energy). Since then, it has attracted a lot of attention from a theoretical point of view.
Indeed, many problems that are easy under the or Euclidean metric turn out to be more challenging under the link distance. For example, the shortest path between two points in a polygonal domain of combinatorial complexity n can be found in time for both Euclidean [11] and metrics [14], [15]. However, even approximating the shortest path within a factor of under the link distance is 3-SUM hard [16], and thus it is unlikely that a significantly subquadratic-time algorithm is possible. Recently the bit complexity of this problem was studied [12] and it was shown that sometimes bits is required to represent coordinates of some vertices of the optimal path.
The problem of computing the diameter and radius is no exception to this rule: when polygons are simple (i.e., they do not have holes) and have n vertices, the diameter and center can be found in linear time for both Euclidean [2], [10] and metrics [6]. However, the best known algorithm for the link distance runs in time [8], [21]. Lowering the running times or proving the impossibility of this is a longstanding open problem in the field. The only partial answer to this question was given by Nilsson and Schuierer [18], [19]; they showed that the diameter and center can be found in linear time under the rectilinear link distance (i.e., when we are only allowed to use rectilinear paths).
We focus on polygons with holes. The addition of holes to the domain introduces significant difficulties to the problem. For example, the diameter and radius under the rectilinear link distance can be uniquely realized by points in the interior of a polygonal domain (see Fig. 1). Hence, it does not suffice to determine the distance only between every pair of vertices of the domain. Other strange situations can happen, such as the diameter and radius being arbitrarily close (see e.g. Fig. 2).
These difficulties have a clear impact in the runtime of the algorithms. In most metrics, the runtime changes from linear or slightly superlinear to large polynomial terms. The difference between the link distance and other metrics becomes even more significant: no algorithm for computing the diameter and radius under the link distance is known, not even one that runs in exponential time (or one that works for particular cases such as rectilinear polygons). A summary of the best running time for computing the diameter and center under different metrics can be found in Table 1.
In this paper we provide the first step towards understanding such a difficult metric. Similarly to the simple polygon case [18], [19], we start by considering the computation of both the diameter and radius under the rectilinear link distance. We hope that the ideas of this paper will motivate future research in solving the more difficult problem of computing the diameter and radius under the (ordinary) link distance.
Several of the difficulties of the link distance disappear when restricting the problem to a rectilinear setting. For example, one can easily partition the domain into rectangular cells such that all points in a cell have the same distance to all points in another cell (for some domains the number of such cells is ). With this partition, brute-force algorithms that find the diameter and radius in time immediately follow. Alternatively, you can use a slightly coarser method to approximate either value: in or time we can compute an estimate of the diameter (details of these methods are given in Section 2). This estimate will either be the exact diameter or will be the diameter plus one (i.e., the path computed may contain an additional link that is not needed).
In our work we improve this second approach. By using some geometric observations, we characterize exactly when the estimate is off by one unit. Thus, we can transform the approximation algorithm into an exact one by adding a verification step that checks whether or not the one additive error has actually happened.
We provide three different algorithms for making the above additional verification step. In Section 3 we characterize what we should look for to determine what the exact diameter is. This characterization then leads to a brute-force algorithm that runs in time, where χ is a parameter of the input that ranges from to . To reduce running times when χ is large we present another algorithm to compute the diameter in Section 4. This algorithm, which runs in time, exploits properties of the diameter. Specifically, we heavily use that this value is a maximum over a maximum of distances, hence it can only be used for the diameter (recall that we have a minimum-maximum alternation in the definition of the radius). For the radius we then present a third algorithm that uses matrix multiplication to speed up computation. This solution runs in time , where is the matrix multiplication exponent (Le Gall [13] provided the best known bound on ω). This last solution can also be adapted to compute the diameter, but our second algorithm results in a faster method.
Another interesting benefit of our approach is that we may be able to obtain a certificate. In previous algorithms for computing the diameter or center in polygonal domains, the diameter is found via exhaustive search. Thus, even if somehow the points that realize the diameter or center are given, the only way to verify that the answer is correct is to run the whole algorithm. In our algorithm, knowing the diameter can reduce the time needed for verification. Although the reduction in computation time is not large (from for computing to for verifying the diameter, for example), we find it to be of theoretical interest.
Further note that, when comparing with the algorithms for other metrics, the running time for simple and polygonal domains differs by at least a cubic factor. In our case, running times only increase by a slightly superlinear factor when compared to the case of simple polygons [18], [19]. This is partially due to the fact that rectilinear link distance is much easier than the ordinary link distance, but also because we use this new verification approach. We believe this to be our main contribution and hope that it motivates a similar approach in other metrics.
A rectilinear simple polygon (also called an orthogonal polygon) is a simple polygon that has horizontal and vertical edges only. A rectilinear polygonal domain P with h pairwise disjoint holes and n vertices is a connected and compact subset of with h pairwise disjoint holes, in which the boundary of each hole is a simple closed rectilinear curve. Thus, the boundary ∂P of P consists of n line segments.
Each of the holes as well as the outer boundary of P is regarded as an obstacle that paths in P are not allowed to cross. A rectilinear path π from to is a path from p to q that consists of vertical and horizontal segments, each contained in P, and such that along π each vertical segment is followed by a horizontal one and vice versa. Recall that P is a closed set, so π can traverse the boundary of P (along the outer face and any of the h obstacles).
We define the link length of such a path to be the number of segments composing it. The rectilinear link distance between points is defined as the minimum link length of a rectilinear path from p to q in P, and denoted by . It is well known that in rectilinear polygonal domains there always exists a rectilinear polygonal path between any two points , and thus the distance is well defined. Once the distance is defined, the definitions of rectilinear link diameter and rectilinear link radius directly follow.
For simplicity in the description, we assume that a pair of vertices do not share the same x- or y-coordinate unless they are connected by an edge. This general position assumption can be removed with classic symbolic perturbation techniques. Also notice that, since we are considering rectilinear polygons, no edge has length 0. However, for simplicity in the analysis we will allow edges in a rectilinear path to have length 0. These edges of length 0 are considered as edges and thus potentially contribute to the link distance (naturally, no shortest path will ever have such an edge). The reason for considering these is that we will consider oriented paths, where the first and last edge are forced to be horizontal or vertical, this enforcement may require edges of length 0. From now on, for ease of reading, we will refer to rectilinear simple polygons and rectilinear polygonal domains as “simple polygons” and “domains.” Similarly, we will use the term “distance” to refer to the rectilinear link distance.
Section snippets
Graph of oriented distances
In this section we introduce the graph of oriented distances and show how it can be used to encode the rectilinear link distance between points of the domain. We note that, although we have not been able to find a reference to this graph in the literature, some properties are already known. For example, the horizontal and vertical decompositions (defined below) were used by Mitchell et al. [17] to compute minimum-link rectilinear paths.
For any domain P, we extend any horizontal segment of the
Characterization via boolean formulas
Let be the largest distance between vertices of . Similarly, we define . Note that these two values are the diameter and the radius of plus one (recall that we add one unit to the graph distance when defining Δ). We use and to approximate the diameter and radius of a domain P under the rectilinear link distance. First, we relate the distance between two points to the oriented distances between
Computing the diameter faster
We present a faster method for computing the diameter. This method uses the fact that the diameter is defined as a maximum over maxima which allows us to reduce the running time to . Recall that the radius is a minimum over maxima, thus the algorithm of this section does not trivially extend to the computation of the radius. The rest of this section is the proof of the following statement.
Theorem 3 The rectilinear link diameter of a rectilinear polygonal domain P of n vertices can be
Computation via matrix multiplication
In this section we provide an alternative method to compute the diameter and radius. This method also uses the conditions in Theorem 1, Theorem 2, but instead exploits the behavior of matrix multiplication on (0,1)-matrices. Recall that, given two (0,1)-matrices A and B, their product is .
We define a (0,1)-matrix I, which is used to compute both the diameter and radius: In other words, for each pair of rectangles in
Conclusions
Our algorithms heavily rely on Theorem 1, Theorem 2. They implicitly do a search among a list of candidates for the diametral pair or radius, but as mentioned in the introduction they have the advantage that can be used to yield a certificate. For example, if the diameter is , it suffices to report the four rectangles that satisfy the condition of Theorem 1. Then, if someone wants to verify that any pair in the intersection of the two pairs forms diameter, they have to compute the oriented
Declaration of Competing Interest
We wish to confirm that there are no known conflicts of interest associated with this publication and there has been no significant financial support for this work that could have influenced its outcome.
References (23)
- et al.
Computing the geodesic diameter and center of a simple polygon in linear time
Comput. Geom. Theory Appl.
(2015) - et al.
Minimum-link paths revisited
Comput. Geom. Theory Appl.
(2014) - et al.
An optimal algorithm for the rectilinear link center of a rectilinear polygon
Comput. Geom. Theory Appl.
(1996) Computing geodesic furthest neighbors in simple polygons
J. Comput. Syst. Sci.
(1989)- et al.
Approximation and fixed parameter subquadratic algorithms for radius and diameter in sparse graphs
- et al.
A linear-time algorithm for the geodesic center of a simple polygon
Discrete Comput. Geom.
(2016) - et al.
Rectilinear link diameter and radius in a rectilinear polygonal domain
- et al.
Computing the geodesic diameter and center of a polygonal domain
Discrete Comput. Geom.
(2017) - et al.
The geodesic diameter of polygonal domains
Discrete Comput. Geom.
(2013) - et al.
All-pairs shortest paths in geometric intersection graphs
J. Comput. Geom.
(2019)
An algorithm for computing the link center of a simple polygon
Discrete Comput. Geom.
Cited by (0)
- ☆
An extended abstract appeared at the 29th International Symposium on Algorithms and Computation (ISAAC 2018) [3]. EA was supported by the SNF Early Postdoc Mobility grant P2TIP2-168563, Switzerland, F.R.S.-FNRS, Belgium, and by the Foundation for the Advancement of Theoretical Physics and Mathematics “BASIS” Grant Leader 19-7-1-31-2, Russia. MC, AvR and MR were supported by JST ERATO Grant Number JPMJER1201, Japan. MC was also supported in part by ERC StG 757609. MK was supported in part by KAKENHI No. 17K12635, Japan and NSF award CCF-1422311. AM was supported by the Netherlands Organisation for Scientific Research (NWO) under project no. 024.002.003. YO was partially supported by JSPS KAKENHI Grant Number 15K00009 and JST CREST Grant Number JPMJCR1402, and Kayamori Foundation of Informational Science Advancement Grant Number K28-XXI-48. AO was supported by the Fund for Research Training in Industry and Agriculture (FRIA) Grant Numbers 5112416F and 5203818F.