We study terrain visibility graphs, a well-known graph class closely related to polygon visibility graphs in computational geometry, for which a precise graph-theoretical characterization is still unknown. Over the last decade, terrain visibility graphs attracted quite some attention in the context of time series analysis with various practical applications in areas such as physics, geography and medical sciences. We make progress in understanding terrain visibility graphs by providing several graph-theoretic results. For example, we show that they can contain arbitrary large holes but not large antiholes. Moreover, we obtain two algorithmic results which are interesting from a practical perspective. We devise a fast shortest path algorithm on arbitrary induced subgraphs of terrain visibility graphs and a polynomial-time algorithm for Dominating Set on special terrain visibility graphs (called funnel visibility graphs).

Authors

• 14 publications
• 16 publications
• Mutual Visibility in Graphs

Let G=(V,E) be a graph and P⊆ V a set of points. Two points are mutually...
05/06/2021 ∙ by Gabriele Di Stefano, et al. ∙ 0

• A Visibility Graph Averaging Aggregation Operator

The problem of aggregation is considerable importance in many discipline...
11/17/2013 ∙ by Shiyu Chen, et al. ∙ 0

• Horizon Visibility Graphs and Time Series Merge Trees are Dual

In this paper we introduce the horizon visibility graph, a simple extens...
06/20/2019 ∙ by Colin Stephen, et al. ∙ 0

• Visibility graphs for robust harmonic similarity measures between audio spectra

Graph theory is emerging as a new source of tools for time series analys...
03/05/2019 ∙ by Benito García, et al. ∙ 0

• Colouring polygon visibility graphs and their generalizations

Curve pseudo-visibility graphs generalize polygon and pseudo-polygon vis...
03/13/2021 ∙ by James Davies, et al. ∙ 0

• Faster and More Robust Mesh-based Algorithms for Obstacle k-Nearest Neighbour

We are interested in the problem of finding k nearest neighbours in the ...
08/13/2018 ∙ by Shizhe Zhao, et al. ∙ 4

• Expressway visibility estimation based on image entropy and piecewise stationary time series analysis

Vision-based methods for visibility estimation can play a critical role ...
04/08/2018 ∙ by Xiaogang Cheng, et al. ∙ 0

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

Visibility graphs are a fundamental concept in computational geometry. For a given set of geometrical objects (e.g. points, segments, rectangles, polygons) they encode which objects are visible to each other. To this end, the objects form the vertices of the graph and there is an edge between two vertices if and only if the two corresponding objects “can see each other” (for a specified concept of visibility). Visibility graphs are well-studied from a graph-theoretical perspective and find applications in many real-world problems occurring in different fields such as physics [Elsner09, Liu10], robotics [deBerg2008], object recognition [Shapiro1979], or medicine [Ahmadlou2010, Gao16].

In this work, we study visibility graphs of terrains (that is, -monotone polygonal chains). This graph class has been studied since the 90’s [AbelloStaircaseI]

and found numerous applications in analyzing and classifying time series in recent years

[Lacasa4972, Elsner09, Liu10, Stephen15, Gao16]. However, they withstand a precise graph-theoretical characterization until today.

We make progress towards a better understanding of terrain visibility graphs by showing that they can contain arbitrary large holes (and are thus not perfect) but no antiholes of size larger than five. Moreover, we show that terrain visibility graphs do not include all unit interval graphs (which are hole-free). Furthermore, we give an example showing that terrain visibility graphs are not uniquely determined by their degree sequence.

Besides these theoretical findings, our main contributions are two algorithmic results: First, we develop an algorithm computing shortest paths in arbitrary induced subgraphs of terrain visibility graphs in  time, where  is the length of the shortest path (also  time is possible with an -time preprocessing). Second, we develop an -time algorithm for Dominating Set on a known subclass of terrain visibility graphs called funnel visibility graphs.

Related Work.

For a general overview on visibility graphs and related problems see the survey by GG13. As regards the origin of terrain visibility graphs, AbelloStaircaseI studied visibility graphs of staircase polygons which are closely related to terrain visibility graphs as Colley92 showed that they are in one-to-one correspondence with the core induced subgraphs of staircase polygon visibility graphs. AbelloStaircaseI describe three necessary properties that are satisfied by every terrain visibility graph and conjectured that these are actually sufficient. Moreover, they showed that one can reconstruct (a possible) slope ordering from the graph with given vertex ordering. Saeedi2015 give a simpler proof for the results of AbelloStaircaseI.

