On the $\mathcal{NP}$-hardness of GRacSim Drawing and k-SEFE Problems

We study the complexity of two problems in simultaneous graph drawing. The first problem, GRacSim Drawing, asks for finding a simultaneous geometric embedding of two graphs such that only crossings at right angles are allowed. 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 $\mathcal{NP}$-hard and that k-SEFE is $\mathcal{NP}$-complete. The $\mathcal{NP}$-hardness of both problems is proved using two similar reductions from 3-Partition.


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 [1,2,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,22,23,24,25,26], 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 G 1 = (V 1 , E 1 ) and G 2 = (V 2 , E 2 ) be two planar graphs sharing a common (or shared) subgraph G = (V, E), where V = V 1 ∩ V 2 and E = E 1 ∩ E 2 . Compute a planar drawing Γ 1 of G 1 and a planar drawing Γ 2 of G 2 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 G 1 and a private edge of G 2 , where a private (or exclusive) edge of G i is an edge of E i \ 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 geometric. The topological variant, known as SIMULTANEOUS EMBEDDING WITH FIXED EDGES (or SEFE for short), allows to draw the edges of Γ 1 and Γ 2 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 SIMULTANEOUS 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 [6], that do not admit an SGE. Also, testing whether two planar graphs admit a simultaneous geometric embedding is N P-hard [16]. 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 [18]. In contrast, it is a long-standing open problem to determine whether the existence of a SEFE can be tested in polynomial time or not, for two planar graphs; though, the testing problem is N P-complete when generalizing SEFE to three or more graphs [22]. However, several polynomial time testing algorithms have been provided under different assumptions [3,4,11,12,24,26], 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 SIMULTANEOUS DRAWING problem [8] (GRACSIM DRAWING for short): a restricted version of SGE, which asks for finding a simultaneous geometric embedding of two graphs, such that all edge crossings must occur at right angles. We show that GRACSIM DRAWING is N P-hard by a reduction from 3-PARTITION; see Section 3. Moreover, we introduce a new restricted version of the SEFE problem, called K-SEFE, in which every private edge may receive at most k crossings, where k is a prescribed positive integer. We then show that K-SEFE is N P-complete for any fixed positive k, to prove the N P-hardness we use a similar reduction technique as that for GRACSIM DRAWING; see Section 4.

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. Drawing Γ is planar if no two distinct edges intersect, except at common end-vertices. Γ is a straight-line planar drawing if it is planar and all its edges are represented by straight-line segments. 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. A plane graph is a planar graph with an associated planar embedding and a prescribed outer face. Let H be a plane graph. The weak dual H * of H is a graph whose vertices correspond to the internal faces of H, and there is an edge between two vertices if the corresponding internal faces in H share one or more edges. A fan is a graph formed by a path π plus a vertex v and a set of edges connecting v to every vertex of π; vertex v is called the apex of the fan. 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.

