Graph Planarity by Replacing Cliques with Paths

This paper introduces and studies the following beyond-planarity problem, which we call h-CLIQUE2PATH PLANARITY. Let G be a simple topological graph whose vertices are partitioned into subsets of size at most h, each inducing a clique. h-CLIQUE2PATH PLANARITY asks whether it is possible to obtain a planar subgraph of G by removing edges from each clique so that the subgraph induced by each subset is a path. We investigate the complexity of this problem in relation to k-planarity. In particular, we prove that h-CLIQUE2PATH PLANARITY is NP-complete even when h = 4 and G is a simple 3-plane graph, while it can be solved in linear time when G is a simple 1-plane graph, for any value of h. Our results contribute to the growing fields of hybrid planarity and of graph drawing beyond planarity.


Introduction
A typical problem concerning the visual analysis of real-world networks refers to the creation of occlusions and hairball-like structures in dense subnetworks when node-link diagrams are generated by standard layout algorithms, e.g., force-directed methods. On the other hand, different representations, such as adjacency matrices, are well suited for dense graphs but make neighbor identification and path-tracing more difficult [1,2]. Hybrid graph representations combine different visualization metaphors in order to exploit their strengths and overcome their drawbacks.
The NodeTrix model [3] represents a first example of hybrid representation. It combines node-link diagrams with adjacency-matrix representations of the denser subgraphs [3][4][5][6]. Inspired by NodeTrix, other hybrid representation models were recently introduced [7][8][9]. The ChordLink model [7] embeds chord diagrams, used for the visualization of dense subgraphs (clusters), into a node-link diagram. In a (k, p) representation [8], each cluster contains at most k vertices and each vertex can occur at most p times along the boundary of the cluster. In the intersection-link representations [9] model, vertices are geometric objects and edges are either intersections between objects (intersection-edges) or crossing-free Jordan arcs attaching at their boundary (link-edges). Different types of objects determine different intersection-link representations.
Clique-planar drawings are defined in [9] as intersection-link representations in which the objects are isothetic rectangles, and the partition into intersection-and link-edges is given as a part of the input, so that the graph induced by the intersection-edges is composed of a set of vertex-disjoint cliques. The corresponding recognition problem, called CLIQUE-PLANARITY, has been proved NP-complete in general and polynomial-time solvable in restricted cases, for example when the rectangle representing each vertex is given as a part of the input, or when the cliques are arranged on levels according to a hierarchy. In [9], it is also proven that, if a graph is clique-planar, then it admits an intersection-link representation in which all vertices in a same cluster are isothetic unit squares whose upper-left corners are aligned along a line of slope one (see Figure 1a, Therefore, we can reformulate the CLIQUE-PLANARITY problem in the terminology of beyond-planarity [10,11] as follows. Given a graph G = (V, E) and a partition of its vertex set V into subsets V 1 , . . . , V m such that the subgraph of G induced by each subset V i is a clique, the goal is to compute a planar subgraph G = (V, E ) of G by replacing the clique induced by V i , for each i = 1, . . . , m, with a path spanning the vertices of V i (see Figure 1c).
In this paper, we introduce and study a problem called h-CLIQUE2PATH PLANARITY (for short, h-C2PP), that is a restricted version of CLIQUE-PLANARITY in which the input graph comes with a given embedding and each clique has size at most h. Preliminary results have been presented in [12].

Our Results
A graph G is planar if it admits an embedding in the plane where no two edges cross; this embedding is a planar embedding of G. A planar graph with an associated planar embedding is said to be an embedded planar graph, or a plane graph.
In the version of h-CLIQUE2PATH PLANARITY that we study, the input graph G is a simple topological graph. A topological graph is embedded in the plane so that each edge is a Jordan arc connecting its end-vertices. A topological graph is simple if a Jordan arc does not pass through any vertex, and does not intersect any arc more than once (either with a proper crossing or sharing a common end-vertex); finally, no three arcs mutually cross at the same point.
Our main goal is to investigate the complexity of h-C2PP in relation to the well-studied class of k-planar graphs, i.e., those that admit a drawing in which each edge has at most k crossings [9,10,13,14]. With a slight abuse of notation, we use the term embedding also for non-planar graphs, where we interpret each crossings as a dummy vertex. In particular, a k-planar graph together with a k-planar embedding is a k-plane graph.
A geometric graph is drawn in the plane so that each edge is a straight line segment. The version of h-C2PP in which the input graph G is a geometric graph has been recently studied by Kindermann et al. [15], who called it the partition spanning forest problem. They proved that 4-C2PP for geometric graphs is NP-complete, which immediately implies the NP-completeness of 4-C2PP for simple topological graphs.
We strengthen this result by proving that 4-C2PP is NP-complete even for simple topological 3-plane graphs. On the positive side, we prove that the h-C2PP problem for simple topological 1-plane graphs can be solved in linear time for any value of h. We finally remark that the 2-SAT formulation used in [15] to solve 3-C2PP for geometric graphs can be easily extended to solve 3-C2PP for any simple topological graph.

Outline
In Section 2, we further investigate the relationship between h-C2PP and the partition spanning forest problem, that is the problem studied by Kindermann et al. [15]. In Section 3, we prove the NP-completeness of 4-C2PP for simple topological 3-plane graphs. In Section 4, we show that the h-C2PP problem for simple topological 1-plane graphs is linear-time solvable for any value of h. Finally, in Section 5, we provide challenging open problems.

Relationship between h-CLIQUE2PAH PLANARITY and the Partition Spanning Forest Problem
The input of the problem studied by Kindermann et al. [15] is a set of colored points in the plane, and the goal is to decide whether there exist straight-line spanning trees, one for each same-colored point subset, that do not cross each other. Since edges are straight-line, their drawings are determined by the positions of the points, and hence each same-colored point subset can, in fact, be seen as a straight-line drawing of a clique, from which edges have to be removed so that each clique becomes a tree and the drawing becomes planar.
The authors proved NP-completeness for the case in which the spanning tree is a path, even when there are at most four vertices with the same color. This result implies that 4-C2PP for geometric graphs is NP-complete. On the other hand, they provided a linear-time algorithm when there exist at most three vertices with the same color, which then extends to 3-C2PP for geometric graphs.
Although not explicitly mentioned in [15], the drawings produced by the reduction used to prove the NP-completeness of 4-C2PP for geometric graphs are 4-planar. We now provide some details about this reduction.
The authors of [15] performed a polynomial-time reduction from PLANAR 3-SATISFIABILITY. The variable gadget (shown in the yellow region of Figure 1) consists of a triangle X whose edges are x, x l , and x r . Edge x is crossing-free and the truth value of X is encoded according to which edge among x l and x r is crossing-free. Let T 1 and T 2 be two triangles whose vertices are u, y, z and v, y, z, respectively. They define two faces f 1 and f 2 , respectively. Concatenate a triangle T 3 defined as in the variable gadget with f 1 by inserting its crossing-free edge (y, z) inside f 1 and by crossing the other two edges of T 3 with (u, y) and (u, z), respectively. Now, concatenate another triangle T 4 defined as in the variable gadget with f 2 . If the crossing-free edge of T 4 is inside f 2 , the gadget composed by T 1 , T 2 , T 3 and T 4 is the wire gadget; if the crossing-free edge of T 4 is outside f 2 , the gadget composed by T 1 , T 2 , T 3 and T 4 is the inverter gadget. The splitting gadget consists of three variable gadgets X, Y and Z, and two 4-cliques, concatenated as illustrated inside the blue region in Figure 2, where the yellow region contains a variable gadget, the orange region contains a wire gadget and the violet region contains an inverter gadget. As shown in Figure 2, multiple splittings of a variable X lead to an instance where a triangle has two edges with four crossings.
A drawing produced by the reduction in [15]. The yellow region contains a variable gadget, the blue region contains a splitting gadget, the orange region contains a wire gadget, and the violet region contains an inverter gadget.
The NP-completeness of 4-C2PP for geometric graphs implies the NP-completeness of 4-C2PP for simple topological 4-plane graphs. In what follows, we further explore the complexity of 4-C2PP in relation to k-planarity by considering values of k < 4. In particular, we prove that the problem remains NP-complete for k = 3, while it becomes linear-time solvable for k = 1.

NP-Completeness for Simple Topological 3-Plane Graphs
In this section, we prove that the 4-C2PP problem remains NP-complete even when the input is a simple topological 3-plane graph.
Since the planarity of a simple topological graph can be checked in linear time, the h-C2PP problem for simple topological k-plane graphs belongs to NP for all values of h and k.
In the following, we prove the NP-hardness by means of a reduction from the PLANAR POSITIVE 1-IN-3-SAT problem. In this version of the SATISFIABILITY problem, which is known to be NP-complete [16], each variable appears only with its positive literal, each clause has at most three variables, the graph obtained by connecting each variable with all the clauses it belongs to is planar, and the goal is to find a truth assignment in such a way that, for each clause, exactly one of its three variables is set to True. Our reduction is technically different from the one presented in [15], which reduces from PLANAR 3-SATISFIABILITY.
For each 3-clique we use in the reduction, there is a base edge, which is crossing-free in the constructed topological graph, while the other two edges always have crossings. We call left (right) the edge that follows (precedes) the base edge in the clockwise order of the edges along the 3-clique. In addition, if an edge e of a clique does not belong to the path replacing the clique, we say that e is removed, and that all the crossings involving e in G are resolved.
For each variable x, let n x be the number of clauses containing x. We construct a simple topological graph gadget G x for x, called variable gadget (see the left dotted box in Figure 3a). This gadget contains 2n x 3-cliques t x 1 , . . . , t x 2n x , forming a ring, so that the left (right) edge of t x i only crosses the left (right) edge of t x i−1 and of t x i+1 , for each i = 1, . . . , 2n x . In addition, gadget G x contains n x additional 3-cliques, called τ x 1 , . . . , τ x n x , so that the right edge of τ x j crosses the left edge of t x 2j−1 and the right edge of t x 2j , while the left edge of τ x j crosses the left edge of t x 2j and the right edge of t x 2j−1 . Then, for each clause c, we construct a simple topological graph gadget G c , called clause gadget, which is composed of a planar drawing of a 4-clique, together with three 3-cliques whose left and right edges cross the edges of the 4-clique as in the right dotted box in Figure 3a. In particular, observe that the right (left) edge of each 3-clique crosses exactly one (two) edges of the 4-clique.
Every 3-clique in G c corresponds to one of the three variables of c. Let x be one of such variables; assuming that c is the jth clause that contains x according to the order of the clauses in the given formula, we connect the 3-clique corresponding to x in the clause gadget G c to the 3-clique τ x j of the variable gadget G x of x by a chain of 3-cliques of odd length, as in Figure 3a.
By construction, the resulting simple topological graph G contains cliques of size at most 4, namely one per clause, and hence is a valid instance of 4-C2PP. In addition, by collapsing each variable and clause gadget into a vertex, and each chain connecting them into an edge, the resulting graph G preserves the planarity of the PLANAR POSITIVE 1-IN-3-SAT instance. This implies that the only crossings for each edge of G are with other edges in the gadget it belongs to and, possibly, with the edges of the 3-cliques of a chain. Hence, G is 3-planar. Namely, each base edge is crossing-free; each internal edge of a 4-clique has one crossing; each external edge of a 4-clique has two crossings, and the same is true for the left and right edges of each 3-clique in a chain; finally, the left and right edges of each 3-clique in either a variable or a clause gadget have three crossings.
In the following, we prove the equivalence between the original instance of PLANAR POSITIVE 1-IN-3-SAT and the constructed instance G of 4-C2PP. For this, we first give a lemma stating that variable gadgets correctly represent the behavior of a variable; indeed, they can assume one out of two possible states in any solution for 4-C2PP.

Lemma 1.
Let G x be the variable gadget for a variable x in G. Then, in any solution for 4-C2PP, either the left edge of each 3-clique τ x j , with j = 1, . . . , n x , is removed, or the right edge of each 3-clique τ x j is removed.
Proof. We first consider the possible removals of edges in t x 1 , . . . , t x 2n x and claim that, in any solution for 4-C2PP, one of the two following conditions are satisfied: (i) for each 3-clique t x i , if i is odd, then the left edge is removed, while if i is even the right edge is removed; and (ii) for each 3-clique t x i , if i is odd, then the right edge is removed, while if i is even the left edge is removed. Note that this claim is sufficient to prove the statement; in fact, if Condition (i) holds (as in Figure 3a), then the right edge of each 3-clique τ x j must be removed, in order to resolve its crossings with the right edge of t x 2j−1 and with the left edge of t x 2j , while if Condition (ii) holds, then the left edge of each 3-clique τ x j must be removed, in order to resolve its crossings with the left edge of t x 2j−1 and with the right edge of t x 2j . To prove the claim, we consider the possible removals of edges of t x 1 . Suppose first that the base edge of t x 1 is removed. Thus, the crossings between the left (right) edge of t x 1 and the left (right) edge of t x 2 are not resolved; this implies that they have to be resolved by removing both the left and the right edge of t x 2 , which is not possible. If the right edge of t x 1 is removed, then the crossing between the right edges of t x 1 and t x 2 is resolved, while the one between their left edges is not. Hence, the left edge of t x 2 must be removed. By iterating this argument we conclude that the right (left) edge of each t x i with i odd (even) is removed. Symmetrically, we can prove that, if the left edge of t x 1 is removed, then the left (right) edge of each t x i with i odd (even) is removed. This concludes the proof of the lemma.
Given Lemma 1, we can associate the truth value of a variable x with the fact that either the left or the right edge of each 3-clique τ x j in the variable gadget G x of G is removed. We use this association to prove the following theorem. Theorem 1. The 4-C2PP problem is NP-complete, even for 3-plane graphs.
Proof. Given an instance of PLANAR POSITIVE 1-IN-3-SAT, we construct an instance G of 4-C2PP in linear time as described above. We prove their equivalence.
Suppose first that there exists a solution for 4-C2PP, i.e., a set of edges of G whose removal resolves all crossings. By Lemma 1, for each variable x either the left or the right edge of each 3-clique τ x j in the variable gadget G x is removed. If the right edge is removed, we assign value True to variable x, otherwise we assign False.
To prove that this assignment results in a solution for the given formula of PLANAR POSITIVE 1-IN-3-SAT, we first show that, for each clause c that contains variable x, the right (left) edge of the 3-clique t c (x) of the clause gadget G c corresponding to x is removed if and only if the right (left) edge of each 3-clique τ x j is removed. Namely, consider the chain that connects t c (x) with a 3-clique τ x j of G x . Note that, for any two consecutive 3-cliques along the chain, the left edge of one 3-clique and the right edge of the other 3-clique must be removed. Since the chain has odd length, the right (left) edge of t c (x) is removed if and only if the right (left) edge of τ x j is removed, that is, the truth value of G x is transferred to the 3-clique t c (x) of G c .
Finally, consider any clause c, composed of variables x, y, and z. Let t c (x), t c (y), and t c (z) be the three 3-cliques of the clause gadget G c of c corresponding to x, y, and z, respectively; also, let v be the central vertex of the 4-clique of G c , and let v x , v y , and v z be the vertices of this 4-clique lying inside t c (x), t c (y), and t c (z), respectively; see Figure 3. We assume without loss of generality that v x , v y , and v z appear in this clockwise order around v. As discussed above, the left or the right edge of t c (x) (of t c (y); of t c (z)) is removed depending on whether the left or the right edge of each τ x j (of each τ y j ; of each τ z j ) is removed. We show that, for exactly one of t c (x), t c (y), and t c (z) the right edge is removed, which then implies that exactly one of x, y, and z is True, and hence the instance of PLANAR POSITIVE 1-IN-3-SAT is positive.
Suppose first that for each of t c (x), t c (y), and t c (z) the left edge is removed (and hence all the three variables are set to False), as in Figure 3b. This implies that the crossings between the right edges of the three 3-cliques and the three edges of triangle (v x , v y , v z ) are not resolved. Hence, all the edges of this triangle should be removed, which is not possible since the remaining edges of the 4-clique do not form a path.
Suppose now that for at least two of t c (x), t c (y), and t c (z), say t c (x) and t c (y), the right edge is removed (and hence x and y are set to True), as in Figure 3c. Since each edge of triangle (v x , v y , v) is crossed by the left edge of one of t c (x) and t c (y), by construction, these crossings are not resolved. Hence, all the edges of (v x , v y , v) should be removed, which is not possible since the remaining edges of the 4-clique do not form a path of length 4.
Suppose finally that for exactly one of t c (x), t c (y), and t c (z), say t c (x), the right edge is removed (and hence x is the only one to be set to True), as in Figure 3a. Then, by removing edges (v, v x ), (v x , v y ), and (v y , v z ), all the crossings are resolved and the remaining edges of the 4-clique form a path of length 4, as desired.
The proof of the other direction is analogous. Namely, suppose that there exists a truth assignment that assigns a True value to exactly one variable in each clause. Then, for each variable x that is set to True (to False), we remove the right (left) edge of each 3-clique t x i , with i = 2j − 1 and j = 1, . . . , n x , we remove the left (right) edge of each 3-clique t x i , with i = 2j and j = 1, . . . , n x , and we remove the right (left) edge of each 3-clique τ x j , with j = 1, . . . , n x . Then, we remove the left or right edge of each 3-clique in a chain so that for any two consecutive 3-cliques, one of them has been removed the left edge and the other one the right edge. This ensures that, for each clause c, the right edge of exactly one of the three 3-cliques that belong to the clause gadget G c has been removed, say the one corresponding to variable x, while for the other two 3-cliques the left edge has been removed. Hence, we can resolve all crossings by removing edges (v, v x ), (v x , v y ), and (v y , v z ), as discussed above (see Figure 3a). The statement follows.

h-CLIQUE2PAH PLANARITY and 1-Planarity
In this section, we show that, when the given simple topological graph is 1-plane, h-C2PP can be solved in linear time in the size of the input, for any h. We consider all possible simple topological 1-plane cliques and show that the problem can be solved using only local tests, each requiring constant time. Note that we can restrict to the case h ≤ 6, since K 6 is the largest 1-planar complete graph [11].
Simple topological 1-plane graphs containing cliques with at most four vertices that cross each other can be constructed, but it is easy to enumerate all these graphs (up to symmetry) (see Figure 4). Note that such graphs involve at most two cliques and that, if K 4 has a crossing, combining it with any other clique would violate 1-planarity (see Figure 4a,b). The next lemma accounts for cliques with five or six vertices.

Lemma 2.
There exists no 1-plane simple topological graph that contains two cliques, one of which with at least five vertices, whose edges cross each other.
Proof. Consider a simple 1-plane graph G that contains two disjoint cliques K and H, with five and three vertices, respectively. Let K be the simple plane topological graph obtained from K by replacing each crossing with a dummy vertex. By 1-planarity, every face of K is a triangle and contains at most one dummy vertex. Suppose, for a contradiction, that there exists a crossing between an edge of K and an edge of H in G. Then, there would exist at least a vertex v of H inside a face f of K and at least one outside f . Since H is a triangle, there must have been two edges that connect vertices inside f to vertices outside f . If f contains one dummy vertex, then two of its edges are not crossed by edges of H, as otherwise G would not be 1-planar. Hence, both the edges that connect vertices inside f to vertices outside f cross the other edge of f , a contradiction. If f contains no dummy vertices, then each edge of f admits one crossing. Let u be the vertex of f that is incident to the two edges crossed by edges of H. Since u has degree 4 in K, it is not possible to draw the third edge of H so that it crosses only one edge of K, which completes the proof. Combining the previous discussion with Lemma 2, we conclude that, for each subgraph of the input graph G that consists either of a combination of at most two cliques of size at most 4, as in Figure 4, or of a single clique not crossing any other clique, the crossings involving this subgraph (possibly with other edges not belonging to cliques) can only be resolved by removing its edges, which can be checked in constant time. In the next theorem, n denotes the number of vertices. Theorem 2. h-C2PP is O(n)-time solvable for simple topological 1-plane graphs.

Conclusions and Open Problems
We introduce and study the h-CLIQUE2PATH PLANARITY problem for simple topological k-plane graphs; we proved that this problem is NP-complete for h = 4 and k = 3, while it is solvable in linear time for every value of h, when k = 1. The natural open question is: What is the complexity for simple topological 2-plane graphs?
Kindermann et al. [15] recently proved that problem 4-C2PP is NP-complete for geometric 4-plane graphs. It would be interesting to study this geometric version of the problem for 2-plane and 3-plane graphs.
Recall that the version of the h-C2PP problem when the input is an n-vertex abstract graph and h ∈ O(n) is NP-complete, since it is equivalent to CLIQUE PLANARITY [9]. What if the input is an abstract graph and h is bounded by a constant or sublinear function? We remark that for h = 3 this version of the problem is equivalent to CLUSTERED PLANARITY, when restricted to instances in which the graph induced by each cluster consists of three isolated vertices.
Finally, another intriguing research direction is to study the h-CLIQUE2PATH PLANARITY problem in the scenario in which the input graph comes without a clustering of its vertex set, but dense portions of the graph are found by an algorithm. While the problem of finding cliques in a graph is NP-complete [17], one could identify dense subgraphs, for example k-cores, in polynomial time [18].