A Note on Minimum-Segment Drawings of Planar Graphs

2 downloads 0 Views 437KB Size Report
supported by the Natural Sciences and Engineering Research Council of Canada (NSERC) and the .... This suggests the above questions of Dujmovic et al. ..... Proof: Let n2 and n3 be the number of vertices of degree two and degree three, .... the answer to the instance of Min-Seg-Draw is the answer to the instance of.
Journal of Graph Algorithms and Applications http://jgaa.info/ vol. 17, no. 3, pp. 301–328 (2013) DOI: 10.7155/jgaa.00295

A Note on Minimum-Segment Drawings of Planar Graphs Stephane Durocher 1 Debajyoti Mondal 1 Rahnuma Islam Nishat 2 Sue Whitesides 2 1

Department of Computer Science, University of Manitoba Department of Computer Science, University of Victoria

2

Abstract A straight-line drawing of a planar graph G is a planar drawing of G such that each vertex is mapped to a point on the Euclidean plane, each edge is drawn as a straight line segment, and no two edges intersect except possibly at a common endpoint. A segment in a straight-line drawing is a maximal set of edges that form a straight line segment. A k-segment drawing of G is a straight-line drawing of G such that the number of segments is at most k. A plane graph is a fixed planar embedding of a planar graph. In this paper we prove that it is NP-hard to determine whether a plane graph G with maximum degree four has a k-segment drawing, where k ≥ 3. The problem remains NP-hard when the drawing is constrained to be convex. We also prove that given a partial drawing Γ of a plane graph G, it is NP-hard to determine whether there exists a k-segment drawing of G that contains all the segments specified in Γ, even when G is outerplanar. The problem remains NP-hard for planar graphs with maximum degree three in R3 when given subsets of the vertices are restricted to be coplanar. Finally, we investigate a worst-case lower bound on the number of segments required by straight-line drawings of arbitrary spanning trees of a given planar graph. Submitted: August 2012

Reviewed: March 2013

Revised: May 2013

Accepted: June 2013

Final: June 2013

Published: June 2013 Article type: Communicated by: Regular paper G. Liotta An early version of the paper has been presented at the 23rd Canadian Conference on Computational Geometry (CCCG 2011) [8]. Work of S. Durocher is supported in part by the Natural Sciences and Engineering Research Council of Canada (NSERC). Work of S. Whitesides is supported by the Natural Sciences and Engineering Research Council of Canada (NSERC) and the University of Victoria. E-mail addresses: [email protected] (Stephane Durocher) [email protected] (Debajyoti Mondal) [email protected] (Rahnuma Islam Nishat) [email protected] (Sue Whitesides)

302

1

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

Introduction

A graph is planar if it admits an embedding in the plane without edge crossings. A plane graph G is a fixed planar embedding of the underlying planar graph, which can be specified by the cyclic ordering of the incident edges at each vertex of G and the outer face of G. A straight-line drawing Γ of G is an embedding of G in the Euclidean plane such that each vertex is mapped to a distinct point, each edge is drawn as a straight line segment, and no two edges intersect except possibly at a common endpoint. A segment of Γ is a maximal set of edges in Γ that form a straight line segment. Γ is called a k-segment drawing of G if the number of segments in Γ is at most k. Γ is called a minimum-segment drawing of G if the number of segments in Γ is the minimum among all possible straight-line drawings of G. A k-segment drawing is convex if all the faces in the drawing are convex polygons. Figure 1(a) depicts a plane graph G, Figure 1(b) depicts its straight-line drawing with thirteen segments, and Figure 1(c) shows a minimum-segment drawing of G with seven segments, which is also convex. a

a

f

e

f

b

a

g

d c (a)

f

h

b

h g

e

d b

c (b)

c

g h d

e

(c)

Figure 1: (a) A plane graph G. (b) A straight-line drawing of G. (c) A minimum-segment drawing of G. Straight-line drawings of plane graphs are aesthetically pleasing. We can sometimes further enhance the beauty of a straight-line drawing by minimizing the number of segments in the drawing because a minimum-segment drawing sometimes captures properties related to a graph’s symmetry and its induced path covers. A drawing that reflects symmetry information helps us to visually identify the constituent components and characteristics of the underlying graph [16, 17]. Minimum-segment drawings sometimes produce symmetric drawings as shown in Figures 2(a)–(c). The induced path vertex cover number (respectively, induced path edge cover number) of a graph G is the smallest number ρ such that the vertices (respectively, edges) of G can be partitioned into ρ sets, where each set induces a path in G. Many researchers have studied various types of path covering problems due to theoretical interest [20, 21] and applications in communication networks [14], program testing [23] and vehicle routing [27]. Since every segment in a straightline drawing is an induced path, the number of segments in a minimum-segment drawing gives an upper bound on the induced path edge cover number of the corresponding graph. Dujmovi´c et al. [6] presented a comprehensive study on drawings of planar graphs with few segments. They showed that η/2 segments are necessary

JGAA, 17(3) 301–328 (2013)

(a)

(b)

303

(c)

Figure 2: Three minimum-segment drawings reflecting symmetry information.

and sufficient for a straight-line drawing of a tree, where η is the number of odd degree vertices in the tree. They gave optimal bounds on the number of segments in straight-line drawings of outerplanar graphs, plane 2-trees and plane 3-trees, as well as polynomial-time algorithms for constructing straightline drawings of planar 3-connected graphs with at most 5n/2 segments, where n is the number of vertices. Later, Samee et al. [25] gave a linear-time algorithm for computing minimum-segment drawings of series-parallel graphs with maximum degree three. Recently, Biswas et al. [2] gave a linear-time algorithm to obtain minimum-segment convex drawings of 3-connected cubic plane graphs. A natural question is: What is the time complexity of computing a minimumsegment drawing of a planar graph [2]? Dujmovi´c et al. [6] posed the following related questions: (a) Is there a polynomial-time algorithm to compute a minimum-segment drawing of an outerplanar graph? (b) What is the minimum c such that every n-vertex planar graph has a plane drawing with at most cn + O(1) segments? We prove that the problem of determining a minimum-segment drawing is NP-hard for graphs with maximum degree four, even when the drawing is constrained to be convex. This suggests the above questions of Dujmovi´c et al. could be potentially difficult to answer. De Fraysseix and de Mendez [4] examined the following problem. Given a set P of paths in a connected planar graph G such that no two paths have any internal vertex in common, decide whether G admits a straight-line drawing such that each path in P is contained in a segment. They gave necessary and sufficient conditions to solve the problem in polynomial time. We study the case when the paths in P are allowed to cross, but are restricted to form a segment in the output drawing. We prove that even if G admits such a straight-line drawing, it is NP-hard to find such a drawing with the minimum number of segments. We consider the paths in P as pre-determined segments that have been specified by giving a partial drawing of G as input. We prove that the problem is NP-hard for outerplanar graphs. We then show that the problem remains NP-hard for planar graphs with maximum degree three in R3 when given subsets of the vertices are restricted to be coplanar. In many applications a graph is drawn to emphasize one of its spanning trees, and the other edges are displayed on demand [15, 22, 28]. Given an

304

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

arbitrary spanning tree, one may want to draw it with the minimum number of segments, where the edges that are not in the spanning tree are to be drawn with polylines or curves. Given a planar graph G, we investigate a worst-case lower bound on the number of segments required by straight-line drawings of arbitrary spanning trees of G. For this purpose, we introduce a new graph parameter for planar graphs, which we call “segment complexity” and define as follows. The segment complexity of a planar graph G is the minimum positive integer C such that every spanning tree of G admits a drawing with at most C segments. Observe that any lower bound on C is a lower bound on the number of segments required by straight-line drawings of those spanning trees of G that determine the spanning-tree segment complexity of G. Results: We briefly describe the main results shown in this paper. (1) In Section 3, we prove that given an arbitrary integer k ≥ 3, it is NP-hard to decide if a given plane graph with maximum degree four has a k-segment drawing. In Section 4, we show that the problem remains NP-hard when the drawing is constrained to be convex. (2) In Section 5, we prove that given a partial drawing Γ of a plane graph G, it is NP-hard to determine a k-segment drawing of G that contains all the segments specified in Γ, even when G is outerplanar. In Section 6, we show that the problem remains NP-hard for planar graphs with maximum degree three in R3 , if given subsets of the vertices are restricted to be coplanar. (3) In Section 7, we derive lower bounds on segment complexities of different classes of planar graphs. See Table 1. Graph Class Maximal outerplanar Plane 2-tree Plane 3-tree Plane 3-connected Plane 4-connected