NP-hardness of GRACSIM DRAWING
In this section, we study the complexity of the following problem.
. Question: Are there two straight-line planar drawings Γ 1 and Γ 2 , of G 1 and G 2 , respectively, such that (i) every vertex is mapped to the same point in both drawings, and (ii) any two crossing edges e 1 and e 2 , with e 1 ∈ E 1 \ E and e 2 ∈ E 2 \ E, cross only at right angle? Theorem 1. Deciding whether two graphs have a GRACSIM DRAWING is N P-hard.
Proof. We prove the N P-hardness by a reduction from 3-PARTITION (3P).
contains exactly 3 elements of A, whose sum is B? We recall that 3P is a strongly N P-hard problem [20], i.e., it remains N P-hard even if B is bounded by a polynomial in m. Also, a trivial necessary condition for the existence of a solution is that 3m i=1 a i = mB, therefore it is not restrictive to consider only instances satisfying this equality.
We first give an overview of this reduction, then we describe in detail the construction for transforming an instance of 3P into an instance G 1 , G 2 of GRACSIM DRAWING, and finally we prove that an instance of 3P is a Yes-instance if and only if the transformed instance G 1 , G 2 admits a GRACSIM drawing.
OVERVIEW The transformed instance G 1 , G 2 of GRACSIM DRAWING is obtained by combining a subdivided pumpkin gadget with 3m subdivided slice gadgets and m transversal paths; see Fig. 1 for an illustration. A pumpkin gadget consists of a biclique K 2,m+1 plus an additional edge, called the handle, that connects two vertices of the partite set of cardinality m+1; the two vertices of the other partite set are the poles of the pumpkin. A subdivided pumpkin is a pumpkin where each edge, other than the handle, is subdivided exactly once, while the handle is subdivided twice. We remark that it is not strictly necessary to use a subdivided pumpkin instead of a normal pumpkin, the only reason is to exploit the subdivision vertices as bend points, in this way we get more readable and compact GRACSIM drawings. Hereafter, when it is not ambiguous, we will use the terms pumpkin and slice in place of subdivided pumpkin and of subdivided slice, respectively. All the edges of a pumpkin are shared edges, that is, they belong to both graphs, therefore they cannot be crossed in any GRACSIM drawing. Moreover, any planar embedding of a subdivided pumpkin contains exactly two faces of degree seven and m faces of degree eight, the latter are called wedges and are the only (c) Wedge Wj, transversal path πj, and subdivided slices Sj1, Sj2, and Sj3  incident to both poles. Wedges are used to contain (subdivided) slice gadgets, which are 3m subgraphs attached to the two poles of the pumpkin, with no other vertices in common with each other and with the pumpkin. Every slice has a "width" that suitably encodes a distinct element a i of A-recall that two distinct elements could be equaland the structure of a slice is sufficiently "rigid" so that overlaps and nestings among slices cannot occur in a GRACSIM drawing. The basic idea of the reduction is to get the subsets A j (1 ≤ j ≤ m) of a solution of 3P, in case one exists, by looking at the slices in each wedge of a GRACSIM drawing, which implies that every wedge must contain exactly three slices whose widths sum to B. Of course, without introducing some further gadget, each wedge could contain even all slices, i.e. its width can be considered unlimited. Hence, in order to make all wedges of the same width B, m transversal paths are attached to the pumpkin, one for each wedge. Precisely, a transversal path is an alternating path that connects the two vertices of a wedge other than the poles and the subdivision vertices, and it contains only non-shared edges that belong alternatively to G 1 and to G 2 . Therefore, the pumpkin plus the transversal paths form a subdivision of a maximal planar graph, which has a unique embedding (up to a choice of the external face). Further, every transversal path has an "effective length" that encodes the integer B, which also establishes the width of the corresponding wedge. Crossings between slices and transversal paths are thus unavoidable in a GRACSIM drawing, because every transversal path splits its wedge into two parts, separating the two poles of the pumpkin; clearly, every slice crosses only one transversal path. However, by choosing a suitable structure for the slices, it is possible to form only crossings that are allowed in a GRACSIM drawing. The key factor of the reduction is to make it possible if and only if each slice of width a i can cross a portion of its transversal path with an effective length greater than or equal to a i . In other words, the slice structure and the transversal path effective length are defined in such a way that, in a GRACSIM drawing, (i) every transversal path cannot cross more than three slices, and (ii) the total width of the slices crossed by a same transversal path equals integer B, which yields a solution of 3P. CONSTRUCTION We now describe in detail a procedure to incrementally construct an instance G 1 , G 2 of GRACSIM DRAWING starting from an instance of 3P. At each step, this procedure adds one or more subgraphs (gadgets) to the current pair of graphs. As G 1 and G 2 have the same vertex set, for each added subgraph we will only specify which edges are shared and which are exclusive; the final vertex set will be known implicitly.
Start with a biclique K 2,m+1 , and denote by s, t and by v 0 , v 1 , . . . , v m its vertices of the partite sets of cardinality 2 and m + 1, respectively. Add edge h = (v 0 , v m ) to the biclique, subdivide h twice, and denote by π h the resulting 3-edge path. Then, for every 0 ≤ j ≤ m, subdivide edge (s, v j ) ((t, v j ), respectively) exactly once, denote the subdivision vertex by v s j (v t j , respectively) and the 2-edge path obtained from this subdivision by π s (j) (π t (j), respectively). The resulting graph G p is the subdivided pumpkin and all its edges are shared edges, i.e. G p ⊂ G; vertices s and t are the poles of the pumpkin, while π h is called the subdivided handle of the pumpkin.
Connect each pair of vertices v j−1 , v j (1 ≤ j ≤ m) of G p with a transversal path π j , consisting of 2B + 1 non-shared edges, so that edges in odd positions (starting from v j−1 ) are private edges of G 1 , while those in even positions are private edges of G 2 ; hence, every transversal path starts and ends with an edge of G 1 and has exactly 2B inner vertices. Integer B represents the effective length of a transversal path, which is defined as half the number of its inner vertices.
For each integer a i ∈ A, (1 ≤ i ≤ 3m) construct a (subdivided) slice S i by suitably attaching two fan subgraphs and by subdividing a subset of their edges as follows (see, e.g., Fig.1(b)). Add a fan of a i + 2 vertices with apex at pole t and subdivide every edge incident to t exactly once; denote the resulting subdivided fan by F t i . Specularly, add a subdivided fan F s i with apex at the other pole s, having the same number of ver-tices as F t i . All the edges of F s i and F t i are shared edges, i.e. F s i ∪ F t i ⊂ G. Now, let π t i and π s i be the two paths of these fans, i.e. π t i = F t i \ {t} and π s i = F s i \ {s}. Visit path π t i starting from one of its end-vertices and denote the k-th encountered vertex by π t i (k) (1 ≤ k ≤ a i + 1); in an analogous way define the k-th vertex π s i (k) of path π s i . For each 1 ≤ k ≤ a i + 1, connect π s i (k) to π t i (k) with a private edge of G 2 . Further, for each 1 ≤ k ≤ a i , add a private edge of G 1 joining either π s i (k) to π t i (k + 1) or π t i (k) to π s i (k + 1) depending on whether k is odd or even, respectively. We conclude this construction by introducing the concepts of tunnel and of width of a slice. The tunnel ∆ i is the subgraph of S i induced by the vertices of π t i and π s i , i.e.
It is straightforward to see that every tunnel is a biconnected internally-triangulated outer-plane graph, its weak dual is a path, and it contains exactly 2a i triangles. The width w(S i ) of a slice S i is defined as half the number of triangles in its tunnel.
It is not difficult to see that the transformed instance of GRACSIM DRAWING contains 6Bm + 21m + 7 vertices and 10Bm + 20m + 7 edges, therefore its construction can be performed in polynomial time. We observe that the common subgraph is not connected. Indeed, G consists of the pumpkin G p along with all fans and all inner vertices of the transversal paths; thus, there are 2Bm isolated vertices in the common subgraph. Moreover, even G 1 and G 2 are not connected, because in addition to G they also contain their own private edges of slices S i (1 ≤ i ≤ 3m) and those of transversal paths π j (1 ≤ j ≤ m); in particular, due to the latter paths, G 1 and G 2 contain an induced matching of (B − 1)m and Bm (private) edges, respectively. CORRECTNESS We now prove that a Yes-instance of 3P is transformed into a Yesinstance of GRACSIM DRAWING, and vice-versa.
(⇒) Let A be a Yes-instance of 3P, we show how to compute a GRACSIM drawing of the transformed instance G 1 , G 2 on an integer grid; it suffices to compute the vertex coordinates, because edges are represented by straight-line segments. The drawing construction strongly relies on the concepts of square cell and of cell array. A square cell, or briefly a cell, is a 4 × 4 square, with corners at grid points, and with opposite sides that are either horizontal or vertical. The diagonal of a cell connecting the bottom-left (top-left, respectively) and the top-right (bottom-right, respectively) corners is called the positive-slope diagonal (negative-slope diagonal). The center of a cell is the intersection point of its diagonals, which meet at right angles. Every cell contains four special grid points, called anchor points, which are the corners of a 2 × 2 square having the same center as the cell; two anchor points lie on the positive-slope diagonal while the other two are on the negative-slope diagonal. A horizontal cell array CA of length l > 0 is an ordered sequence c 1 , c 2 , . . . , c l of l cells such that any two consecutive cells c p , c p+1 (1 ≤ p < l) share a vertical side; namely, the right side of c p coincide with the left side of c p+1 .
Consider now a solution {A 1 , A 2 , . . . , A m } of 3P for the instance A. For each triple A j (1 ≤ j ≤ m), denote its elements by a j1 , a j2 , a j3 , i.e. A j = {a j1 , a j2 , a j3 } ⊂ A, and denote by S j1 , S j2 and S j3 , and by ∆ j1 , ∆ j2 and ∆ j3 , the corresponding slices and their tunnels in the transformed instance. Embed each tunnel ∆ jk (1 ≤ k ≤ 3) on a horizontal array CA jk of length a jk in such a way that the private edges of G 2 are represented by the vertical sides of cells in CA jk . The private edges of G 1 are thus embedded on a sequence of a jk cell diagonals, whose slopes are alternately +1 (positive-slope diagonal) and −1 (negative-slope diagonal), starting from +1; hence, in every cell, the anchor points of one of the two diagonals are occupied, i.e. they overlap with a straight-line segment representing a private edge of G 1 , while the remaining two anchor points are (still) free.
Place cell arrays CA jk one after another, from left to right, in increasing order of j = 1, 2, . . . , m and, in case of ties, in increasing order of k = 1, 2, 3. Also, leave a horizontal gap of one cell between intra-partition consecutive arrays and a horizontal gap of two cells in case of inter-partition consecutive arrays. Concerning the vertical placement proceed as follows. Let CA and CA ′ be two arbitrary consecutive arrays (intra-or inter-partition), with CA to the left of CA ′ . If CA has an even length, then CA and CA ′ are top-and bottom-aligned along the vertical axis, while if CA has an odd length, then CA ′ is shifted down of half a cell with respect to CA. It follows that the rightmost free anchor point of CA is always horizontally aligned with the leftmost free anchor point of CA ′ . Now, let R be the smallest rectangle containing all previous cell arrays with a top, right, bottom, and left margin of one cell. Place pole t (s, respectively) at a grid point above (under, respectively) the top side (bottom side, respectively) of R, as close as possible to its vertical bisector line, leaving a vertical offset of two cells; in Fig. 1(d) we deliberately increased this offset to get a better aspect ratio. Place vertex v j (0 ≤ j < m) at the grid point that is horizontally aligned with and to the left of the first free anchor point of CA j1 , leaving a margin of one cell; also, place vertex v m at the grid point that is horizontally aligned with and one-cell to the right of the rightmost free anchor point. Observe that v 0 and v m lie on the left and right side of R, respectively. Now, embed the vertices v t j and v s j (j = 0, 1, . . . , m) of the pumpkin G p along the top and bottom side of R, respectively, in such a way that they are vertically aligned with v j . Then, embed the missing vertices of the slices in an analogous way, that is a vertex adjacent to t (s, respectively) must be vertically aligned with its neighbor in the tunnel and must lie along the top side (bottom side, respectively) of R. Concerning the handle π h , place its subdivision vertex adjacent to v 0 at the point whose xand y-coordinates are one cell to the left of v 0 and one cell above t, respectively; with a symmetrical argument choose the position of the other subdivision vertex of π h . It is not hard to see that (i) no crossing has been introduced so far; (ii) slices S j1 , S j2 and S j3 are within wedge W j (1 ≤ j ≤ m); and (iii) every triangle in a tunnel contains exactly one free anchor vertex. To complete the drawing, it remains to embed the inner vertices of transversal paths, taking into account that every path π j will unavoidably cross the three slices in its edge W j . Place these vertices at the free anchor points, so that the p-th inner vertex of π j occupies the p-th free anchor point, from left to right. It turns out that the produced crossings will always occur at right angles and involve a private edge of G 1 and a private edge of G 2 . Note that this is possible because, by construction, w(W j ) = B = w(S j1 ) + w(S j2 ) + w(S j2 ), where w(W j ) is the width of wedge W j , which is defined as the effective length of π j . Indeed, π j has 2B inner vertices, there are 2(a j1 +a j2 +a j3 ) free anchor points in W j , and a j1 +a j2 +a j3 = B, since we start from a solution of 3P.
(⇐) Let Γ 1 , Γ 2 be any GRACSIM drawing of G 1 , G 2 , and let Γ p be the drawing of G p induced by Γ 1 , Γ 2 . Also, let C j ⊂ G p (1 ≤ j ≤ m) be the cycle consisting of paths π s (j − 1), π t (j − 1), π t (j) and π s (j). We first claim that the following invariants are satisfied. (I1) C j (1 ≤ j ≤ m) is the boundary of a wedge W j in Γ p , where a wedge is a bounded or unbounded face of degree eight in Γ p . (I2) Transversal path π j (1 ≤ j ≤ m) is drawn within wedge W j . (I3) Any two slices cannot be contained one in another and do not overlap with each other except at poles s and t. (I4) Every edge of π j (1 ≤ j ≤ m) crosses at most one edge of a same slice. (I5) Every wedge contains exactly three slices.
Let R b (C j ) and R u (C j ) be the bounded and the unbounded plane regions, respectively, delimited by C j in Γ p . Since v j−1 and v j are two vertices of C j , path π j has to be drawn within either R b (C j ) or R u (C j ), otherwise an inner edge of π j would cross an edge of C j , which is not allowed in a GRACSIM drawing of G 1 , G 2 because C j ⊂ G. Also, if π j is contained in R b (C j ) (R u (C j ), respectively), then all the other paths of the pumpkin that connect the two poles s and t must be drawn within R u (C j ) (R b (C j ), respectively). Invariants I1 and I2 are thus satisfied. Concerning invariant I3, it is immediate to see that any two slices cannot be contained one in another. Further, in case of overlap, an edge e 1 of a slice S 1 would cross a boundary edge e 2 of a slice S 2 , where e 2 is a private edge of G 2 and e 1 is a private edge of G 1 . But this is not possible, because the end-vertices of e 1 are also connected in S 1 by a 2-edge path consisting of a shared edge and of a private edge of G 2 . Invariant I4 holds because every transversal path π j (1 ≤ j ≤ m) can only cross edges of tunnels in W j , and every tunnel is drawn as a straight-line internally triangulated outer-plane graph. Therefore, π j cannot enter and then exit from a triangle with a same private edge in such a way that all edge crossings are at right angles. Namely, every triangle of a tunnel in W j takes at least one inner vertex of π j . We now show that invariant I5 is satisfied. It is straightforward to see that every slice must be drawn within some wedge, and all the slices in a wedge W j are crossed by its transversal path π j . In particular, π j has to pass through the tunnels of these slices and such tunnels are pairwise disjoint and none of them contains another. Suppose by contradiction that invariant I5 does not hold. Then, there would be a wedge W p (1 ≤ p ≤ m) containing at least four slices; recall that there are 3m slices to be distributed among m wedges. Let us denote such slices by S p1 , S p2 , . . . , S pk , with k ≥ 4, and let a pl ∈ A be the integer encoded by slice S pl (1 ≤ l ≤ k). Since each element of A is strictly greater than B/4, it follows that k l=1 w(S pl ) = k l=1 a pl > k l=1 B/4 ≥ B = w(W p ), thus wedge W p is not wide enough to host all its slices, a contradiction. In other words, the alternating path π p does not have enough inner vertices to pass through all the tunnels of slices in W p avoiding crossing that are not allowed in a GRACSIM drawing. Now, for each wedge W j (1 ≤ j ≤ m), denote by S j1 , S j2 and S j3 the three slices that are within W j , and let a j1 , a j2 and a j3 be their corresponding elements of A. We claim that a j1 + a j2 + a j3 = B. Indeed, it cannot be 3 k=1 a jk > B, because it would imply that 3 k=1 w(S jk ) > w(W j ), which is not possible as seen above. On the other hand, if 3 k=1 a jk < B, there would be some i=1 a i would be strictly less than mB, which violates our initial hypothesis on the elements of A. Hence, even this case is not possible. In conclusion, every wedge W j (1 ≤ j ≤ m) contains exactly three slices S j1 , S j2 and S j3 , each of these slices has a width w(S jk ) (1 ≤ k ≤ 3) that encodes a distinct element of A, and the sum of these widths is equal to B, i.e. w(S j1 ) + w(S j2 ) + w(S j3 ) = B. Therefore, the partitioning of A defined by A 1 , A 2 , . . . , A m , where A j = {w(S j1 ), w(S j2 ), w(S j3 )}, is a solution of 3P for the instance A.
⊓ ⊔ We conclude this section with two remarks.
Remark 1. It is not hard to see that this reduction can also be used to give an alternative proof for the N P-hardness of SGE, which was proved by Estrella-Balderrama et al. [16].

