 # Drawing Graphs as Spanners

We study the problem of embedding graphs in the plane as good geometric spanners. That is, for a graph G, the goal is to construct a straight-line drawing Γ of G in the plane such that, for any two vertices u and v of G, the ratio between the minimum length of any path from u to v and the Euclidean distance between u and v is small. The maximum such ratio, over all pairs of vertices of G, is the spanning ratio of Γ. First, we show that deciding whether a graph admits a straight-line drawing with spanning ratio 1, a proper straight-line drawing with spanning ratio 1, and a planar straight-line drawing with spanning ratio 1 are NP-complete, ∃ℝ-complete, and linear-time solvable problems, respectively, where a drawing is proper if no two vertices overlap and no edge overlaps a vertex. Second, we show that moving from spanning ratio 1 to spanning ratio 1+ϵ allows us to draw every graph. Namely, we prove that, for every ϵ>0, every (planar) graph admits a proper (resp. planar) straight-line drawing with spanning ratio smaller than 1+ϵ. Third, our drawings with spanning ratio smaller than 1+ϵ have large edge-length ratio, that is, the ratio between the length of the longest edge and the length of the shortest edge is exponential. We show that this is sometimes unavoidable. More generally, we identify having bounded toughness as the criterion that distinguishes graphs that admit straight-line drawings with constant spanning ratio and polynomial edge-length ratio from graphs that require exponential edge-length ratio in any straight-line drawing with constant spanning ratio.

## Authors

##### 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

Let be a set of points in the plane and let be a geometric graph whose vertex set is . We say that is a -spanner if, for every pair of points and in , there exists a path from to in whose total edge length is at most times the Euclidean distance between and . The spanning ratio of is the smallest real number such that is a -spanner. The problem of constructing, for a given set of points in the plane, a sparse (and possibly planar) geometric graph whose vertex set is and whose spanning ratio is small has received considerable attention; see, e.g., [12, 13, 14, 18, 21, 23, 39]. We cite here the fact that the Delaunay triangulation of a point set has spanning ratio at least 1.593  and at most 1.998 , and refer to the survey of Bose and Smid  for more results.

In this paper we look at the construction of geometric graphs with small spanning ratio from a different perspective. Namely, the problem we consider is whether it is possible to embed a given abstract graph in the plane as a geometric graph with small spanning ratio. That is, for a given graph, we want to construct a straight-line drawing with small spanning ratio, where the spanning ratio of a straight-line drawing is the maximum ratio, over all pairs of vertices and , between the total edge length of a shortest path from to and .

Graph embeddings in which every pair of vertices is connected by a path satisfying certain geometric properties have been the subject of intensive research. As the most notorious example, a greedy drawing of a graph [5, 7, 19, 24, 31, 36, 40, 42, 43, 49] is such that, for every pair of vertices and , there is a path from to that monotonically decreases the distance to at every vertex. More restricted than greedy drawings are self-approaching and increasing-chord drawings [3, 20, 41]. In a self-approaching drawing, for every pair of vertices and , there is a self-approaching path from to , i.e., a path such that , for any three points , , and in this order along ; in an increasing-chord drawing, for every pair of vertices and , there is a path from to which is self-approaching both from to and from to . Even more restricted are angle-monotone drawings [10, 20, 37] in which, for every pair of vertices and , there is a path from to such that the angles of any two edges of the path differ by at most . Finally, monotone drawings [4, 6, 29, 30, 32, 35] and strongly-monotone drawings [4, 25, 35] require, for every pair of vertices and , that a path from to exists that is monotone with respect to some direction or with respect to the direction of the straight line through and , respectively. While greedy, monotone, and strongly-monotone drawings might have unbounded spanning ratio, self-approaching, increasing-chord, and angle-monotone drawings are known to have spanning ratio at most  , at most  , and at most  , respectively. However, not all graphs, and not even all trees [36, 40], admit self-approaching, increasing-chord, or angle-monotone drawings.

Our results are the following.

• First, we look at straight-line drawings with spanning ratio equal to , which is clearly the smallest attainable value by any graph. We prove that deciding whether a graph admits a straight-line drawing, a proper straight-line drawing (in which no vertex-vertex or vertex-edge overlaps are allowed), and a planar straight-line drawing with spanning ratio are NP-complete, -complete, and linear-time solvable problems, respectively.