Lower Bound on C n/6 n/6 (2n − 5)/6 n/8 n/5

Table 1: Lower bounds on the segment complexity C. Here n denotes the number of vertices. The rest of this paper is organized as follows. Section 2 gives some definitions and presents some preliminary results. Sections 3–7 establish the main results of the paper as described in (1)–(3) above. Finally, Section 8 concludes the paper with some open questions.

2

Preliminaries

Here we introduce some preliminary definitions.

JGAA, 17(3) 301–328 (2013)

305

Let G = (V, E) be a connected simple graph with vertex set V and edge set E. Let v be a vertex in G. We denote the degree of v by deg(v). Let k be the minimum positive integer such that there exists a set of k vertices in G whose removal results in a disconnected graph or a single-vertex graph. Then G is called k-connected. An independent set S is a subset of V , such that no two vertices of S are adjacent in G. A plane graph partitions the plane into connected regions, called faces. The unbounded face is called the outer face and all other faces are called the inner faces. The vertices on the boundary of the outer face are called the outer vertices and all other vertices are called the inner vertices. A maximal planar graph is a planar graph such that the addition of any edge results in a nonplanar graph. An outerplanar graph is a planar graph that admits a plane embedding, where all its vertices are on the outer face. We call such an embedding an outerplanar embedding. An outerplanar graph G is called a maximal outerplanar graph if no edge can be added to G so that outerplanarity is preserved. As in, for example [9], we define a pseudoline to be a simple (i.e., non-selfintersecting) curve in R2 that is infinite in both directions and whose removal leaves two unbounded connected components. An arrangement A(L) of a set L of n pseudolines is the subdivision of the plane induced by L, where the vertices are the intersection points of the pseudolines and each pair of pseudolines has a unique point of intersection, where the two pseudolines cross. As in, for example [10], we say an arrangement A(L) is simple if no three pseudolines share a common point. From now on, we assume all pseudoline arrangements are simple and that all graphs therefore have maximum degree 4. Given an arrangement A(L) of pseudolines, we define the pseudo-arrangement graph of A(L) as follows. The vertices correspond to the intersection points of the pseudolines and two vertices are adjacent in the graph if and only if they are adjacent along some pseudoline. A pseudo-arrangement graph is a graph that arises from some arrangement A(L) of pseudolines. An arrangement graph is a graph that arises from some arrangement A(L) of pseudolines, where all the pseudolines in A(L) are straight lines. See Figure 3. l5

l6

l6

l5 l4

l4 l3

l3 l2 l2 l1

(a)

l1

(b)

(c)

(d)

Figure 3: (a) An arrangement of six pseudolines. (b) Their pseudo-arrangement graph. (c) An arrangement of six straight lines. (d) Their arrangement graph.

We now give a characterization of arrangement graphs in terms of their

306

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

drawability, which follows easily from Bose et al. [3]. Lemma 1 A graph G is an arrangement graph of a set of l ≥ 3 straight lines if and only if G admits a straight-line drawing Γ such that: 1. Each segment contains l − 2 edges. 2. The degree of each vertex in Γ is at most four, and all vertices of degree two and degree three in Γ are on the outer face. 3. Each vertex of degree two is the endpoint of exactly two segments, and each vertex of degree three is the endpoint of exactly one segment. No segment has an endpoint that is a vertex of degree four. 4. The number of segments is l = n2 + n3 /2, where n2 and n3 are the number of vertices of degree two and degree three, respectively. Proof: Assume first that G is an arrangement graph. Then by definition, G admits a straight-line drawing Γ′ with l segments. We now verify that Γ′ satisfies Properties 1–4, and hence it is the required straight-line drawing Γ. Bose et al. [3] observed that Γ′ can be decomposed into l edge disjoint paths, corresponding to the straight lines of the underlying arrangement, each of length l − 1. Hence, Property 1 follows. Since we consider only simple arrangements, the degree of each vertex in Γ′ is at most four. Bose et al. [3] proved that all vertices of degree two or three must be on the outer face of Γ′ , which implies Property 2. Finally, Properties 3–4 are direct consequences of Proposition 1 of Bose et al. [3]. Now let Γ be a straight-line drawing of G that satisfies Properties 1–4. By Property 2, all the vertices of degree two are on the outer face, and by Property 3, all those vertices are the endpoints of exactly two segments. Therefore, no segment has an inner vertex of degree two. By Property 1, every segment has exactly l − 2 edges. Since there is no inner vertex of degree two on a segment, each inner vertex is the intersection point of more than one segments as well. Since l segments can have at most l(l − 1)/2 intersection points, Γ contains all possible intersections of its l segments and no additional intersections are created if we extend each segment of Γ to a 2-way infinite straight line. Thus, the set of intersection points of this arrangement of l straight lines determines the graph G, implying that G is an arrangement graph of a set of l lines.  We define an arrangement drawing to be a straight-line drawing that satisfies Properties 1–4. Since every face of an arrangement drawing can be defined as the intersection of a set of half-planes, we have the following. Observation 1 Every inner face in an arrangement drawing is convex. Let D be a straight-line drawing of a connected planar graph. A path in D is an outer path if it lies on the outer face. Let v1 , v2 , . . . , vk be an outer path of D, where the vertices are in clockwise order. We call ∠vi−1 vi vi+1 , 1 < i < k, a concave corner at vi if the angle ∠vi−1 vi vi+1 on the outerface is more than 180◦ . We call the path v1 , v2 , . . . , vk convex if no vi , 1 < i < k, contains a concave corner. We call the path v1 , v2 , . . . , vk straight if for each vi , 1 < i < k, the angle ∠vi−1 vi vi+1 on the outerface is equal to 180◦ .

JGAA, 17(3) 301–328 (2013)

3

307

Minimum-Segment Drawings

In this section we prove that it is NP-hard to decide whether a plane graph has a straight-line drawing with a given number of segments. We first need the following two lemmas. Lemma 2 Let G be a graph with l(l − 1)/2 vertices and l(l − 2) edges, where l ≥ 3, such that the degree of each inner vertex of G is four and all the vertices of degree two and degree three are on the outer face. Let the number of degree two and degree three vertices be n2 and n3 , respectively. Then G is an arrangement graph if and only if G admits a straight-line drawing Γ with l segments, where l = n2 + n3 /2. Proof: By Lemma 1, if G is an arrangement graph, then G admits a drawing with l = n2 + n3 /2 segments. We thus assume that Γ is a straight-line drawing of G with l segments and then prove that Γ is an arrangement drawing of G. By Lemma 1, this will imply that G is an arrangement graph. Since Properties 2 and 4 of Lemma 1 are satisfied by Γ already, it suffices to prove that Γ satisfies Properties 1 and 3. We first prove that Γ satisfies Property 3 of Lemma 1. The number of vertices in G is l(l − 1)/2 and the number of segments in Γ is l. Thus, Γ contains all pairwise intersections of the l segments and each vertex v in Γ must be an intersection point of two different segments. Consequently, if deg(v) = 4, then v cannot be an endpoint of any of those two different segments. Similarly, if deg(v) = 3, then v is the endpoint of one of those two different segments. If deg(v) is two, then v must be a common endpoint of those two different segments. We then prove that Γ satisfies Property 1 of Lemma 1. Suppose for a contradiction that there exists a segment s that contains at least l − 1 edges. Since s cannot have an inner vertex of degree two, then s must be intersected by at least l other lines. Thus the number of segments in Γ is at least l + 1, a contradiction. Thus each segment contains at most l − 2 edges. Since the number of edges in Γ is l(l − 2) and there are l segments, each segment contains exactly l − 2 edges, which proves the property.  Lemma 3 An arrangement drawing of an arrangement graph G is a minimumsegment drawing of G. Proof: Let n2 and n3 be the number of vertices of degree two and degree three, respectively. From the proof of Lemma 2 we can observe that G admits an arrangement drawing D in which the number of segments is l = n2 + n3 /2. Suppose for a contradiction that D is not a minimum-segment drawing of G. Then some drawing D′ of G has l′ segments, where l′ < l. Let l = l′ + k. In any drawing of G, the vertices of degree three are endpoints of at least n3 /2 segments. Therefore, there exist vertices of degree two in D′ that are not an endpoint of any segment. Let p be the number of such degree two vertices.

