Journal of Graph Algorithms and Applications Vol
Total Page:16
File Type:pdf, Size:1020Kb
Journal of Graph Algorithms and Applications http://jgaa.info/ vol. 0, no. 0, pp. 0{0 (0) DOI: 10.7155/jgaa.00456 On the NP-hardness of GRacSim drawing and k-SEFE Problems L. Grilli 1 1Department of Engineering, University of Perugia, Italy Abstract We study the complexity of two problems on simultaneous graph draw- ing. The first problem, GRacSim drawing, asks for finding a simul- taneous geometric embedding of two planar graphs, sharing a common subgraph, such that only crossings at right angles are allowed, and every crossing must involve a private edge of one graph and a private edge of the other graph. The second problem, k-SEFE, is a restricted version of the topological simultaneous embedding with fixed edges (SEFE) problem, for two planar graphs, in which every private edge may receive at most k crossings, where k is a prescribed positive integer. We show that GRacSim drawing is NP-hard and that k-SEFE is NP-complete. The NP-hardness of both problems is proved using two similar reductions from 3-Partition. Submitted: Reviewed: Revised: Accepted: Final: May 2017 July 2017 August 2017 October 2017 October 2017 Published: Article type: Communicated by: Regular paper M. Bekos, M. Kaufmann, F. Montecchiani Research supported in part by the project \Algoritmi e sistemi di analisi visuale di reti comp- lesse e di grandi dimensioni" - Ricerca di Base 2017, Dipartimento di Ingegneria dell'Universit`a degli Studi di Perugia. A preliminary version of this article is available at arXiv:1611.04178. E-mail address: [email protected] (L. Grilli) JGAA, 0(0) 0{0 (0) 1 1 Introduction The problem of computing a simultaneous embedding of two or more graphs has been extensively explored by the graph drawing community. Indeed, besides its inherent theoretical interest [6], it has several applications in dynamic network visualization, especially when a visual analysis of an evolving network is needed. Although many variants of this problem have been investigated so far, a general formulation for two graphs can be stated as follows: Let G1 = (V1;E1) and G2 = (V2;E2) be two planar graphs sharing a common (or shared) subgraph G = (V; E), where V = V1 \ V2 and E = E1 \ E2. Compute a planar drawing Γ1 of G1 and a planar drawing Γ2 of G2 such that the restrictions to G of these drawings are identical. By overlapping Γ1 and Γ2 in such a way that they perfectly coincide on G, it follows that edge crossings may only occur between a private edge of G1 and a private edge of G2, where a private (or exclusive) edge of Gi is an edge of Ei n E (i = 1; 2). Depending on the drawing model adopted for the edges, two main variants of the simultaneous embedding problem have been proposed: topological and ge- ometric. The topological variant, known as Simultaneous Embedding with Fixed Edges (or SEFE for short), allows the edges of Γ1 and Γ2 to be drawn as arbitrary open Jordan curves, provided that every edge of G is represented by the same curve in Γ1 and Γ2. Instead, the geometric variant, known as Simul- taneous Geometric Embedding (or SGE for short), imposes that Γ1 and Γ2 are two straight-line drawings. The SGE problem is therefore a restricted version of SEFE, and it turned out to be \too much restrictive", i.e. there are examples of pairs of structurally simple graphs, such as a path and a tree [3], that do not admit an SGE. Also, testing whether two planar graphs admit a simultaneous geometric embedding is NP-hard [8]. Compared with SGE, pairs of graphs of much broader families always admit a SEFE, in particular there always exists a SEFE when the input graphs are a planar graph and a tree [9]. In contrast, it is a long-standing open problem to determine whether the exis- tence of a SEFE can be tested in polynomial time or not, for two planar graphs; though, the testing problem is NP-complete when generalizing SEFE to three or more graphs [13]. However, several polynomial time testing algorithms have been provided under different assumptions [1,2,6,7,14,15], most of them involve the connectivity or the maximum degree of the input graphs or of their common subgraph. In this paper we study the complexity of the Geometric Rac Simultane- ous drawing problem [4] (GRacSim drawing for short): a restricted version of SGE, which asks for finding a simultaneous geometric embedding of two pla- nar graphs, such that all edge crossings must occur at right angles; of course, analogously to the SGE problem, every crossing must involve a private edge of G1 and a private edge of G2. We first describe a general NP-hardness con- struction that transforms an instance of 3-Partition into a suitable instance of SEFE; see Section 3. Based on this construction, we show that GRacSim drawing is NP-hard; see Section 4. Moreover, we introduce a new restricted version of the SEFE problem, called k-SEFE, in which every private edge may 2 L. Grilli On the NP-hardness of GRacSim drawing and of k-SEFE receive at most k crossings, where k is a prescribed positive integer. We then show that even k-SEFE is NP-complete for any fixed positive k (see Section 5), to prove the NP-hardness we still use a reduction from 3P, based on the con- struction given in Section 3. 2 Preliminaries Let G = (V; E) be a simple graph. A drawing Γ of G maps each vertex of V to a distinct point in the plane and each edge of E to a simple Jordan curve connecting its end-vertices. The drawing Γ is planar if no two distinct edges intersect, except at common end-vertices. Also, Γ is a planar straight- line drawing if it is planar and all its edges are represented by straight-line segments. The graph G is planar if it admits a planar drawing. A planar drawing Γ of G partitions the plane into topologically connected regions called faces. The unbounded face is called the external (or outer) face; the other faces are the internal (or inner) faces. A face f is described by the circular ordering of vertices and edges that are encountered when walking along its boundary in clockwise direction if f is internal, and in counterclockwise direction if f is external. A planar embedding of a planar graph G is an equivalence class of planar drawings that define the same set of faces for G. An outerplanar graph is a (planar) graph that admits a planar embedding in which all vertices belong to a same face. For a fixed positive integer n, a ladder Ln is a graph that can be obtained by the Cartesian product of a path with n vertices and a graph consisting of a single edge. In other words, Ln is an outerplanar graph with 2n vertices and n + 2(n − 1) edges, which consists of two n-vertex paths, called side paths, along with a set of n edges, called rungs, connecting the i-th vertex of the first side path to the i-th vertex of second side path (1 ≤ i ≤ n); we will say that a rung edge is in odd (respectively, even) position if its end-vertices are in odd (respectively, even) position along their own side paths. For every n > 1, a ladder Ln contains n−1 4-cycles, which are called the cells of the ladder; observe that in an outerplanar embedding of Ln no cell contains another. A wheel is a graph consisting of a cycle C plus a vertex c and a set of edges connecting c to every vertex of C; vertex c is the center of the wheel. 3 NP-hardness Construction The NP-hardness results given in this paper use two very similar reductions from 3-Partition (3P) that rely on a same construction; we refer to the fol- lowing formulation of 3P. Problem: 3-Partition (3P) Instance: A positive integer B, and a multiset A = fa1; a2; : : : ; a3mg of 3m natural numbers with B=4 < ai < B=2 (1 ≤ i ≤ 3m). Question: Can A be partitioned into m disjoint subsets A1;A2;:::;Am, such that each Aj (1 ≤ j ≤ m) contains exactly 3 elements of A, whose sum is B? JGAA, 0(0) 0{0 (0) 3 t t W1 Wj Wm π1 πj πm v0 v1 vj−1 vj vm s s (a) Pumpkin gadget (b) Slice gadget Figure 1: (a) Illustration of a pumpkin gadget (thick style) including a basic schema- tization of all the transversal paths (dashed style); we recall that every transversal path consists of an alternating sequence of 2B + 1 non-shared edges. (b) Illustration of a slice gadget encoding integer 5. In this section, we describe this construction, which transforms an instance of 3P into an instance of SEFE, and illustrate the basic idea of our reductions. We recall that 3P is a strongly NP-hard problem [11], i.e., it remains NP-hard even if B is bounded by a polynomial in m. Also, a trivial necessary condition for P3m the existence of a solution is that i=1 ai = mB, therefore it is not restrictive to consider only instances satisfying this equality. Let A = fa1; a2; : : : ; a3mg be an instance of 3P. We now describe in detail a procedure to incrementally construct an instance hG1;G2i of SEFE starting from A; see Fig. 1 for an illustration of this construction and Fig. 2(b) for an example of an input instance.