• Second, we show that allowing each shortest path to have a total edge length slightly larger than the Euclidean distance between its end-vertices makes it possible to draw all graphs. Namely, we prove that, for every , every graph admits a proper straight-line drawing with spanning ratio smaller than and every planar graph admits a planar straight-line drawing with spanning ratio smaller than .

• Third, we address the issue that our drawings with spanning ratio smaller than have poor resolution. That is, the edge-length ratio of these drawings, i.e., the ratio between the lengths of the longest and of the shortest edge, might be super-polynomial in the number of vertices of the graph. We show that this is sometimes unavoidable, as stars have exponential edge-length ratio in any straight-line drawing with constant spanning ratio. More in general, we show that there exist graph families such that any straight-line drawing with constant spanning ratio has edge-length ratio which is exponential in the inverse of the toughness. On the other hand, we prove that graph families with constant toughness admit proper straight-line drawings with polynomial edge-length ratio and constant spanning ratio. Finally, we prove that trees with bounded degree admit planar straight-line drawings with polynomial edge-length ratio and constant spanning ratio.

## 2 Preliminaries

For a graph and a set of vertices of , we denote by the graph obtained from by removing the vertices in and their incident edges. The subgraph of induced by is the graph whose vertex set is and whose edge set consists of every edge of that has both its end-vertices in . For a vertex , a -bridge of is the subgraph of induced by and by the vertices of a connected component of . The toughness of a graph is the largest real number such that, for every integer , cannot be split into connected components by the removal of fewer than vertices; that is, for any set such that consists of connected components, we have .

A drawing of a graph maps each vertex to a distinct point in the plane and each edge to a Jordan arc between its end-vertices. A drawing is straight-line if it maps each edge to a straight-line segment. Let be a straight-line drawing of a graph . The length of a path in is the sum of the lengths of its edges. We denote by (by ) the Euclidean distance (resp. the length of a shortest path) between two vertices and in ; we sometimes drop the subscript when the drawing we refer to is clear from the context. The spanning ratio of is the real value , where the maximum is over all pairs of vertices and of .

A drawing is planar if no two edges intersect, except at common end-vertices. A planar drawing partitions the plane into connected regions, called faces; the bounded faces are internal, while the unbounded face is the outer face. A graph is planar if it admits a planar drawing. A planar graph is maximal if adding any edge to it violates its planarity. In any planar drawing of a maximal planar graph every face is delimited by a -cycle.

The bounding box of a drawing is the smallest axis-parallel rectangle containing in the closure of its interior. We denote by and the left and right side of , respectively. The width and height of are the width and height of .

## 3 Drawings with Spanning Ratio 1

In this section we study straight-line drawings with spanning ratio equal to . We characterize the graphs that admit straight-line drawings, proper straight-line drawings, and planar straight-line drawings with spanning ratio equal to  and, consequently, derive results on the complexity of recognizing such graphs. We start with the following.

###### Lemma 1

A graph admits a straight-line drawing with spanning ratio equal to if and only if it contains a Hamiltonian path.

###### Proof

() Suppose that a graph admits a straight-line drawing with spanning ratio . Assume, w.l.o.g. up to a rotation of the Cartesian axes, that no two vertices of have the same -coordinate in . Let be the vertices of , ordered by increasing -coordinates. Then, for , we have that contains the edge , as otherwise any path between and would be longer than . Hence, contains the Hamiltonian path .

() A straight-line drawing with spanning ratio of a graph containing a Hamiltonian path can be constructed by placing at , for .

###### Theorem 3.1

Recognizing whether a graph admits a straight-line drawing with spanning ratio equal to  is an NP-complete problem.

###### Proof

The theorem follows by Lemma 1 and from the fact that deciding whether a graph contains a Hamiltonian path is an NP-complete problem [27, 28].

A graph is a point visibility graph if there exists a finite point set such that: (i)  has a vertex for each point in ; and (ii) has an edge between two vertices if and only if the straight-line segment between the corresponding points does not contain any point of  in its interior; see [9, Chapter 15]. We have the following.