308

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

The number of intersection points in D′ is at most l′ (l′ − 1)/2. Since G is an arrangement of l segments, the upper bound on p is l. In any straight-line drawing of G, at least three vertices on the outer face must have concave corners. We now consider the following two cases depending on the characteristics of these corners. (1) All the concave corners have vertices of degree two. Then p ≤ l − 3 and the number of vertices in D′ is at most l′ (l′ − 1)/2 + l − 3. (2) At least one concave corner has a vertex of degree three. Since it is a concave corner, the angle between any two edges at that point cannot be 180◦ . Therefore, at least three segments have a common intersection point, and the number of intersection points in D′ is at most l′ (l′ − 1)/2 − 2 and p ≤ l. Hence, the number of vertices in D′ is at most l′ (l′ − 1)/2 − 2 + l = l′ (l′ − 1)/2 + l − 2. Therefore, the number of vertices in D′ is at most l′ (l′ − 1)/2 + l − 2 = l (l − 1)/2 + l′ + k − 2. The number of vertices in D is l(l−1)/2 = (l′ +k)(l′ +k−1)/2 = l′ (l′ −1)/2+ ′ (2l k+k 2 −k))/2 = l′ (l′ −1)/2+l′ k+k(k−1)/2. Since l′ +k−2 < l′ k+k(k−1)/2 for any 0 < k, l′ < l, the number of vertices in D′ is therefore less than the number of vertices in D, a contradiction.  ′



Observe that the drawing D′ in the proof of Lemma 3 cannot be a drawing of G even when G is a pseudo-arrangement graph. Therefore, any straight-line drawing of a pseudo-arrangement graph G with l(l − 1)/2 vertices contains at least l segments. By Lemma 2, if a pseudo-arrangement graph G admits a straight-line drawing with exactly l segments, then G is an arrangement graph. Consequently, we have the following corollary. Corollary 1 Let G be a pseudo-arrangement graph of l(l − 1)/2 vertices that is not an arrangement graph. Then any straight-line drawing of G contains more than l segments. We are now ready to prove that it is NP-hard to decide whether a plane graph admits a straight-line drawing with a given number of segments. A formal definition of the problem is as follows. Problem : Min-Seg-Draw Instance : A plane graph G and an integer k ≥ 3. Question : Is there a straight-line drawing Γ of G with at most k segments? We reduce an NP-hard problem, Arrangement-Graph-Recognition [3], to Min-Seg-Draw. Problem : Arrangement-Graph-Recognition

JGAA, 17(3) 301–328 (2013)

309

Instance : A plane pseudo-arrangement graph G such that the degree of each inner vertex of G is four and all the vertices of degree two and degree three are on the outer face. Question : Is G an arrangement graph? We now show the following theorem. Theorem 1 Min-Seg-Draw is NP-hard. Proof: To prove the problem is NP-hard we reduce Arrangement-GraphRecognition to Min-Seg-Draw. Let G be an instance of ArrangementGraph-Recognition. We take G′ = G as an instance of Min-Seg-Draw and define k such that k(k − 1)/2 = n, where n is the number of vertices in G. By Lemma 2, Lemma 3 and Corollary 1, G′ is an arrangement graph if and only if G′ admits a straight-line drawing with at most k segments. Therefore, the answer to the instance of Min-Seg-Draw is the answer to the instance of Arrangement-Graph-Recognition.  It is not clear whether Min-Seg-Draw is in NP. If there is a k-segment drawing of G, then we do not know whether it (or any other k-segment drawing of G) can be described to a Turing machine in a number of bits that is polynomial in the size of the input instance. Proving membership in NP does not appear to be straightforward since Goodman et al. [13] showed that there are pseudoarrangement graphs of l lines whose arrangement drawings require 2cl bits for coordinate representation, where c > 0 is a fixed constant. Before ending this section, it is worth mentioning that k-segment drawings have a connection with layered polyline drawings of planar graphs [7]. In a layered polyline drawing of a planar graph, each vertex is drawn on a horizontal line called a layer and each edge is drawn as a polygonal chain whose bends lie on the layers of the drawing. Every arrangement of k lines admits a layered polyline drawing (also known as wiring diagram) on O(k) layers [12]. Since the extension of the segments in a k-segment drawing creates an arrangement of k lines, every graph that admits a k-segment drawing, admits a layered polyline drawing on O(k) layers.

4

Minimum-Segment Convex Drawings

In this section we examine the problem of computing minimum-segment convex drawings. Recently, Biswas et al. [2] gave a linear-time algorithm to obtain minimumsegment convex drawings of 3-connected cubic (also known as 3-regular) plane graphs. Here we prove that the problem of computing a minimum-segment convex drawing is NP-hard for plane graphs with maximum degree four. The decision version of the problem is as follows. Problem : Min-Seg-Convex

310

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

Instance : A plane graph G and an integer k ≥ 3. Question : Is there a convex drawing Γ of G with at most k segments? We prove the NP-hardness of Min-Seg-Convex by reducing the Arrangement-Graph-Recognition problem in a similar way as in Theorem 1. However, we now perform some modifications in the reduction so that the minimumsegment convex drawing contains an arrangement drawing. We first need the following lemma. Lemma 4 Let G be an arrangement graph with l(l − 1)/2 vertices, where l ≥ 3. Let D be an arrangement drawing of G. Let σ = (v1 , v2 , . . . , vm ) be the vertices of degree two on the outer face of D in clockwise order. Then D satisfies the following properties. (a) The outer path in D between any two consecutive vertices vi and vj of σ is either straight or convex. (b) Every vertex of the convex hull1 of D is a vertex of degree two in G. Proof: Assume that the outer path vi (= w1 ), w2 , . . . , wq−1 , vj (= wq ) is neither straight nor convex. Then the outer path must contain a vertex wx , 1 < x < q, that contains a concave corner. See Figure 4(a). Since vi and vj are two distinct vertices of degree two that are consecutive in the sequence v1 , v2 , . . . , vm , therefore deg(wx ) = 3. Since wx contains a concave corner and deg(wx ) = 3, the point corresponding to wx must be an intersection point of three lines, which contradicts that G is a simple arrangement graph. We now prove that every point on the boundary of the convex hull of D is a vertex of degree two. Suppose for a contradiction that w is a vertex on the boundary of the convex hull, where deg(w) ≥ 3. Then vertex w must contain a concave corner. Consequently, the point corresponding to w must be an intersection point of three segments, which contradicts that G is a simple arrangement graph.  A wedge W with respect to an angle θ, 0 < θ < 180◦ , is the closed region of the plane bounded by two non-collinear rays that determine θ. Its complementary wedge is the wedge with respect to the opposite angle of θ. Let H be a convex polygon such that no three vertices are collinear. Let h1 , h2 , . . . , hm be the vertices of H in clockwise order. We denote by Wi a wedge at vertex hi , 1 ≤ i ≤ m, which is determined by edges incident to hi . A ray ri emanating from hi is outgoing if ri is contained in the complementary wedge of Wi . Note that we allow ri to lie on the boundary of its corresponding wedge. We call hi the origin of ri . Let p be the intersection point of the two straight-lines containing two such rays ri and rj , i 6= j. The angle θ(ri , rj ) between ri and rj is the clockwise angle through which ri must be rotated around p to make it coincide with rj . See Figure 4(b). 1 We do not regard interior points of convex hull edges as vertices of the hull, even though they may be vertices of the drawing.

JGAA, 17(3) 301–328 (2013)

rj

r3 vi

wx

vj

h2

rj

h (r 3 ,r 4) 4

h3

r4 H

p h1 (a)

b

b

h3

h5

311

ri a

(b)

c r k

(c)

ri a

h2 h1

H

h4 h5

cr

k

(d)