N P-completeness of K-SEFE
In order to increase the readability of a simultaneous embedding, which is particularly desired in graph drawing applications, one may wonder whether it is possible to compute a SEFE, where every private edge receives at most a limited and fixed number of crossings. We recall that there is no restriction on the number of crossings that involve a private edge in a SEFE drawing. Further, two private edges may cross more than once, and these multiple crossings could be necessary for the existence of a simultaneous embedding; however, Frati et al. [19] have shown that whenever two planar graphs admit a SEFE, then they also admit a SEFE with at most sixteen crossings per edge pair. Motivated by the previous considerations, we introduce and study the complexity of the following problem, named K-SEFE, where k denotes a fixed bound on the number of crossings per edge that are allowed.
Problem: K-SEFE Instance: Two planar graphs G 1 = (V, E 1 ) and G 2 = (V, E 2 ), sharing a common subgraph G = (V, E) = (V, E 1 ∩ E 2 ), and a positive integer k. Question: Do G 1 and G 2 admit a SEFE such that every private edge receives at most k crossings?
It is straightforward to see that K-SEFE is, in general, a restricted version of SEFE. Namely, for any positive integer k, it is easy to find pairs of graphs that admit a (K+1)-SEFE, and thus a SEFE, but not a K-SEFE. For example, consider a pair of graphs G 1 = (V, E 1 ) and G 2 = (V, E 2 ) defined as follows (an illustration for k = 4 is given in Fig. 2). The common subgraph G = (V, E) is a wheel of 2k + 5 vertices, where u 0 , u 1 , . . . u k+1 , v 0 , v 1 , . . . , v k+1 are the 2(k + 2) vertices of its cycle in clockwise order, Since G has a unique planar embedding (up to a homomorphism of the plane), the private edge (u 0 , v 0 ) of G 1 crosses all the k + 1 private edges of G 2 , i.e. all the edges (u i , v k+2−i ) with 1 ≤ i ≤ k + 1. Therefore, G 1 and G 2 admit a (K+1)-SEFE, and thus a SEFE, but not a K-SEFE. Fig. 2. A pair of graphs that admit a K-SEFE only for k ≥ 5.
Proof. We use a reduction from 3P similar to that in the proof of Theorem 1; subdivision vertices are now omitted, since we are no longer in a geometric setting.
CONSTRUCTION Start with a (non-subdivided) pumpkin G p ⊂ G whose vertices v 0 , v 1 , . . . v m are adjacent to the two poles s and t, and whose handle is a single edge (v 0 , v m ). Add a transversal path π j between every pair of vertices v j−1 and v j (1 ≤ j ≤ m). Differently from the proof of Theorem 1, π j has to contain 2B − 1 inner vertices and not 2B; the reason of this will be clarified later. Also, the effective length of π j is now defined as half the number of its edges, hence it is still equal to B. Slice gadgets S i (1 ≤ i ≤ 3m) and their tunnels ∆ i are also slightly modified and are defined as follows. For each integer a i ∈ A, create an alternating path π(S i ) of 2a i non-shared edges; thus, π(S i ) has 2a i + 1 vertices and its extremal edges never belong to the same graph G i (i = 1, 2). Construct a fan F t i by adding an edge between all the pairs of consecutive vertices of π(S i ) in even positions and by connecting such vertices to the pole t of the pumpkin; F t i \ {t} is a path of a i − 1 edges, because π(S i ) has a i vertices in even positions and a i + 1 vertices in odd positions. Similarly, construct a fan F s i by connecting the pole s with a path of a i edges passing through all the vertices of π(S i ) in odd positions. Slice S i is composed from the two fans F t i and F s i plus all the edges of π(S i ). Further, all the edges of fans are shared, while those of π(S i ) are not shared and belong alternatively to G 2 and to G 1 . The tunnel ∆ i of a slice S i is the subgraph that results from S i after removing the two poles s and t, i.e ∆ i = S i \ {s, t}. It is straightforward to see that every tunnel is a biconnected internally-triangulated outerplane graph, whose weak dual is a path, and it contains exactly 2a i − 1 triangles if the corresponding slice encodes integer a i . The width w(S i ) of a slice S i is defined as half the number of private edges in its tunnel ∆ i , thus w(S i ) = a i .
It is not hard to see that the transformed instance G 1 , G 2 contains 4Bm + 9m + 3 vertices and 8Bm + 2m + 3 edges, thus its construction can be done in polynomial time. Furthermore, we observe that G, G 1 and G 2 are not connected. Indeed, G contains (2B − 1)m isolated vertices, i.e. all the inner vertices of transversal paths, while G 1 and G 2 contain an induced matching of (B − 1)m (private) edges each.  CORRECTNESS Let A be an instance of 3P, and let G 1 , G 2 be an instance of 1-SEFE obtained by using the previous transformation. We show that A admits a 3-partition if and only if G 1 , G 2 admits a 1-SEFE drawing.
(⇒) Suppose that A admits a 3-partition {A 1 , A 2 , . . . , A m }, then a 1-SEFE drawing of G 1 , G 2 can be constructed as follows. Compute a plane drawing Γ p of the pumpkin G p (see, e.g., Fig. 3(a)) such that (i) the external face is delimited by the edges (s, v 0 ), (v 0 , v m ) and (v m , s) and (ii) for each j = 1, 2, . . . , m edge (t, v j ) immediately follows edge (t, v j−1 ) in the counterclockwise edge ordering around t. Γ p contains m inner faces of degree four, delimited by edges (s, v j−1 ), (v j−1 , t), (t, v j ), (v j , s) (1 ≤ j ≤ m), which are the wedges W j of the pumpkin. Consider now each triple A j = {a j1 , a j2 , a j3 } (1 ≤ j ≤ m), and denote by S j1 , S j2 , S j3 the corresponding slices in the transformed instance. For each slice S jk (1 ≤ k ≤ 3), compute a plane drawing with both poles on the external face. Place these drawings one next to the other within wedge W j , in any order; for simplicity we may assume that S j1 is the leftmost slice, S j2 is the middle slice and S j3 is the rightmost one. Also, if necessary, flip each slice around its poles so that the leftmost private edge always belongs to G 2 ; clearly, this implies that the rightmost private edge belongs to G 1 . It is not difficult to see that the drawing produced so far is planar, i.e. even the private edges do not create crossings. Moreover, since w(W j ) = B = a j1 + a j2 + a j3 = w(S j1 ) + w(S j2 ) + w(S j3 ), every transversal path π j (1 ≤ j ≤ m) can be drawn within wedge W j in such a way that (i) every edge of π j crosses exactly one private edge of a tunnel in W j , and (ii) every crossing involves a private edge of G 1 and a private edge of G 2 .
(⇐) We conclude the proof by showing that if G 1 , G 2 admits a 1-SEFE drawing Γ 1 , Γ 2 , then A admits a 3-partition. By a similar argument as that in the proof of Theorem 1, Γ 1 , Γ 2 induces a plane drawing Γ p of the pumpkin G p , in which each wedge W j , i.e. each bounded or unbounded face of degree four of G p , is delimited by a cycle C j consisting of edges (s, v j−1 ), (v j−1 , t), (t, v j ) and (v j , s), for some 1 ≤ j ≤ m. Further, path π j has to be drawn within W j , and for each 1 ≤ i ≤ 3m, fans F t i and F s i , and thus the slice S i they belong to must be placed within a same wedge. Let S j1 , S j2 , . . . , S jk be the slices within wedge W j , for some k ≥ 0. Since every private edge receives at most one (k = 1) crossing in Γ 1 , Γ 2 , it follows that k l=1 w(S jl ) ≤ w(W j ) = B, i.e. the number of edges of π j must be greater than or equal to the number of edges of tunnels in W j . We now show that there are exactly three slices in every wedge, i.e. k = 3. It cannot be k > 3, otherwise k l=1 w(S jl ) = k l=1 a jl > k l=1 B/4 ≥ B = w(W j ). On the other hand, it cannot be k < 3, otherwise there would some other wedge with k ′ > 3 slices; recall that there are a total of 3m slices and a total of m wedges. Suppose now that 3 l=1 w(S jl ) < w(W j ) = B, for some 1 ≤ j ≤ m. Then, there would exist some j ′ = j with 1 ≤ j ′ ≤ m such that 3 l=1 w(S j ′ l ) > w(W j ′ ) = B, otherwise it would be violated the equality 3m i=1 a i = mB. In conclusion, there are exactly three slices in every wedge, and the sum of their widths coincides with B. Therefore the partitioning Proof. Concerning the N P-hardness, it suffices to repeat the proof of Theorem 2, by replacing every private edge e of each tunnel of G i (i = 1, 2) with a set of k internally vertex-disjoint paths π 1 (e), π 2 (e), . . . , π k (e), consisting each one of two private edges of G i . We now introduce some definitions and then prove the membership in N P using an approach similar to that described in [21]. An edge crossing structure χ(e 1 ) of a private edge e 1 ∈ E 1 is a pair ε 2 , σ(ε 2 ) , where ε 2 is a multiset on the set E 2 \ Fig. 4. Illustration of the 2-edge penetration vulnerability.
E with cardinality at most k, and σ(ε 2 ) is a permutation of multiset ε 2 . A crossing structure χ(G 1 , G 2 ) of a pair of graphs G 1 , G 2 is an assignment of an edge crossing structure to each private edge of E 1 . Of course, all crossing structures of G 1 , G 2 can be non-deterministically generated in a time that is polynomial in |V | = n, and they include the crossing structures induced by all K-SEFE drawings of G 1 , G 2 . We conclude the proof by describing a polynomial time algorithm for testing whether a given crossing structure χ(G 1 , G 2 ) is a crossing structure induced by some K-SEFE drawing of G 1 , G 2 . Let G ∪ be the union graph of G 1 and G 2 , i.e. G ∪ = (V, E 1 ∪E 2 ). For each edge e of G ∪ such that e ∈ E 1 \ E, consider its crossing structure χ(e) = ε 2 , σ(ε 2 ) , replace every crossing between e and the edges in ε 2 with a dummy vertex, preserving the ordering given by σ(ε 2 ), and then test the resulting (multi) graph for planarity.