###### Lemma 2

A graph admits a proper straight-line drawing with spanning ratio equal to if and only if it is a point visibility graph.

###### Proof

() Suppose that a graph admits a proper straight-line drawing with spanning ratio . Let be the point at which a vertex of is drawn in . Let and let be the point visibility graph of . We claim that an edge belongs to if and only if the edge belongs to ; the claim implies that is isomorphic to  and hence that is a point visibility graph. First, if belongs to , then contains the straight-line segment . Since is proper, no vertex of lies in the interior of , hence contains the edge . Conversely, if contains the edge , then no point in lies in the interior of the straight-line segment . Hence, the edge belongs to , as otherwise the length of any path between and would be larger than .

() Suppose that a graph is the visibility graph of a point set . For any point , let be the corresponding vertex of . Let be the straight-line drawing of that maps each vertex to the point . Consider any edge of . No vertex lies in the interior of the straight-line segment in , as otherwise would not belong to ; it follows that is proper. Further, consider any two vertices and of and let be the sequence of vertices of lying on the straight-line segment in , ordered as they occur from to . Then contains the path , whose length in is . It follows that the spanning ratio of is .

The existential theory of the reals problem asks whether real values exist for variables such that a quantifier-free formula, consisting of polynomial equalities and inequalities on such variables, is satisfied. The class of problems that are complete for the existential theory of the reals is denoted by  . It is known that NP PSPACE , however it is not known whether NP. Many geometric problems are -complete, see, e.g., [1, 38].

###### Theorem 3.2

Recognizing whether a graph admits a proper straight-line drawing with spanning ratio equal to  is an -complete problem.

###### Proof

The theorem follows by Lemma 2 and from the fact that recognizing point visibility graphs is a problem that is -complete .

We conclude the section by presenting the following.

###### Theorem 3.3

Recognizing whether a graph admits a planar straight-line drawing with spanning ratio equal to  is a linear-time solvable problem.

###### Proof

Dujmović et al.  characterized the graphs that admit a planar straight-line drawing with a straight-line segment between every two vertices as the graphs in the five graph classes in Figure 1. Since a straight-line drawing has spanning ratio  if and only if every two vertices are connected by a straight-line segment, the theorem follows from the fact that recognizing whether a graph belongs to such five graph classes can be easily done in linear time.

## 4 Drawings with Spanning Ratio 1+ϵ

In this section we study straight-line drawings with spanning ratio arbitrarily close to . Most of the section is devoted to a proof of the following result.

###### Theorem 4.1

For every , every connected planar graph admits a planar straight-line drawing with spanning ratio smaller than .

Let be an -vertex maximal planar graph with , let be a planar drawing of , and let be the cycle delimiting the outer face of in . A canonical ordering [8, 26, 34]) for is a total ordering of its vertex set such that the following hold for : (i) , , and ; (ii) the subgraph of induced by is -connected and the cycle delimiting its outer face in consists of the edge and of a path between and ; and (iii) is incident to the outer face of in . Theorem 4.1 is implied by the following two lemmata.

###### Lemma 3

Let be any -vertex connected planar graph. There exist an -vertex maximal planar graph and a canonical ordering for such that, for each , the subgraph of induced by is connected.

###### Proof

For , let be the subgraph of induced by and let be the graph composed of and of the vertices and edges of that are not in .

For each , we define and so that is connected, is -connected, and admits a planar drawing such that:

1. the outer face of the planar drawing of in is delimited by a cycle composed of the edge and of a path between and ;

2. is incident to the outer face of ;

3. every internal face of is delimited by a -cycle; and

4. the vertices and edges of that are not in lie in the outer face of .

If , then construct any planar drawing of and define and as the end-vertices of any edge incident to the outer face of . Properties 1–4 are then trivially satisfied (in this case the path is the single edge ).

If , assume that and have been defined so that is connected, is -connected, and admits a planar drawing such that Properties 1–4 above are satisfied. Let , where .