Figure 4: (a) Illustration for the proof of Lemma 4. (b) Illustration for wedge, complementary wedge and angle between two outgoing rays r3 and r4 . Complementary wedges of h3 and h4 are shown in light-gray. (c) Example of a covering triple (ri , rj , rk ) and a covering triangle abc. Observation 2 Let H be a convex polygon such that no three vertices are collinear. Let ri , rj and rk be three distinct outgoing rays in clockwise order around H such that each of the angles θ(ri , rj ), θ(rj , rk ) and θ(rk , ri ) is less than 180◦ . Then there exist three points a, b and c on ri , rj and rk , respectively, such that the triangle abc contains H. See Figure 4(c). We call the triple (ri , rj , rk ) and the triangle abc a covering triple and a covering triangle, respectively. See Figure 4(d). We now show the following theorem. Theorem 2 Min-Seg-Convex is NP-hard. Proof: To prove the problem is NP-hard we reduce Arrangement-GraphRecognition to Min-Seg-Convex. Let G be an instance of ArrangementGraph-Recognition, where the number of vertices in G is l(l − 1)/2. Let n2 and n3 be the numbers of vertices of degree two and three in G, respectively, where l = n2 + n3 /2. Take an embedding ΓG of G such that all the vertices of degree two are on the outer face. Let v1 , v2 , . . . , vn2 be the vertices of degree two on the outer face of G in clockwise order. Create a cycle c1 , c2 , . . . , cn2 of n2 vertices on the plane enclosing ΓG , and add the edges (ci , vi ), 1 ≤ i ≤ n2 . The resulting plane graph G′ is an instance of Min-Seg-Convex. See Figure 5(a). It is straightforward to construct G′ in polynomial time in the size of the input G. By construction, the number of vertices in G′ is l(l − 1)/2 + n2 and G′ is a graph of maximum degree four. The number of vertices of degree three in G′ is 2n2 + n3 . We now ask whether G′ admits a convex drawing with at most k = 3 + n2 + n3 /2 = 3 + l segments. Observe that one can compute G′ and k in polynomial time in the size of the input G. In the following we prove that G is an arrangement graph if and only if G′ admits such a drawing. We first assume that G is an arrangement graph and then define a convex drawing of G′ with at most 3 + l segments. By Lemma 1, we observe that G admits an arrangement drawing Γ with l segments, where all the vertices of degree two and three are on the outer face. By property (b) of Lemma 4, the convex hull H of Γ is determined by the vertices of degree two. In the following we use Γ to define the required convex drawing of G′ using Steps (a)–(d). In

312

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

Step (a) we show the existence of a covering triple (ri , rj , rk ); in Step (b) we show that the origins hi , hj , hk of this covering triple must be distinct; in Step (c) we use Observation 2 to show the existence of a covering triangle abc, which we then use to define a drawing Γ′ for G′ with (3 + l) segments; finally in Step (d) we verify that Γ′ is a convex drawing. (a) Let h1 , h2 , . . . , hm be the sequence of vertices on the boundary of H in clockwise order. Let σ = (r1 , r1 , r2 , r2 , . . . , rm , rm ) be a tuple of the 2m outgoing rays obtained by extending the segments adjacent to hi , 1 ≤ i ≤ m, in clockwise order. For simplicity, we use the same notation for the rays that have the same origin. See Figure 5(b). We now claim that there exists a covering triple (ri , rj , rk ) such that 1 ≤ i, j, k ≤ m. Suppose for a contradiction that no such covering triple exists. In the following we show that for any two consecutive rays rt and rt′ in σ, the inequality θ(rt , rt′ ) < 180◦ holds. We then use this observation to find a covering triple, which gives us a contradiction. Assume that there exist two rays rt and rt′ , where rt and rt′ are consecutive in σ, such that θ(rt , rt′ ) ≥ 180◦ . Let ht and ht′ be the origins of rt and rt′ , respectively. Since the angle formed by any two rays with the same origin is less than 180◦, t and t′ must be distinct. Moreover, since rt and rt′ are consecutive in σ, (ht , ht′ ) must determine an edge of the convex hull H. Since each of rt and rt′ is an extension of some segment of Γ, they must intersect at some point p inside H. Consequently, ∠ht pht′ = θ(rt , rt′ ) must be less than 180◦ . We now find a covering triple as follows. Choose one of the two r1 s arbitrarily. Let rx be the outgoing ray among the two r1 s that maximizes θ(r1 , rx ), where θ(r1 , rx ) < 180◦ . Similarly, let ry be the outgoing ray that maximizes θ(ry , r1 ), where θ(ry , r1 ) < 180◦ . See Figure 5(b). Now (r1 , rx , ry ) is a covering triple if θ(rx , ry ) < 180◦ . We show that this is indeed the case. Suppose for a contradiction that θ(rx , ry ) ≥ 180◦ . Since rx and ry intersects inside H, their corresponding origins hx and hy cannot form an edge of the convex hull H. Therefore, if we start traversing the vertices of H from hx in clockwise order, then we must visit some convex hull vertex hz 6∈ {hx , hy } before we visit hy . Since at most one of the two rays originating from hz can be collinear with r1 , either θ(r1 , rx ) or θ(ry , r1 ) is not maximal, which is a contradiction. See Figure 5(c). Consequently, θ(rx , ry ) is less than 180◦ , and by definition (r1 , rx , ry ) must be a covering triple. (b) We have proved that there exists a covering triple (ri , rj , rk ) among the outgoing rays obtained by extending the segments adjacent to hi , 1 ≤ i ≤ m. We now prove that the corresponding origins hi , hj , hk are distinct. Suppose for a contradiction that the origins of ri , rj , rk are not distinct. Since the outgoing rays are obtained by the extensions of the segments adjacent to a vertex on the boundary of H (which is a vertex of degree two by Property (b) of Lemma 4), at most two outgoing rays can have a common origin.

JGAA, 17(3) 301–328 (2013)

313

r 3 = rz c3 c2

v3

v2

r3 c4

v4

v5

r2

c5

r1

h2

hy

rx H

h1

h4

ry r 4 = ry r4

r 1= rx

(a)

hz

hx

r2

v1 c1

h3

(b)

r1

(c)

Figure 5: (a) Illustration for G′ , where ΓG is shown in the shaded region. (b) An arrangement drawing and the outgoing rays obtained by extending the segments adjacent to the vertices on the convex hull. (c) Illustration for the proof of Theorem 2. Without loss of generality assume that hi coincides with hk . Let si , sj and sk be the complementary rays of ri , rj and rk , respectively. If sj coincides with either si or sk , then either θ(ri , rj ) = 180◦ or θ(rj , rk ) = 180◦ , which contradicts that (ri , rj , rk ) is a covering triple. If sj is different from si and sk , then sj intersects si and sk inside H. It is now straightforward to observe that if sj hits si before sk , then θ(ri , rj ) > 180◦. Similarly, if sj hits sk before si , then θ(rj , rk ) > 180◦ . This contradicts that (ri , rj , rk ) is a covering triple. See Figure 6(a). (c) By Observation 2, there exists a covering triangle abc that contains Γ. We now repeatedly choose a vertex v of degree two in Γ such that v 6∈ {hi , hj , hk } and extend one of its adjacent segments until the endpoint of that segment crosses the boundary of abc. It is now straightforward to verify that the resulting drawing Γ′ is a (3 + l)-segment drawing of G′ . See Figures 6(b) and (c). (d) We now only need to show that Γ′ is a convex drawing. By Observation 1, the inner faces in Γ′ that correspond to the inner faces in Γ are convex. By the construction of Γ′ along with Property (a) of Lemma 4, we can verify that all the newly created inner faces of Γ′ are convex. Finally, the outer face of Γ′ is the triangle abc, which is also convex. We now assume that G′ admits a convex drawing Γ′ with at most k = 3 + n2 + n3 /2 segments and then show that G is an arrangement graph. We delete all the vertices of the outer cycle C from Γ′ along with their incident edges. It is straightforward to check that the resulting drawing Γ′′ is a straightline drawing of G. We now count the number of segments in Γ′′ . The drawing of C in Γ′ must contain at least three segments. Therefore, the number of segments in Γ′′ is less than or equal to l = n2 + n3 /2. By Lemma 2, Lemma 3 and Corollary 1, G is an arrangement graph. 

314

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

rj

hj

sk

H

si

b

h3

h3

h2

sj

hi = hk ri

b