AbelloStaircaseUniform showed that visibility graphs of staircase polygons with unit step-length can be recognized via linear programming and that not all staircase polygon visibility graphs can be represented with unit steps.

ChoiFunnels study another subclass of terrain visibility graphs called funnel visibility graphs which is linear-time recognizable (also studied by ColleyTowers97).

Lacasa4972 introduced terrain visibility graph (under the name of time series visibility graphs) in the context of time series analysis. A variant called horizontal visibility graphs was later introduced by LLBL09. Horizontal visibility graphs were fully characterized by GUTIN20112421 who showed that these are exactly the outerplanar graphs with a Hamiltonian path. Moreover, Luque2017 showed that certain canonical horizontal visibility graphs are uniquely determined by their degree sequence.

Notably, the Terrain Guarding problem (that is, Dominating Set on terrain visibility graphs) has been extensively studied in the literature and is known to be NP-hard [KingKrohnHardness] even on orthogonal terrains [BG18]. It has recently been studied from a parameterized perspective [AFKSZ18].

2 Preliminaries

We assume the reader to be familiar with basic concepts and classes of graphs (refer to Brandstadt99 for an overview).

A terrain is an -monotone polygonal chain in the plane defined by an ordered sequence of terrain vertices with strictly increasing -coordinates. For two terrain vertices , we write if is “left” of , that is, . Furthermore, we define . The corresponding terrain visibility graph is defined on the set of terrain vertices where two vertices  and  are adjacent if and only if they see each other, that is, there is no endpoint between them that lies on or above the line segment connecting and . Formally, there exists an edge , for , if and only if all terrain vertices with satisfy

 ry

The visibility graph of a given terrain can be computed in linear time using an algorithm by Hershberger87.

We call a vertex convex if and see each other. Otherwise it is called reflex. The leftmost and rightmost vertex of a terrain are neither convex nor reflex.

Clearly, every terrain visibility graph contains a Hamiltonian path along the order of the terrain vertices. Moreover, the visibility graph of a terrain is invariant under some affine transformation, in particular scaling or vertical shearing.

The following are two elementary properties of terrain visibility graphs (we stick to the names coined by Saeedi2015). Two edges and are said to be crossing if the corresponding line segments cross, i.e. if . The first property states that two crossing edges imply the existence of another edge.

X-property: Let be four terrain vertices with . If sees and sees , then sees .

The X-property holds because must lie below the line segment through and must lie below the line segment through . Thus, the line segment between and is always above one of these two line segments, so it cannot be obstructed by any vertex.

bar-property: If are two non-consecutive terrain vertices that can see each other, then there is a vertex between and that can see both of them.

The bar-property is immediate if we first apply a vertical shear transformation such that . Then, is simply the vertex between and which has maximal -coordinate.

It is conjectured that these two properties together with the existence of a Hamiltonian path fully characterize terrain visibility graphs [AbelloStaircaseI, Saeedi2015].

3 Graph Properties

In this section we prove our graph-theoretical results.

3.1 Induced Subgraphs

AbelloStaircaseI already noticed that, whenever four vertices of a terrain visibility graph form an induced  (in that order), then they cannot satisfy since this violates either the X-property or the bar-property. This leads to the following observation.

Observation 3.1.

If form an induced (in that order), then the two leftmost of these are either and or and .

We can generalize this observation to larger induced cycles: While may appear as induced subgraph for any , its vertices can only occur in a specific order. For an example consider Fig. 1. Note that this construction can be generalized to any by changing the number of vertices on the bottom middle path.

We start with the following basic lemma (which can also be derived from the X-property and bar-property).

Lemma 3.2.

Let be a terrain visibility graph and three of its terrain vertices with . If sees and , but does not see , then there exists with that sees both, and .

Proof.

Since does not see , there must be some vertex that lies above the line segment connecting . Let be the leftmost such vertex, then clearly  sees . Then, the line segment connecting and lies entirely above the line segment connecting and and above the line segment connecting  and . ∎

For the vertex ordering of induced cycles, we can now derive the following.

Lemma 3.3.

Let be a terrain visibility graph and let be any vertices that form an induced cycle (in this order) with . If is the leftmost of these, then must all be to the left of both, and .

Proof.

Assume wlog that . Since , by Lemma 3.2, there is a vertex between and that can see and .

By the X-property, must all lie between and . Suppose that there exists (chosen minimally) such that . Then, by the X-property, would see , which is a contradiction. Since sees but not , must even lie to the left of by the X-property.

Now, assume that there exists (chosen maximally) such that . Then, would see by the X-property. Therefore, must all be to the left of . ∎

