1 Hybrid Representations

A common problem in the visual analysis of real-world networks is that dense subnetworks create occlusions and hairball-like structures in node-link diagrams 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 [7, 12]. Hybrid graph representations combine different representation metaphors in order to exploit their strengths and overcome their drawbacks.

The first example of hybrid representation was the NodeTrix model [8], which combines node-link diagrams with adjacency-matrix representations of the denser subgraphs [4, 5, 8, 14]. Another example of hybrid representations are intersection-link representations [1]. In this 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.

In [1], clique-planar drawings are defined as intersection-link representations in which the objects are isothetic rectangles, and the partition into intersection- and link-edges is given in the input, so that the graph induced by the intersection-edges is composed of a set of vertex-disjoint cliques. The corresponding recognition problem is called Clique-planarity, and it has been proved NP-complete in general and polynomial-time solvable in restricted cases.

We study Clique-planarity when all cliques have bounded size. As proved in [1], the Clique-planarity problem can be reformulated in the terminology of beyond-planarity [6, 10], as follows. Given a graph \(G=(V,E)\) and a partition of its vertex set V into subsets \(V_1,\dots ,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,\dots ,m\), with a path spanning the vertices of \(V_i\). We call \(h\) -Clique2Path Planarity (for short, \(h\) -C2PP) the version of this problem in which each clique has size at most h.

We remark that the version of \(h\) -C2PP in which the input graph G is a geometric graph, i.e., it is drawn in the plane with straight-line edges, has been recently studied by Kindermann et al. [9] in a different context. The input of their problem 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. They proved NP-completeness for the case in which the spanning tree must be a path, even when there are at most 4 vertices with the same color. This implies that \(4\) -C2PP for geometric graphs in NP-complete. On the other hand, they provided a linear-time algorithm when there exist at most 3 vertices with the same color, which then extends to \(3\) -C2PP for geometric graphs.

In this paper, we study the version of \(h\) -C2PP in which the input graph G is a simple topological graph, that is, it is embedded in the plane so that each edge is a Jordan arc connecting its end-vertices; by simple we mean that 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 pass through the same point. Our main goal is to study the complexity of this problem in relation to the well-studied class of k-planar graphs, i.e., those that admit drawings in which each edge has at most k crossings [1, 3, 6, 13].

We observe that the NP-completeness of \(4\) -C2PP for geometric graphs already implies the NP-completeness of \(4\) -C2PP for simple topological graphs; also, though not explicitly mentioned in [9], it is possible to show that the instances produced by that reduction are 4-plane (see [2]). We strengthen this result by proving in Sect. 2 that \(4\) -C2PP is NP-complete even for simple topological 3-plane graphs. On the positive side, we prove in Sect. 3 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 [9] to solve \(3\) -C2PP for geometric graphs can be easily extended to solve \(3\) -C2PP for any simple topological graph.

For space reasons, some proofs have been omitted or sketched, and can be found in [2]; the corresponding statements are marked with [*].

2 NP-Completeness for Simple Topological 3-Plane Graphs

In this section we prove that the \(k\) -C2PP problem remains NP-complete for \(k=4\) 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 [11], 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. 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. Also, 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 Fig. 1(a). This gadget contains \(2n_x\) 3-cliques \(t^x_1,\dots ,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,\dots ,2n_x\). Also, gadget \(G_x\) contains \(n_x\) additional 3-cliques, called \(\tau ^x_1,\dots ,\tau ^x_{n_x}\), so that the right edge of \(\tau ^x_j\) crosses the left edge of \(t^x_{2j-1}\) and the right edge of \(t^x_{2j}\), while the left edge of \(\tau ^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 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 Fig. 1(a). 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 j-th 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 \(\tau ^x_j\) of the variable gadget \(G_x\) of x by a chain of 3-cliques of odd length, as in Fig. 1(a).

Fig. 1.
figure 1

(a) The variable gadget \(G_x\) for a variable x is represented in the left dotted box. The clause gadget for a clause c is represented in the right dotted box. The chain connecting \(G_x\) to \(G_c\) is represented with lighter colors. The removed edges are dashed red. (b) All variables are False. (c) At least two variables are True. (Color figure online)

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. Also, 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-plane. 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 has 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. The proof of the next lemma can be found in [2].

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 \(\tau ^x_j\), with \(j=1,\dots ,n_x\), is removed, or the right edge of each 3-clique \(\tau ^x_j\) is removed.

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 \(\tau ^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 (sketch)

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 one direction of the equivalence between the two problems. The other direction follows a similar reasoning. Suppose 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 \(\tau ^x_j\) in gadget \(G_x\) is removed. We assign True (False) to x if the right (left) edge is removed.

We first claim 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 \(\tau ^x_j\) is removed. Consider the chain that connects \(t_c(x)\) with a 3-clique \(\tau ^x_j\) of \(G_x\). 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 truth value of \(G_x\) is transferred to the 3-clique \(t_c(x)\) of \(G_c\) and thus the claim follows.

Consider now a clause c with variables x, y, and z. Let \(t_c(x)\), \(t_c(y)\), and \(t_c(z)\) be the 3-cliques of the clause gadget \(G_c\) of c corresponding to x, y, and z, respectively. Let v be the central vertex of the 4-clique of \(G_c\), and let \(v_x\), \(v_y\), \(v_z\) be the vertices of this 4-clique lying inside \(t_c(x)\), \(t_c(y)\), and \(t_c(z)\) (see Fig. 1). Assume that \(v_x\), \(v_y\), and \(v_z\) appear in this clockwise order around v. We now show that, for exactly one of \(t_c(x)\), \(t_c(y)\), and \(t_c(z)\) the right edge is removed, which implies that exactly one of x, y, and z is True and hence the instance of Planar Positive 1-in-3-SAT is positive. Assume that for each of \(t_c(x)\), \(t_c(y)\), and \(t_c(z)\) the left edge is removed (i.e., all the three variables are set to False), as in Fig. 1(b). 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. All edges of this triangle should be removed, which is not possible since the remaining edges of the 4-clique do not form a path. Assume now that for at least two of the 3-cliques, say \(t_c(x)\) and \(t_c(y)\), the right edge is removed (i.e., x and y are set to True), as in Fig. 1(c). 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 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. Finally, assume that for exactly one of the 3-cliques, say \(t_c(x)\), the right edge is removed (i.e., x is the only one set to True), as in Fig. 1(a). By removing edges \((v,v_x)\), \((v_x,v_y)\), and \((v_y,v_z)\), all crossings are resolved; the remaining edges of the 4-clique form a path of length 4, as desired.\(\square \)

3 \(h\) -Clique2Path Planarity and 1-Planarity

In this section we show that, when the given simple topological graph is 1-plane, problem \(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 \(h\le 6\), since \(K_6\) is the largest 1-planar complete graph [10].

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 Fig. 2. 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 Fig. 2(a) and (b). The next lemma accounts for cliques with five or six vertices.

Fig. 2.
figure 2

All 1-plane graphs involving one or more cliques of type \(K_3\) and \(K_4\).

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-plane. 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.\(\square \)

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 Fig. 2, 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.

4 Open Problems

We studied 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. [9] 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.

Finally, note that the version of the \(h\) -C2PP problem when the input is an abstract graph (which is equivalent to Clique Planarity [1]) is NP-complete when \(h \in O(n)\). What if h is bounded by a constant or a 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.