h2

h1

rk

h4

a

(a)

h1

h4

c

c

a

(b)

(c)

Figure 6: (a) Illustration for the proof of Theorem 2 with the angle θ(rj , rk ) shown in light-gray. (b) A covering triangle abc of Γ. (c) Construction of Γ′ .

5

Minimum-Segment Drawings with Prescribed Segments

Drawing a graph respecting the properties of a partial drawing is a well-studied problem. For example, Angelini et al. [1] gave a polynomial-time algorithm to test the planarity of partially embedded graphs. Di Giacomo et al. [5] examined the problem of determining a point-set embedding of a tree that includes a given partial drawing of the tree. Patrignani [24] proved the NP-hardness of computing a straight-line drawing of a planar graph that includes a given partial drawing of the graph. In this section, we prove that given a partial drawing Γ′ of a graph G, it is NP-hard to determine a k-segment drawing of G that contains all the segments specified in Γ′ . The problem remains NP-hard even when G is outerplanar and a straight-line drawing of G containing all the segments specified in Γ′ is computable in polynomial time. A formal definition of the decision problem is as follows. Problem : Partial-Min-Seg Instance : An outerplanar graph G, a straight-line drawing Γ′ of a subgraph G′ of G such that a straight-line drawing of G containing all the segments specified in Γ′ is computable in polynomial time, and an integer k ≥ 1. Question : Is there a k-segment drawing Γ of G that contains all the segments specified in Γ′ ? We prove the NP-hardness of Partial-Min-Seg by reducing a strongly NP-complete problem 3-Partition [11], which is defined as follows. Problem : 3-Partition Instance : A set of 3m positive integers S={a1 , a2 , . . . , a3m } and an integer B > 0, where a1 + a2 + . . . + a3m = mB and B/4 < ai < B/2, 1 ≤ i ≤ 3m.

JGAA, 17(3) 301–328 (2013)

315

Question : Can S be partitioned into m subsets S1 , S2 , . . . , Sm such that |S1 |=|S2 |= . . . =|Sm |=3 and the sum of the integers in each subset is equal to B? Observe that the NP-completeness of 3-Partition holds even when each integer of S is greater than one, which we will use in our reduction. A fan f is a maximal outerplanar graph with n vertices such that some vertex v has degree n − 1. We call v the apex of f and all the other vertices the path vertices of f . We call the edges that are incident to v the ribs of f . We now show the following theorem. Theorem 3 Partial-Min-Seg is NP-hard. Proof: To prove the problem is NP-hard we reduce 3-Partition to PartialMin-Seg. We create an instance of Partial-Min-Seg from an instance B, S= {a1 , . . . , a3m } of 3-Partition, where each integer of S is greater than one. We construct in polynomial time an outerplanar graph G as in Figure 7(a), where 3m + 2 fans have a common apex v. Each fan fi , 1 ≤ i ≤ 3m, contains exactly ai path vertices. There are two more fans f ′ and f ′′ which contain m + 1 path vertices and mB + m + 1 path vertices, respectively. The size of G is polynomial since 3-Partition is strongly NP-complete. We denote by G′ the subgraph of G induced by the vertices of f ′ and f ′′ . We construct a straight-line outerplanar drawing Γ′ of G′ that satisfies the following (a)–(b). (a) Let w1 , . . . , wm+1 be the path vertices of f ′ ordered clockwise around v and let u1 , u2 , . . . , umB+m+1 be the path vertices of f ′′ ordered clockwise around v. For each j, 1 ≤ j ≤ m+1, rib (wj , v) of f ′ and rib (v, ui ) of f ′′ form a segment, i=B(j−1)+j. These segments are shown in bold lines in Figure 7(a). (b) The edges between path vertices of f ′ and f ′′ are drawn on two different segments. All the other edges of f ′′ are drawn as separate segments, which are shown as thin lines in Figure 7(a). The gray region in Figure 7(a) shows Γ′ . By construction, the number of segments in Γ′ is k ′ = mB + m + 3. We can observe that G admits some straight-line drawing containing all the segments of Γ′ . We now ask whether G admits a k-segment drawing that includes all the segments specified in Γ′ , where k = mB+m+3+3m. In the following we prove that such a drawing exists if and only if the given instance of 3-Partition has a positive answer. We first assume that the 3-Partition we considered has a positive answer. In other words, S can be partitioned into m subsets S1 , S2 , . . . , Sm such that each Si , 1 ≤ i ≤ m, contains exactly three integers and the sum of the integers in Si is equal to B. Since we assume that each integer in S is greater than one, each fan fi , 1 ≤ i ≤ 3m, contains at least two path vertices and requires at least one new segment to draw the edges between the path vertices. Consequently, any straight-line drawing of G that contains the segments of Γ′ requires at least k ′ + 3m = k segments. Let E ′ be the set of ribs of f ′′ that are not drawn on the

316

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

same segment as any rib of f ′ . To obtain a k-segment drawing of G, we draw each rib of each fi on the same segment as one of the ribs in E ′ . Let e1 and e2 be any two consecutive ribs of f ′ in Γ′ and let e′1 and e′2 be the ribs of f ′′ that are on the same segments as e1 and e2 , respectively. Then the number of ribs between e′1 and e′2 is B. Let the integers in any Si , 1 ≤ i ≤ m, be a, b and c, where a + b + c = B. We place the fans that have a, b and c path vertices inside the face bounded by the ribs e1 and e2 in Γ′ in such a way that each rib of a, b and c shares a segment with one of the ribs of f ′′ between e′1 and e′2 . In this way, we place the three fans with path vertices corresponding to the integers in Si in the face bounded by the pair of ribs ei and ei+1 , where 1 ≤ i ≤ m. It is now straightforward to check that the final drawing Γ of G that contains all the segments of Γ′ is a k-segment drawing. See Figure 7(b). We now assume that the given instance of 3-Partition has a negative answer and hence the set S cannot be partitioned into m subsets as described above. We prove that in that case G does not have a drawing with k or fewer segments that includes all the segments of Γ′ . Recall that any straight-line drawing of G that includes all the segments of Γ′ requires at least k segments. Suppose for a contradiction that G has a drawing Γ that includes all the segments of Γ′ with exactly k segments. Then each rib of each fi , 1 ≤ i ≤ 3m, must be drawn on the same segment as one of the ribs of E ′ . Since Γ is a planar drawing of G, each fi must be placed inside a face bounded by two consecutive ribs of f ′ . Therefore, the fans f1 , . . . , f3m are partitioned into m subsets and the total number of ribs for each set of fans must be B. Since ai < B/2, no two fans can together have B ribs. Similarly, since B/4 < ai , four or more fans cumulatively have more than B ribs. Therefore, each subset must contain exactly three fans. Hence each subset of fans corresponds to a subset Si of S that contains three integers whose sum is B. This gives a solution to the given instance of 3-Partition, a contradiction. Therefore, G cannot have a k-segment drawing that includes all the segments of Γ′ . 

w1

w2 w3 f

f

f

1

G

f

v

v

2 ... .

f

f

3m

f

u 2 B+3 uB+2 u 1 G (a)

(b)

Figure 7: Illustration for the proof of Theorem 3.

JGAA, 17(3) 301–328 (2013)

6

317

Minimum-Segment Drawings in R3