Consider any vertex that is in and that is not in . By Properties 1 and 4 of , all the neighbors of in lie in . We say that is a candidate (to be designated as ) vertex if, for some , there exists an edge such that immediately follows the edge in clockwise order around or immediately follows the edge in counter-clockwise order around ; see Figure 2. Figure 2: The drawing Lk−1 of Lk−1, where the interior of Gk−1 is colored gray. Each candidate vertex is represented by a square and labeled with its depth.

For each candidate vertex , let and be the neighbors of in such that is minimum and is maximum (possibly ). If , define the reference cycle of as the cycle composed of the edges and and of the subpath of between and . Define the depth of as if or as the number of candidate vertices that lie inside in otherwise.

We claim that there exists a candidate vertex with depth . Consider a candidate vertex  with minimum depth and assume, for a contradiction, that ; then there exists a candidate vertex that lies inside in . By the planarity of , the candidate vertices that lie inside form a subset of those that lie inside ; moreover, there is at least one candidate vertex, namely , that lies inside and not inside , hence . This contradicts the assumption that has minimum depth and proves the claim.

Consider a candidate vertex with . We let and distinguish two cases. Figure 3: (a) A candidate vertex v with d(v)=0 and a(v)=b(v). (b) The drawing Lk of Lk obtained by drawing the edge wa(v)+1v in Lk−1.

If , assume that immediately follows the edge in counter-clockwise order around , the other case is symmetric; refer to Figure 3. Define as plus the vertex and the edges and . Then is connected because is connected and the edge belongs to . Further, is -connected because is -connected and is adjacent to two distinct vertices of . Define by drawing the edge so that the cycle does not contain any vertex or edge in its interior. Property 1 is satisfied by with ; note that has no neighbor in other than and , since . Property 2 is satisfied by since satisfies Property 4 and by construction. Since the cycle does not contain any vertex in its interior and since satisfies Properties 3 and 4, it follows that also satisfies Properties 3 and 4. Figure 4: (a) A candidate vertex v with d(v)=0 and a(v)

Next, we consider the case in which ; refer to Figure 4. We claim that the only edges incident to vertices in the path and lying inside in are those connecting such vertices to . Suppose, for a contradiction, that an edge with lies inside . If , then there exists an edge with that immediately follows in clockwise order around or that immediately follows in counter-clockwise order around ; hence, is a candidate vertex. Further, by the planarity of , we have that lies inside , except at , however this contradicts . The proof for the cases in which or is analogous.

It follows from the previous claim that is the only vertex of which might have incident edges that lie inside in and that have one end-vertex not in . We redraw each -bridge of whose vertices different from lie inside planarly so that it now lies outside ; after this modification, no vertex of lies inside .

Define as plus the vertex and the edges . Then is connected, because is connected and the edge belongs to . Further, is -connected, because is -connected and is adjacent to at least two distinct vertices of . Define by drawing the edges among that do not belong to so that they all lie inside , except at their end-vertices, and so that the edges appear consecutively and in this counter-clockwise order around . Property 1 is satisfied by with . Property 2 is satisfied by by construction and since satisfies Property 4. Every internal face of that is not an internal face of is delimited by a -cycle , for some ; hence satisfies Property 3 since does. Finally, satisfies Property 4 since every vertex or edge of that is not in lies outside since satisfies Property 4 and lies outside by construction.

If , the construction slightly differs from the one described for the case , as we also require that the outer face of is delimited by the -cycle . Hence, if (resp. if ), then also contains the edges , , , , , , , (resp. the edges , , , , , , , ); further, the edges are drawn in in such a way that they appear in this counter-clockwise order around , and so that the outer face of is delimited by the -cycle . The proof that satisfies Properties 1–4 is similar, and in fact simpler, than the one described above.

The above construction implies the statement of the lemma. Namely, is connected for . Further, is a maximal planar graph by Property 3 and by the additional requirement for the case . We now prove that is a canonical ordering for . By Properties 1 and 2 of , we have that , , and are incident to the outer face of ; further, for , we have that is -connected and its outer face in is delimited by the edge and by a path between and , by Property 1 of ; finally, is incident to the outer face of for , by Property 2 of .

###### Lemma 4

For every and for every , there exists a planar straight-line drawing of such that:

1. the outer face of is delimited by the cycle ; further, the path is -monotone and lies above the edge , except at and ; and

2. the restriction of to the vertices and edges of is a drawing with spanning ratio smaller than .

###### Proof

The proof is by induction on . If , then a planar straight-line drawing of is constructed by drawing the -cycle as an isosceles triangle in which is horizontal and has length , while and have length , with above the edge . By Lemma 3, the graphs and are connected, hence the edge belongs to them and at least one of the edges and belongs to . Hence, we have . Further, . Analogously, .

Now assume that, for some , a planar straight-line drawing of has been constructed satisfying Properties 1 and 2; refer to Figure 5. Let be the diameter of a disk containing in its interior. We construct from by placing in the plane as follows. Let . As proved in , the neighbors of  in are the vertices in a sub-path of , where . By Property 1 of , we have . We then place at any point in the plane such that the following conditions are satisfied: (i) ; (ii) for every , the -coordinate of is larger than the -coordinates of the intersection points between the line through and the vertical lines through and ; and (iii) the distance between and the point of closest to is a real value .

Since is obtained from by substituting the path with the path , Condition (i) and the -monotonicity of imply that is -monotone. Since is planar, in order to prove the planarity of it suffices to prove that no edge incident to intersects any distinct edge of , except at common end-vertices. Condition (ii) implies that the edges incident to lie in the outer face of , hence they do not intersect any edge of , except at common end-vertices. Again Condition (ii) and the -monotonicity of imply that no two edges incident to intersect each other, except at . We now prove that the spanning ratio of is smaller than . Consider any two vertices and . If and , then . If , then , by Condition (iii). Consider the path composed of any edge in incident to (which exists since is connected) and of any path in between and (which exists since is connected). The length of is at most (by Condition (iii) and by the triangular inequality, this is an upper bound on ) plus (this is an upper bound on the length of any path in ). Hence, . This completes the induction and the proof of the lemma.

Lemmata 3 and 4 imply Theorem 4.1. Namely, for any connected planar graph , by Lemma 3 we can construct a maximal planar graph that, by Lemma 4 (with ) and for every , admits a planar straight-line drawing whose restriction to the vertices and edges of is a drawing with spanning ratio smaller than .

The following can be obtained by means of techniques similar to (and simpler than) the ones employed in the proof of Theorem 4.1.

###### Theorem 4.2

For every , every connected graph admits a proper straight-line drawing with spanning ratio smaller than .

###### Proof

Consider any -vertex graph and let be any spanning tree of . Let be any total ordering for the vertex set of such that the subtree of induced by is connected, for each .

For , we construct a straight-line drawing of with spanning ratio smaller than and such that no three vertices lie on a straight line. If , then is constructed by placing at any point in the plane. Now assume that a straight-line drawing of has been constructed with spanning ratio smaller than and such that no three vertices lie on a straight line. Let be the diameter of a disk containing in its interior. We construct from by placing at any point in the plane such that: (1) does not lie on any straight line through two vertices of ; and (2) the distance between and the point of that is closest to is a real value .

By Property (1), no three vertices lie on a straight line in . We prove that the spanning ratio of is smaller than . Consider any two vertices and . If and , then . If , then , by Property (2). Further, is at most (by Property (2) and by the triangular inequality, this is an upper bound on the length of the edge of incident to ) plus (this is an upper bound on the length of any path in ). Hence, .

A drawing of is obtained from the drawing of by drawing the edges that are not in as straight-line segments. Then is proper, as no three vertices of lie on a straight line in , and has spanning ratio smaller than , as the same is true for .

## 5 Drawings with Small Spanning Ratio and Edge-Length Ratio

In this section we study straight-line drawings with small spanning ratio and edge-length ratio. Our main result is the following.

###### Theorem 5.1

For every and , every -vertex graph with toughness  admits a proper straight-line drawing whose spanning ratio is at most and whose edge-length ratio is in .

Further, for every , there is a graph with toughness such that every straight-line drawing of with spanning ratio at most has edge-length ratio in .