Lemma 3.3 now leads to a specific vertex ordering for an induced cycle.

Proposition 3.4.

Let be a terrain visibility graph and let form an induced cycle (in this order) with . Then, holds up to cyclic renaming and order reversal.

Proof.

We assume wlog that is the leftmost vertex and that . By Lemma 3.3, it follows . In particular, is the rightmost vertex. Thus, a mirrored version of Lemma 3.3 applies to the shifted sequence , giving . Overall, we then have .

Now, assume towards a contradiction that there exists with , where is chosen minimally. Let be minimal such that , that is, . Note that by the choice of . Let be maximal with , that is, . Note also that  by the choice of . Then, . Hence, by the X-property, contains the edge . Since form an induced path, this implies , contradicting the fact that . ∎

Interestingly, we can use creftypecap 3.1 to show that terrain visibility graphs do not contain large antiholes (an induced subgraph isomorphic to the complement of a cycle).

Theorem 3.5.

Terrain visibility graphs do not contain antiholes of size at least 6.

Proof.

Let induce an antihole in in this order with . Observe that for any with , the vertices , , , form an induced 4-cycle in this order.

Assume wlog that is the rightmost vertex. Then, for each , we apply creftype 3.1 to the on which yields that either and  or  and  are the two rightmost. It follows by assumption that  and  are the rightmost. Hence, are all to the left of . Now, for , we apply creftype 3.1 to and obtain that are also to the left of . Finally, for we use the same argument on (where ) and obtain that  are to the left of . This contradicts our assumption that  is the rightmost vertex. ∎

Considering possible subclasses of terrain visibility graphs, we close this subsection by showing that terrain visibility graphs do not include all unit interval graphs. The unit interval graph depicted in Figure 2 is not a terrain visibility graph. This is because it only has one Hamiltonian path (up to isomorphism) and the ordering given by this path violates the X-property.

3.2 Degree Sequences

Luque2017 studied the degree sequences of horizontal visibility graphs in order to explain why measures based on the degree sequence of horizontal visibility graphs of time series perform well in classification tasks. Their conclusion is that the degree sequence essentially contains all information of the underlying time series. Formally, they show that (canonical) horizontal visibility graphs are uniquely determined by their degree sequence.

In contrast, this not the case for terrain visibility graphs since the two terrain visibility graphs in Figures 4 and 3 both have the ordered degree sequence and are not isomorphic (since the unique degree-3 vertex has a degree-7 neighbor in one graph but not in the other).

4 Shortest Paths

A natural example for the occurrence of terrain visibility graphs is a network of stations communicating via line-of-sight links, e.g. radio signals. A common task is to determine the shortest path between two vertices . If the length of a path is measured via Euclidean distance, then the easy solution is to always go to the right as far as possible without going beyond . But a more realistic distance measure in this scenario is the number of edges, as edge travel times might be negligible in comparison to the processing times at the vertices. In this setting, the situation becomes more difficult since it might now be better to move in the opposite direction first. Nevertheless, the “go as far as possible” principle still proves very useful here.

The algorithm we describe in this section does not only work for terrain visibility graphs but also for any induced subgraph of a terrain visibility graph. This is a useful generalization: now we can also handle vertices which obstruct communication but are not stations themselves. Hence, in this section, we assume to always be an induced subgraph of a terrain visibility graph (with known vertex ordering). Furthermore, we assume and to be two vertices of with and , where denotes the length (i.e. number of edges) of a shortest path from to .

We start with the crucial observation that a shortest path contains at most one pair of crossing edges.

Lemma 4.1.

If some shortest --path contains a pair of crossing edges with , then it also contains the edge . Furthermore, this is the only crossing edge pair and .

Proof.

Let be a shortest --path and two crossing edges with . By the X-property, there is an edge and since  is a shortest path, it must contain that edge. Now, if any other edge , , of  crosses , then it also crosses and must then also contain either or . But then or would have degree three within , which is clearly impossible. Analogously, no other edge of can cross . Consequently, all of ’s vertices must lie in the interval . In particular, cannot have any other pair of crossing edges since the same argument would apply to that pair. ∎

We denote a path from to of length by its vertices and define and to be the indices of its leftmost and rightmost vertex. It is easy to see that is only possible if contains two crossing edges and the converse also holds (cf. Fig. 5 (iii)).

Lemma 4.2.

Let be a shortest --path. Then, if and only if contains two crossing edges, in which case and for all .

Proof.

If , then must contain a crossing between the disjoint subpaths from to and from to . Conversely, if contains a crossing, then, by Lemma 4.1, the two crossing edges must be and with . Then, for all follows from the fact that has no other crossing edges and . ∎