In this section, we examine the complexity of computing a minimum-segment drawing of a graph in R3 . It is straightforward to verify that The proof of Theorem 3 holds in R3 . The proof of Theorem 1 also holds in R3 since every pseudo-arrangement graph with l lines that is not an arrangement graph must require more than l segments in any of its straight line drawing in R3 . We suspect that the problem remains NP-hard in R3 even when the graph is subcubic, i.e., a graph with maximum degree three. However, we have not been able to prove the NP-hardness of the problem in its original form. We impose some constraints on the problem and show that it is NP-hard to compute a minimum-segment drawing of a maximum degree three graph in R3 , if a set of segments is pre-specified and some sets of vertices are restricted to be coplanar. A formal definition of the decision problem is as follows. Problem : 3D-Partial-Min-Seg Instance : An integer k ≥ 1, a graph G with maximum degree three, a straight-line drawing Γ of G in R3 and a subgraph G′ of G, and some subsets S1 , S2 , . . . , Sz of the vertices of G. Question : Is there a k-segment drawing Γ∗ of G in R3 that contains all the segments of Γ′ and keeps the vertices of each Si , 1 ≤ i ≤ z, coplanar? Here, Γ′ denotes the restriction of Γ to G′ . We prove the NP-hardness of 3D-Partial-Min-Seg by reduction from an NP-complete problem Monotone-Not-All-Equal-3-SAT [26], which is defined as follows. Problem : Monotone-Not-All-Equal-3-SAT Instance : A set U of variables and a collection C of clauses over U such that no clause contains a negated literal and each clause c ∈ C has exactly three literals. Question : Is there a truth assignment for U such that each clause in C has at least one true literal and at least one false literal? Let F be an instance of Monotone-Not-All-Equal-3-SAT with m literals x1 , x2 , . . . , xm and m′ clauses c1 , c2 , . . . , cm′ . We define a corresponding graph GF , a drawing Γ of GF , a subgraph G′ of GF , some subsets Si , 1 ≤ i ≤ z, of vertices of GF and an integer k such that Monotone-Not-All-Equal-3SAT has a positive solution if and only if GF admits a k-segment drawing Γ∗ in R3 that contains all the segments specified in the restriction Γ′ of Γ to G′ , and keeps all the vertices of each Si coplanar. We first define GF following the steps described below.

318

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

p

p

p

t

q t −2

pt −1

t

t

P

P

q t −2

p

t

pt −1

R2,2

P

P

(c)

.....

(b)

R2,4

R2,5

p2 p1

p1

(a)

.....

q1

q1

p1

.....

.....

..... .....

..... p2

.....

w2

p1

(d)

(e)

Figure 8: A staircase Γt in (a)–(b) positive orientations, and (c)–(d) negative orientations. (e) An example blossom for the clause c2 = x2 ∨ x4 ∨ x5 . Step 1. Observe the staircase structure Γt , t ≥ 2, in Figure 8(a). We call the leftmost vertical segment with vertices p1 , p2 , . . . , pt the spine of Γt . The vertices p1 and pt are the end vertices of Γt . The vertex qi , 1 ≤ i ≤ t−2, is the i-th contact of Γt . Let θ be the counterclockwise angle between a pre-specified plane P containing the spine and the plane containing the contact vertices when looking along the directed line from p1 to pt . A staircase is in positive orientation with respect to plane P if 0◦ ≤ θ < 180◦ as shown in Figures 8(a) and (b). Similarly a staircase is in negative orientation with respect to plane P if 180◦ ≤ θ < 360◦ as shown in Figures 8(c) and (d). In our reduction, each positive and negative orientation will correspond to a true and a false literal, respectively. Step 2. Let D be a straight-line drawing of a path v0 , v1 , . . . , vm+1 of m + 2 vertices on the XY-plane, where the coordinate of v0 is (0, 0, 0) and the coordinates of vi , 1 ≤ i ≤ m + 1, are (m′ + i, m′ + i, 0). Similarly, let D′ ′ be a straight-line drawing of a path v0′ , v1′ , . . . , vm+1 of m + 2 vertices ′ on the XY-plane, where v0 coincides with v0 and the coordinates of vi′ , 1 ≤ i ≤ m + 1, are (m′ + i, −m′ − i, 0). Let D′′ denote the single-edge ′ path vm+1 , vm+1 . See Figure 9(a). Step 3. For each j, 1 ≤ j ≤ m, add a copy of staircase Γm′ +2 such that vj and vj′ coincide with p1 and pm′ +2 of Γm′ +2 , respectively. It is straightforward to add the staircases such that the resulting drawing is a straight-line drawing in R2 and each staircase in the drawing contains the same set of segments as in Figure 8(a). Let the resulting straight-line drawing be Γ′′ . See Figure 9(a). By the j-th staircase of Γ′′ we mean the staircase with end vertices vj and vj′ . Step 4. For each clause ci , 1 ≤ i ≤ m′ , of F we construct a blossom as shown in Figure 8(e). We take a vertex wi , and for each literal xj that is in

JGAA, 17(3) 301–328 (2013)

D

v2

v3

v4

v5

v6

v1

v1

v0 = v0

v2

v3

v5

v4

319

v6

w3

w2

D

w1 v1 D

v1 v2

v3

v4

v5

v6

v2

v3

F = ( x1 v x2 v x3)

(a)

v4

v5

( x2 v x4 v x5)

v6 ( x3 v x4 v x5)

(b)

Figure 9: (a) A hypothetical illustration for Γ′′ with m = 5 and m′ = 3. The positions of the vertices do not reflect the actual coordinates. (b) Illustration for GF , where the edges not in Γ′ are shown in dashed lines. ci , 1 ≤ j ≤ m, we add a three cycle Ri,j and connect one of its vertices to wi . We then connect one of the remaining two vertices of Ri,j to the i-th contact vertex qi of j-th staircase as shown in Figure 9(b). We call the degree two vertex of Ri,j the free vertex. We denote the resulting graph by GF . We now define Si , 1 ≤ i ≤ m + 1, Γ and Γ′ . Each subset Si , 1 ≤ i ≤ m, consists of the vertices of the j-th staircase. The subset Sm+1 contains the vertices on the segments D, D′ , D′′ , the vertices on the spines and the vertices w1 , w2 , . . . , wm′ . Drawing Γ′ contains all the segments in Γ′′ and the segments determined by the shortest path between each wi and its corresponding free vertices. Figure 8(f) depicts an embedding of GF , where the edges do not belong to Γ′ are shown as dashed lines. It is easy to obtain a drawing Γ of GF by embedding the dashed edges above the plane containing all the segments of Γ′ . See Figure 10. Observe that one can construct GF and Γ′ , hence Γ, in f (m, m′ ) time, where the function f is a polynomial in m and m′ . We now prove the following theorem. Theorem 4 3D-Partial-Min-Seg is NP-Complete. Proof: Given a drawing Γ of G, in polynomial time in the input length of the 3D-Partial-Min-Seg instance we can certify whether Γ is a k-segment drawing containing all the pre-specified segments and whether all the vertices of each pre-specified subset are coplanar. Thus the problem is in NP. To prove the problem is NP-hard we reduce Monotone-Not-All-Equal-3-SAT to 3DPartial-Min-Seg. Let F be an instance of Monotone-Not-All-Equal-3SAT. Let x1 , x2 , . . . , xm and c1 , c2 , . . . , cm′ be the distinct literals and clauses in

320

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

v6

v5

v1

v2

v3

v4

w1

v0 = v0 v1

v2

v3

v4

v5

v6

Figure 10: A sketch for the drawing Γ of GF , where only one blossom is illustrated. F , respectively. We construct the corresponding graph GF , subsets Si , 1 ≤ i ≤ m + 1, a drawing Γ(GF ) of G and a drawing Γ′ ⊆ Γ(GF ) of a subgraph of GF . Let k ′ be the number of segments in Γ′ . We prove that F has an affirmative solution if and only if GF admits a k-segment drawing, k = k ′ + 2m′ , that contains all the segments of Γ′ and keeps the vertices of each Si coplanar. Consider first the case when GF admits a k-segment drawing Γ that contains all the segments of Γ′ and keeps the vertices of each Si coplanar. We now prove that F has an affirmative solution. Let wi be the vertex in Γ that corresponds to the clause ci . By construction, each edge adjacent to wi is incident to a vertex of some cycle Ri,j , where Ri,j contains exactly three vertices. In any straight-line drawing, Ri,j is drawn as a triangle. The three sides of that triangle correspond to three distinct segments in Γ. Observe that at least one of these segments consists of only one edge and hence, that segment does not belong to Γ′ . See Figure 11(a). Since there are 3m′ such cycles, there are 3m′ such segments in Γ that are not in Γ′ . On the other hand, since deg(wi ) = 3, at most two segments of Γ′ that are incident to wi can share a single segment in Γ. See Figure 11(b). Hence the number of segments in Γ may be decreased by at most m′ . Therefore, Γ cannot contain fewer than k = k ′ + 3m′ − m′ = k ′ + 2m′ segments. We may thus assume that Γ contains exactly k-segments. Consequently, the following properties hold. (a) For each i, 1 ≤ i ≤ m′ , two segments among the three segments that are incident to wi in Γ′ form a single segment in Γ. (b) Every contact vertex becomes an interior vertex of some segment in Γ. (c) Every cycle Ri,j contributes exactly one segment in Γ that does not belong to Γ′ . Let l and l′ be the two segments that are incident to wi in Γ′ and form a single segment in Γ. Let P be the plane that contains the vertices of Sm+1 . We consider two cases.

