1. 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
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,b).
Therefore, we can reformulate the
Clique-planarity problem in the terminology of
beyond-planarity [
10,
11] as follows. Given a graph
and a partition of its vertex set
V into subsets
such that the subgraph of
G induced by each subset
is a clique, the goal is to compute a planar subgraph
of
G by replacing the clique induced by
, for each
, with a path spanning the vertices of
(see
Figure 1c).
In this paper, we introduce and study a problem called
h-
Clique2
Path 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].
1.1. 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.
1.2. 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.
2. 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,
, and
. Edge
x is crossing-free and the truth value of
X is encoded according to which edge among
and
is crossing-free. Let
and
be two triangles whose vertices are
and
, respectively. They define two faces
and
, respectively. Concatenate a triangle
defined as in the variable gadget with
by inserting its crossing-free edge
inside
and by crossing the other two edges of
with
and
, respectively. Now, concatenate another triangle
defined as in the variable gadget with
. If the crossing-free edge of
is inside
, the gadget composed by
and
is the wire gadget; if the crossing-free edge of
is outside
, the gadget composed by
and
is the inverter gadget. The splitting gadget consists of three variable gadgets
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.
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 . In particular, we prove that the problem remains NP-complete for , while it becomes linear-time solvable for .
3. 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
be the number of clauses containing
x. We construct a simple topological graph gadget
for
x, called
variable gadget (see the left dotted box in
Figure 3a). This gadget contains
3-cliques
, forming a ring, so that the left (right) edge of
only crosses the left (right) edge of
and of
, for each
. In addition, gadget
contains
additional 3-cliques, called
, so that the right edge of
crosses the left edge of
and the right edge of
, while the left edge of
crosses the left edge of
and the right edge of
.
Then, for each clause
c, we construct a simple topological graph gadget
, 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
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
to the 3-clique
of the variable gadget
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 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 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 , with , is removed, or the right edge of each 3-clique is removed.
Proof. We first consider the possible removals of edges in
and claim that, in any solution for 4-C2PP, one of the two following conditions are satisfied: (i) for each 3-clique
, 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
, 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
must be removed, in order to resolve its crossings with the right edge of
and with the left edge of
, while if Condition (ii) holds, then the left edge of each 3-clique
must be removed, in order to resolve its crossings with the left edge of
and with the right edge of
.
To prove the claim, we consider the possible removals of edges of . Suppose first that the base edge of is removed. Thus, the crossings between the left (right) edge of and the left (right) edge of are not resolved; this implies that they have to be resolved by removing both the left and the right edge of , which is not possible. If the right edge of is removed, then the crossing between the right edges of and is resolved, while the one between their left edges is not. Hence, the left edge of must be removed. By iterating this argument we conclude that the right (left) edge of each with i odd (even) is removed. Symmetrically, we can prove that, if the left edge of is removed, then the left (right) edge of each 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 in the variable gadget 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 in the variable gadget 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 of the clause gadget corresponding to x is removed if and only if the right (left) edge of each 3-clique is removed. Namely, consider the chain that connects with a 3-clique of . 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 is removed if and only if the right (left) edge of is removed, that is, the truth value of is transferred to the 3-clique of .
Finally, consider any clause
c, composed of variables
x,
y, and
z. Let
,
, and
be the three 3-cliques of the clause gadget
of
c corresponding to
x,
y, and
z, respectively; also, let
v be the central vertex of the 4-clique of
, and let
,
, and
be the vertices of this 4-clique lying inside
,
, and
, respectively; see
Figure 3. We assume without loss of generality that
,
, and
appear in this clockwise order around
v. As discussed above, the left or the right edge of
(of
; of
) is removed depending on whether the left or the right edge of each
(of each
; of each
) is removed. We show that, for exactly one of
,
, and
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
,
, and
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
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
,
, and
, say
and
, the right edge is removed (and hence
x and
y are set to
True), as in
Figure 3c. Since each edge of triangle
is crossed by the left edge of one of
and
, by construction, these crossings are not resolved. Hence, all the edges of
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
,
, and
, say
, 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
,
, and
, 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
, with
and
, we remove the left (right) edge of each 3-clique
, with
and
, and we remove the right (left) edge of each 3-clique
, with
. 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
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
,
, and
, as discussed above (see
Figure 3a). The statement follows. □
4. 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
, since
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
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 be the simple plane topological graph obtained from K by replacing each crossing with a dummy vertex. By 1-planarity, every face of 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 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 -time solvable for simple topological 1-plane graphs.
5. 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 and , while it is solvable in linear time for every value of h, when . 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
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
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-
Clique2
Path 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].