Thus, if and only if contains no crossing edges. Still, a similar ordering result as before holds (cf. Fig. 5 (i) and (ii)).

Lemma 4.3.

Let be a shortest --path with . Then, holds for all .

Proof.

Assume towards a contradiction that there are with . Then, the subpaths from to and from to are crossing, in contradiction to Lemma 4.1. The other inequalities can be derived analogously. ∎

In combination, Lemma 4.2 and Lemma 4.3 imply that all vertices with satisfy and all vertices with satisfy .

We define as the leftmost and as the rightmost vertex that can be reached from by a path of length at most that only uses vertices . We symmetrically define as the rightmost and as the leftmost vertex reachable from by a path of length at most using only vertices . The following lemma shows that there is a shortest path from  to  that uses only and for .

Lemma 4.4.

Let . Then, contains or .

Proof.

Wlog we assume , , and to be the rightmost vertex of . Let be the last edge of a shortest path from to . By definition, .

If , then let be a shortest path from to . If is a vertex of , then and we are done. Otherwise, contains an edge with . By the X-property, there is an edge between and , giving us a path of length at most between and , hence .

If , then let be a shortest path from to and proceed analogously to the first case. ∎

Due to symmetry, Lemma 4.4 also holds if one exchanges and , and also when is replaced by . Now, with the following lemma, we will be able to restrict our search for a shortest --path mostly to the and vertices.

Lemma 4.5.

There is a shortest --path for which the following implications hold for all .

Proof.

We begin by proving (i). Assume towards a contradiction, that there is no shortest --path adhering to (i). Then, let be a shortest --path chosen such that it maximizes , where is the smallest index such that violates the implication in (i). We assume (the case is analogous). Since , we know that all of are to the left of by Lemma 4.2 and Lemma 4.3. Since we assumed , we must have . By Lemma 4.4, we can construct a shortest path from to using only vertices from . Let be the minimal index for which . Further, let be the minimal index for which . Then, and are crossing edges, so by the X-property, must contain an edge where either (if ) or (if ). Using this edge, we can concatenate the first part of (up to ) with the last part of (starting at ). The resulting --path has length . Clearly, this length must be at least , therefore and . Denote the vertices of by . By construction of , the implication in (i) holds for , contradicting the choice of .

Now, assume that no shortest --path satisfies both (i) and (ii). Then, let  be a shortest --path that satisfies (i) and which is chosen to minimize , which is the largest index such that violates implication (ii). By reversing the roles of and and the ordering of all the vertices, we also exchange the roles of (i) and (ii). Now complies with (ii) but not with (i) and we can apply the above argument again to obtain a path that adheres to (i). To reach a contradiction, it only remains to show that then still adheres to (ii). Since we showed , we know that and thus . It is then easy to see that must be to the left of all of since would otherwise contain two crossing edges that produce a contradiction by Lemma 4.1. Therefore, , and thus trivially satisfies (ii). ∎

Note that the only situation in which neither case of Lemma 4.5 applies is when , in which case Lemma 4.2 applies.

We define the left and right horizon of a vertex as the furthest neighbor in that direction. (Here denotes the closed neighborhood of .)

 lhorizon(v) :=min(N[v]) rhorizon(v) :=max(N[v])

The following lemma shows that, when searching for a shortest --path, it is sufficient to check for three cases (illustrated in Fig. 5).

Lemma 4.6.

If , then either

1. for some , or

2. there is an edge between and for some , or

3. and for some , , , .

Conversely, each of these three cases implies .

Proof.

Let be an --path as in Lemma 4.5. If , then by Lemma 4.2 in connection with Lemma 4.5, claim (iii) holds with and .

Hence, assume . If , then, by Lemma 4.5, and for , , so (ii) is true. Otherwise, both, case (i) and (ii) of Lemma 4.5, apply to , therefore , implying claim (i).

The converse implication follows immediately from the definition of resp.  and the X-property. ∎

For a vertex , the following two definitions refer to the neighbors of that are closest to another vertex . If the sets on the right hand side are empty, we treat these values as resp. .

 rclosesta(v) :=min\setx∈N[v]∣x≥a, lclosesta(v) :=max\setx∈N[v]∣x≤a.

For given , these two values can be computed in time using binary search on the (sorted) adjacency lists of . It is further possible to compute them for all and some fixed in time.