JGAA, 17(3) 301–328 (2013)

321

Case 1. If l and l′ both lie on P , then Properties (b) and (c) ensure that the two staircases connected to wi through l and l′ lie on P . To avoid edge crossings in Γ, one of these two staircases must be in positive orientation and the other staircase must be in negative orientation and lying on P . An example is shown in Figure 11(c).

wi

R wi

(a)

wi

.....

.....

wi

(b)

(c)

(d)

Figure 11: (a) A drawing of R, where a segment with only one edge is shown in dashed line. (b) Illustration for Γ′ . The positions of the vertices do not reflect the actual coordinates. (c)–(d) Illustration for truth value assignment. Case 2. If l does not lie on P , then l and l′ must lie on opposite sides of P . Without loss of generality assume that the staircase connected to wi through l is in positive orientation with respect to P . Then the staircase connected to wi through l′ is in negative orientation with respect to P . An example is shown in Figure 11(d). In both cases, each wi must be connected with at least one positively oriented staircase and one negatively oriented staircase. Thus each clause can be satisfied by setting the literals associated with the positively oriented staircases to “true” and the literals associated with the negatively oriented staircases to “false”. The restriction that the vertices of each Si lie on the same plane ensures that the truth values are assigned consistently. Hence, we obtain the required truth assignment for F . We now assume that F has an affirmative solution. In the following we construct a k-segment drawing Γ of G that contains all the segments of Γ′ and keeps the vertices of each Si on the same plane. Figure 12 shows a sketch for an example of Γ. Step 1. For each true literal (false literal) in F , rotate the corresponding staircase in Γ around its spine through 45◦ anticlockwise (clockwise). Step 2. Place each vertex wi to the right of D′′ on P . Step 3. Since each clause in F contains a positive and a negative literal, we can take the corresponding pair of segments that are incident to wi and

322

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

v7

v6

v2

v3

v4

v5 w2 w1

v1 = v1 v2

v3

v4

v5

v6

v7

Figure 12: A sketch for Γ, where F = (x1 ∨x2 ∨x3 )∧(x2 ∨x4 ∨x5 )∧(x3 ∨x4 ∨x5 ) and x1 = 1, x2 = 0, x3 = 0, x4 = 1, x5 = 0. The staircases in positive and negative orientations are shown in light-gray and dark-gray, respectively. align them vertically so that they form a single segment. Now complete the connection with the staircases in such a way that the corresponding cycle Ri,j contributes at most one segment that does not belong to Γ′ . Step 4. The remaining segment s that is incident to wi in Γ′ does not require any special treatment. Consequently, it is straightforward to connect wi with the corresponding staircase through s, creating at most one new segment. Observe that Γ has k ′ segments of Γ′ , and 2m′ more segments by Steps 3–4. Consequently, Γ is a k = k ′ + 2m′ segment drawing. 

7

Segment Complexity of Planar Graphs

In this section we give lower bounds on the segment complexities of different classes of planar graphs. Recall that the segment complexity of a planar graph G is the minimum positive integer C, such that any spanning tree of G admits a drawing with at most C segments. Dujmovi´c et al. [6] proved that if the number of odd degree vertices in a tree is η, then any straight-line drawing of the tree requires at least η/2 segments. If a spanning tree T of G has x leaves, then x ≤ η and any straight-line drawing of the tree requires at least x/2 segments. Thus we have the following observation. Observation 3 Let G be a planar graph with a spanning tree T , where the number of leaves is x. Then x/2 is a lower bound on the segment complexity of G. By Observation 3, we obtain a lower bound on the segment complexity of a planar graph by finding a spanning tree with many leaves. A maximum-leaf spanning tree of a graph G is a spanning tree of G, where the number of leaves is the maximum possible. It is NP-hard to find a maximum-leaf spanning tree

JGAA, 17(3) 301–328 (2013)

323

in a graph G, even when G is a planar bipartite graph with maximum degree four [19]. In the following we obtain lower bounds on segment complexities for maximal outerplanar graphs, plane 2-trees, plane 3-trees, plane 3-connected graphs and plane 4-connected graphs. Recall that a graph G with n vertices is a k-tree if G satisfies the following properties: (a) If n = k, then G is the complete graph Kn . (b) If n > k, then G can be constructed from a k-tree G′ with n − 1 vertices by adding a vertex adjacent to exactly k vertices of G′ , where the induced graph of these k-vertices is a complete graph. Every k-tree G = (V, E) admits an ordered partition π = (V1 , V2 , ..., Vm ) of V that satisfies the following: (a) V1 contains k vertices inducing a complete graph and every other partition contains only one vertex. (b) Let Gk , 1 ≤ k ≤ m, be the subgraph of G induced by V1 ∪ V2 ∪ ... ∪ Vk . Then Gk , k > 1, is a k-tree obtained by adding Vk to Gk−1 . Every 2-tree is 3-colorable. The following lemma finds a spanning tree of a plane 2-tree using graph coloring. Lemma 5 Let G be a 2-tree with n ≥ 3 vertices. Let S be a set of vertices that are assigned the same color c in a 3-coloring of G. Then G − S is a tree. Proof: Let π = (V1 , V2 , ..., Vm ) be an ordered partition of V and let Si denote a set of vertices in Gi that are assigned the same color c in a 3-coloring of Gi . We now use induction on m. The case when m = 1 is straightforward since G1 is K2 . We thus assume that for each Gi , 1 ≤ i ≤ m − 1, Gi − Si is a tree. Now consider Gm = G. Let z be the vertex in Vm and let x and y be its neighbors. By the definition of plane 2-tree, x and y are adjacent. We assume that G is colored with colors c1 , c2 , c3 such that color(x)=c1 , color(y)=c2 and color(z)=c3 . If c=c3 , then G−S=Gm−1 −Sm−1 is a tree by induction. If c= c1 or c = c2 , then G−S is formed by connecting vertex z to Gm−1 −Sm−1 with exactly one edge. Since Gm−1 −Sm−1 is a tree, G−S is a tree.  We use Lemma 5 to prove the following lemma. Lemma 6 Let G be a plane 2-tree with n ≥ 3 vertices. Then the segment complexity of G is at least n/6. Proof: We show that every plane 2-tree G with n ≥ 3 vertices has a spanning tree T , where the number of leaves in T is at least n/3. By Observation 3, this will prove that the segment complexity of G is at least n/6. Every plane 2-tree admits a 3-coloring. Let Si , 1 ≤ i ≤ 3, be a set of vertices that are assigned color i in a 3-coloring of G. The set with the maximum cardinality among S1 , S2 and S3 contains at least n/3 vertices. Without loss of generality assume that the set with the maximum cardinality is S1 , that is, |S1 | ≥ n/3. By Lemma 5, G − S1 is a tree, which we denote by T ′ .

324

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

Let v be a vertex in S1 . Since S1 is an independent set and G is connected, there exists an edge (x, v), where x is a vertex of T ′ . Therefore, we can connect v to x to obtain another tree that contains v as one of its leaves. By making the vertices of S1 leaves in T ′ , we can obtain a spanning tree T with at least n/3 leaves.  Since every outerplanar graph is a 2-tree, the following corollary follows from Lemma 6. Corollary 2 Let G be a maximal outerplanar graph with n ≥ 3 vertices. Then the segment complexity of G is at least n/6. Every plane 3-tree G has a spanning tree with at least (2n − 5)/3 leaves [29]. Furthermore, Kleitman and West [18] proved that every plane 4-connected graph has a spanning tree with at least 2n/5 leaves, and every plane 3-connected graph has a spanning tree with at least n/4 leaves. We combine these results with Observation 3 to obtain the following theorem. Theorem 5 The segment complexities of plane 2-trees, plane 3-trees, plane 4connected graphs and plane 3-connected graphs are at least n/6, (2n − 5)/6, n/5 and n/8, respectively.

8

Conclusion