In order to prove Theorem 5.1, we study straight-line drawings of bounded-degree trees. This is because there is a strong connection between the toughness of a graph and the existence of a spanning tree with bounded degree. Indeed, if a graph has toughness , then it has a spanning tree with maximum degree  . Further, a tree has toughness equal to the inverse of its maximum degree. We start by proving the following upper bound.

###### Theorem 5.2

For every , every -vertex tree with maximum degree admits a proper straight-line drawing such that no three vertices are collinear, the spanning ratio is at most , the distance between any two vertices is at least , and the width, the height, and the edge-length ratio are in .

###### Proof

Let . Root at any vertex . For any two vertices and of , let be the path in from to . We prove that, for an arbitrary real value , admits a proper straight-line drawing that, in addition to the properties in the statement of the theorem, satisfies the following: (1) is at the top-left corner of ; (2) for every vertex of , the path monotonically decreases in the -direction and monotonically increases in the -direction from to ; and (3) the height of is at most .

If , then is obtained by placing at any point in the plane. If , then there exists an edge whose removal separates into two trees and , each with at most vertices . Assume, w.l.o.g., that contains and , while contains . Then is rooted at and is rooted at . Inductively construct proper straight-line drawings and of and , respectively, with parameter satisfying Properties 1–4. Let and be the widths of and , respectively. Refer to Figure 6.

Translate so that lies at . Further, translate so that lies at , where is a real value chosen so that no line through two vertices in the same tree , with , overlaps a vertex in the tree , with and . Note that, since and are proper and since and are disjoint, there are finitely many values of for which the line through two vertices in a tree overlaps a vertex in a different tree , hence such a value always exists.

We now analyze the properties of . By construction, is a straight-line drawing of .

By induction, no three vertices are collinear in each of and ; further, by construction, and are arranged so that no line through two vertices in the same tree , with , overlaps a vertex in the tree , with and . Hence, no three vertices are collinear in , and in particular. is proper.

Property (1) is satisfied by given that is at the top-left corner of , by induction, and given that every vertex of lies to the right and below in , by construction.

In order to prove that satisfies Property (2), consider any vertex of . If belongs to , then monotonically decreases in the -direction and monotonically increases in the -direction from to , since satisfies Property (2). If belongs to , then is composed of the path , of the edge , and of the path . The paths and monotonically decrease in the -direction and monotonically increase in the -direction from to and from to , respectively, since and satisfy Property (2). Further, the -coordinate of is smaller than the one of and the -coordinate of is larger than the one of ; the latter follows from the fact that every vertex of has -coordinate in , while every vertex of has -coordinate smaller than .

The height of is at most , which is smaller than , hence satisfies Property (3).

We now discuss the spanning ratio of . We prove that, for any vertex of and any vertex of , it holds true that . This suffices to prove that the spanning ratio of is at most , since the drawings of and in are the ones inductively constructed by the algorithm. The distance between and is larger than or equal to , where is the horizontal distance between and , while denotes the distance between and . Clearly, we have . The path is monotone in the - and -directions, hence is upper bounded by the horizontal distance between and , which is at most , plus the vertical distance between and , which is at most . Analogously, is upper bounded by the horizontal distance between and , which is , plus the vertical distance between and , which is at most . Hence, . Thus:

 πΓ(u,v)∥uv∥Γ<(γ+2)⋅(w1+η+1+xzγ)γ⋅(w1+η+1+xzγ)≤γ+2γ≤1+ϵ.

Finally, we analyze the edge-length ratio of . Note that the distance between any vertex of and any vertex of is larger than , hence the same is true for every pair of vertices of . In particular, the length of every edge is larger than . Thus, the edge-length ratio of is upper bounded by the maximum length of an edge of . In turn, this is at most the height plus the width of . By Property (3), the height of is at most . By construction, the width of is equal to . Denote by the maximum width of a drawing of an -vertex tree constructed by the above algorithm. Since each of and has at most vertices, we get that . Repeatedly substituting this inequality into itself and recalling that for , we get . We have , given that ; further, we can set to be any constant, say . Thus, we get and the same holds true for the edge-length ratio of .

We can now prove the upper bound in Theorem 5.1. Consider an -vertex graph with toughness and let ; then has a spanning tree with maximum degree  . Apply Theorem