We can now give our shortest path algorithm (Algorithm 1). It works by computing , , , and for increasing values of and checking each time, whether one of the three cases of Lemma 4.6 holds. While (i) is easy to test and (iii) only requires us to remember

 qs :=min\seti;rhorizon(αs(i))≥t∨rhorizon(βs(i))≥t and qt :=min\seti;lhorizon(αt(i))≤s∨lhorizon(βt(i))≤s,

condition (ii) requires slightly more effort. For this, we store the previously found values for in a list , sorted by increasing value of . Whenever we reach such that is to the right of the leftmost of these , we have found another edge of the form with (by the X-property). To test for the edges with , we use a symmetrical procedure and list .

Theorem 4.7.

Algorithm 1 computes in time, not including the time taken to compute the values for and .

Proof.

We begin by listing some invariants that are maintained throughout the algorithm.

1. At the beginning of each iteration of the for loop, we have etc. This is ensured by ExtendSearchRange and Lemma 4.4.

2. If holds at some point, then and analogously for . This is ensured by UpdateDistances.

3. We maintain . This is obvious for creftype 13.

For creftype 16, write , and let be a shortest path from to . Then either contains or crosses the edge in which case the X-property applies. In any case . A symmetrical argument works for creftype 20.

For creftype 24, if , then according to UpdateDistances we must have found vertices and with and and and .

We may assume , since otherwise test (i) would already have succeeded and set . Therefore the two edges and are crossing, so follows from the X-property.

We claim that holds after the outer for loop has reached .

If Lemma 4.6 case (i) applies, then then there are with and . Then will be set to in creftype 13 as soon as reaches .

If Lemma 4.6 case (ii) applies, then there are with such that and are connected by an edge. As soon as , will be added to by UpdateDistances and as soon as , will be added to . Therefore, when takes the value , will be set to  in either creftype 16 or creftype 20, depending on whether .

If Lemma 4.6 case (iii) applies, then there are with and , such that and . Then will be set to by UpdateDistances when and will be set to when . Therefore, when takes the value , will be set to by creftype 24.

Since we maintain , the outer loop will at some point reach , therefore the final value of will be at most and thus exactly .

It remains to show the running time. As shown above, the outer for loop is repeated at most times. Apart from the interior while loops, each iteration only takes constant time. Since at most one vertex is added to and in each of these iterations, the interior while loops are also iterated at most times overall.

Note that initializing all and with is only done for ease of notation. In practice these distance values only need to be stored once they get updated by UpdateDistances. ∎

How does the running time change if we incorporate the effort for the computation of and ? Algorithm 1 requires knowledge of these values for all and . This amounts to many computations, each taking time. The overall runtime is thus . Alternatively, one can precompute these values for all in time and then run Algorithm 1 in for any pair .

Even though we always assumed , the algorithm can be easily extended to handle the case where by adding a check to ExtendSearchRange that tests, whether any of was updated and, if not, halts the algorithm.

5 Dominating Set on Funnel Visibility Graphs

In this section we consider the Dominating Set problem (also known as Art Gallery or Guarding problem in the context of visibility graphs) on a subclass of terrain visibility graphs called funnel (or tower [ColleyTowers97]) visibility graphs [ChoiFunnels].

Dominating Set An undirected graph  and an integer . Does  contain  vertices such that every other vertex is adjacent to at least one of them?

A funnel is a terrain that has exactly one convex vertex (called the bottom) and whose leftmost and rightmost vertex see each other222We remark that our results are easily extended to the case when the two outer vertices do not see each other. (see Figure 6). Funnels appear in several visibility related tasks in geometry and their visibility graphs are linear-time recognizable [ChoiFunnels]. Funnel visibility graphs are characterized precisely as bipartite permutation graphs with an added Hamiltonian cycle [ColleyTowers97]. In the following, we assume to be given the graph together with the corresponding vertex coordinates of the funnel (which can be precomputed in linear time [ChoiFunnels]).

Dominating Set is known to be NP-hard on terrain visibility graphs [KingKrohnHardness] and even on orthogonal terrain visibility graphs [BG18]. We give an -time algorithm solving Dominating Set on funnel visibility graphs. We remark that the hardness reduction of KingKrohnHardness builds a terrain whose global shape resembles a funnel (except for some convex vertices forming small “caves”). In the following, we show that without such “caves”, the problem is polynomial-time solvable.

Let and be the vertices to the left resp. right of the bottom vertex , where  and  are ordered by increasing -coordinate. and are also referred to as the two chains of the funnel. We define as the index of a vertex in its corresponding chain. The following observation is immediate.

Observation 5.1.

For each vertex , the sets and are both interval subsets of respectively .