⊓ ⊔
We conclude even this section with two remarks.
Remark 3. The previous reduction cannot be successfully applied to SEFE, because of the 2-edge penetration vulnerability: every transversal path π j (1 ≤ j ≤ m) can pass through all the tunnels in W j using only its two first edges; an illustration of this vulnerability is given in Fig. 4. Also, any tentative to patch this vulnerability by replacing the transversal paths with different graphs, modifying the slices accordingly, always resulted in constructions in which overlapping slices were possible.
Remark 4. From a theoretical point of view, it also makes sense to study a slightly different restriction of SEFE, where instead of limiting the number of crossings per edge, it is limited the number of distinct edges that cross a same private edge; recall that two private edges may cross each other more than once, which gives rise to a different problem than K-SEFE. We may call this problem K-PAIR-SEFE, because k is now the bound on the allowed number of crossing edge pairs involving a same edge. It is not hard to see that a reduction analogous to that given in the proof of Theorems 2 and 3 can be used to prove the N P-hardness of K-PAIR-SEFE. The interesting theoretical aspect of K-PAIR-SEFE is the following: if k is greater than or equal to the maximum number of edges of G i (i = 1, 2), then a K-PAIR-SEFE is also a SEFE; in particular, if k ≥ 3|V | − 6 the two problems are identical.

Conclusions and Open Problems
In this work we have shown the N P-hardness of the GRACSIM DRAWING problem, a restricted version of the SGE problem in which edge crossings must occur only at right angles. Then, we have introduced and studied the N P-completeness of the K-SEFE problem, a restricted version of the SEFE problem, where every private can receive at most k crossings. Our results raise two main questions. First, as already mentioned at the end of Section 3, it would be interesting to study the complexity of a relaxed version of the GRAC-SIM DRAWING problem, where a prescribed number of bends per edge are allowed; this open problem was already posed in [9]. In particular, it is not clear whether the reduction given in the proof of Theorem 1 can be adapted for proving the N P-hardness of the one bend extension of GRACSIM. Another interesting open problem is to investigate the complexity of K-PAIR-SEFE when the ratio |V |/k tends to 1 3 + 2 k from the right; we recall that for k ≥ 3|V | − 6, K-PAIR-SEFE and SEFE are the same problem, and that the N P-hardness of K-PAIR-SEFE strongly relies on a construction where the ratio |V |/k is significantly greater than 1 3 + 2 k .