Among other results, we have proved that it is NP-hard to decide whether a plane graph G has a straight-line drawing with k segments. This motivates us to ask the following questions. Open Problem 1: Is there a constant-factor approximation algorithm for minimum-segment drawings of planar graphs? We proved that it is NP-hard to compute a minimum-segment drawing of a maximum degree three graph in R3 , if a set of segments is pre-specified and some vertices are restricted to lie on the same plane. However, the problem remains open when no constraints are imposed. Open Problem 2: What is the complexity of deciding whether a graph with maximum degree three has a k-segment drawing in R3 ? A minimum-segment drawing becomes more visually coherent if we minimize the number of distinct lines that contain the segments of the drawing. We call such a drawing a minimum-line drawing. Figures 13(a) and (b) depict two different minimum-segment drawings of a tree, where the number of lines are 7 and 6, respectively. Since the number of distinct slopes used in both figures is two, the problem of computing a minimum-line drawing is different from the problem of minimizing the number of distinct slopes. Open Problem 3: Compute non-trivial upper bounds on the number of lines required for minimum-line drawings of different classes of planar graphs.

JGAA, 17(3) 301–328 (2013)

(a)

325

(b)

Figure 13: (a) A minimum-segment drawing. (b) A minimum-segment drawing, which is also a minimum-line drawing. Lines are shown in dotted lines.

Acknowledgment The authors wish to thank Therese Biedl for bringing their attention to an error in Lemma 3 in an earlier version of the paper [8], and the anonymous reviewers for their helpful comments and suggestions.

326

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

References [1] P. Angelini, G. Di Battista, F. Frati, V. Jel´ınek, J. Kratochv´ıl, M. Patrignani, and I. Rutter. Testing planarity of partially embedded graphs. In Proc. of ACM-SIAM Symposium on Discrete Algorithms (SODA 2010), pages 202–221, 2010. [2] S. Biswas, D. Mondal, R. I. Nishat, and M. S. Rahman. Minimum-segment convex drawings of 3-connected cubic plane graphs. In Proc. of the 16th Annual International Computing and Combinatorics Conference (COCOON 2010), pages 182–191, 2010. doi:10.1007/978-3-642-14031-0_21. [3] P. Bose, H. Everett, and S. K. Wismath. Properties of arrangement graphs. International Journal of Computational Geometry and Applications, 13(6):447–462, 2003. doi:10.1142/S0218195903001281. [4] H. de Fraysseix and P. O. de Mendez. Barycentric systems and stretchability. Discrete Applied Mathematics, 155(9):1079–1095, 2007. doi:10.1016/j.dam.2005.12.009. [5] E. Di Giacomo, W. Didimo, G. Liotta, H. Meijer, and S. K. Wismath. Point-set embeddings of trees with given partial drawings. Computational Geometry: Theory & Application, 42(6-7):664–676, 2009. doi:10.1016/j.comgeo.2009.01.001. [6] V. Dujmovi´c, D. Eppstein, M. Suderman, and D. R. Wood. Drawings of planar graphs with few slopes and segments. Computational Geometry: Theory & Application, 38(3):194–212, 2007. doi:10.1016/j.comgeo.2006.09.002. [7] V. Dujmovi´c, M. R. Fellows, M. Kitching, G. Liotta, C. McCartin, N. Nishimura, P. Ragde, F. A. Rosamond, S. Whitesides, and D. R. Wood. On the parameterized complexity of layered graph drawing. Algorithmica, 52(2):267–292, 2008. doi:10.1007/s00453-007-9151-1. [8] S. Durocher, D. Mondal, R. I. Nishat, and S. Whitesides. A note on minimum-segment drawings of planar graphs. In Proc. of the 23rd Canadian Conference on Computational Geometry (CCCG 2011), pages 303– 308, 2011. [9] S. Felsner and N. Morawe. Infeasibility of systems of halfspaces. Discrete & Computational Geometry, pages 405–424, 2001. doi:10.1007/978-3-642-55566-4_18. [10] S. Felsner and P. Valtr. Coding and counting arrangements of pseudolines. Discrete & Computational Geometry, 46(3):405–416, 2011. doi:10.1007/s00454-011-9366-4. [11] M. R. Garey and D. S. Johnson. Computers and Intractability. Freeman, San Francisco, 1979.

JGAA, 17(3) 301–328 (2013)

327

[12] J. E. Goodman and R. Pollack. Semispaces of configurations, cell complexes of arrangements. Journal of Combinatorial Theory, Series A, 37(3):257– 293, 1984. doi:10.1016/0097-3165(84)90050-5. [13] J. E. Goodman, R. Pollack, and B. Sturmfels. Coordinate representation of order types requires exponential storage. In Proceedings of the 21st Annual ACM Symposium on Theory of Computing (STOC), Seattle, Washigton, USA, pages 405–410. ACM, May 14–17 1989. doi:10.1145/73007.73046. [14] R. Haas and M. Hoffmann. Chordless paths through three vertices. Theoretical Computer Science, 351(3):360–371, 2006. doi:10.1016/j.tcs.2005.10.021. [15] C. Homan, A. Pavlo, and J. Schull. Smoother transitions between breadth-first-spanning-tree-based drawings. In Proc. of the 14th International Symposium on Graph Drawing (GD 2006), pages 442–445, 2006. doi:10.1007/978-3-540-70904-6_43. [16] S.-H. Hong and P. Eades. Drawing planar graphs symmetrically, III: Oneconnected planar graphs. Algorithmica, 44(1):67–100, 2006. doi:10.1007/s00453-005-1149-y. [17] S.-H. Hong and H. Nagamochi. A linear-time algorithm for symmetric convex drawings of internally triconnected plane graphs. Algorithmica, 58(2):433–460, 2010. doi:10.1007/s00453-008-9275-y. [18] D. J. Kleitman and D. B. West. Spanning trees with many leaves. SIAM Journal on Discrete Mathematics, 4(1):99–106, 1991. doi:10.1137/0404010. [19] P. C. Li and M. Toulouse. Variations of the maximum leaf spanning tree problem for bipartite graphs. Information Processing Letters, 97:129–132, 2006. doi:10.1016/j.ipl.2005.10.011. [20] A. V. Mani and I. S. Hamid. Induced acyclic path decomposition in graphs. International Journal of Mathematical and Computer Sciences, 6(3):166– 169, 2010. [21] M. Mezzini. On the complexity of finding chordless paths in bipartite graphs and some interval operators in graphs and hypergraphs. Theoretical Computer Science, 411(7–9):1212–1220, 2010. doi:10.1016/j.tcs.2009.12.017. [22] T. Munzner. Drawing large graphs with H3Viewer and site manager (system demonstration). In Proc. of the 6th Annual Symposium on Graph Drawing (GD 1998), pages 384–393, 1998. doi:10.1007/3-540-37623-2_30.

328

Durocher, Mondal, Nishat, Whitesides Minimum-Segment Drawings

[23] S. C. Ntafos and S. L. Hakimi. On path cover problems in digraphs and applications to program testing. IEEE Transactions on Software Engineering, 5(5):520–529, 1979. doi:10.1109/TSE.1979.234213. [24] M. Patrignani. On extending a partial straight-line drawing. International Journal of Foundations of Computer Science, 17(5):1061–1070, 2006. doi:10.1142/S0129054106004261. [25] M. A. H. Samee, M. J. Alam, M. A. Adnan, and M. S. Rahman. Minimum segment drawings of series-parallel graphs with the maximum degree three. In Proc. of the 16th Annual Symposium on Graph Drawing (GD 2008), pages 408–419, 2008. doi:10.1007/978-3-642-00219-9_40. [26] T. J. Schaefer. The complexity of satisfiability problems. In Proc. of Symposium on Theory of Computing (STOC 1978), pages 216–226, 1978. doi:10.1145/800133.804350. [27] G. Steiner. On the k-path partition of graphs. Theoretical Computer Science, 290(3):2147–2155, 2003. doi:10.1016/S0304-3975(02)00577-7. [28] The Cooperative Association for Internet Data Analysis. http://www.caida.org/tools/visualization/walrus/.

Walrus.

[29] F. Zickfeld. Geometric and Combinatorial Structures on Graphs. PhD dissertation, Technische Universit¨at Berlin, 2007.