Intersection-Link Representations of Graphs

We consider drawings of graphs that contain dense subgraphs. We introduce intersection-link representations for such graphs, in which each vertex $u$ is represented by a geometric object $R(u)$ and in which each edge $(u,v)$ is represented by the intersection between $R(u)$ and $R(v)$ if it belongs to a dense subgraph or by a curve connecting the boundaries of $R(u)$ and $R(v)$ otherwise. We study a notion of planarity, called Clique Planarity, for intersection-link representations of graphs in which the dense subgraphs are cliques.


Introduction
In several applications there is the need to represent graphs that are globally sparse but contain dense subgraphs. As an example, a social network is often composed of communities, whose members are closely interlinked, connected by a network of relationships that are much less dense. The visualization of such networks poses challenges that are attracting the study of several researchers (see, e.g., [5,10]). One frequent approach is to rely on clustering techniques to collapse dense subgraphs and then represent only the links between clusters. However, this has the drawback of hiding part of the graph structure. Another approach that has been explored is the use of hybrid drawing standards, where different conventions are used to represent the dense and the sparse portions of the graph: In the drawing standard introduced in [3,11] each dense part is represented by an adjacency matrix while two adjacent dense parts are connected by a curve.
In this paper we study intersection-link representations, which are hybrid representations where in the dense parts of the graph the edges are represented by the intersection of geometric objects (intersection representation) and in the sparse parts the edges are represented by curves (link representation).
More formally and more specifically, we introduce the following problem. Suppose that a pair (G, S) is given where G is a graph and S is a set of cliques that partition the vertex set of G. In an intersectionlink representation, vertices are represented by geometric objects that are translates of the same rectangle. Consider an edge (u, v) and let R(u) and R(v) be the rectangles representing u and v, respectively. If (u, v) is part of a clique (intersection-edge) we represent it by drawing R(u) and R(v) so that they intersect, else (link-edge) we represent it by a curve connecting R(u) and R(v). An example is provided in Fig. 1.
We study the Clique Planarity problem that asks to test whether a pair (G, S) has an intersectionlink representation such that link-edges do not cross each other and do not traverse any rectangle. The main challenge of the problem lies in the interplay between the geometric constraints imposed by the rectangle arrangements and the topological constraints imposed by the link edges.
Several problems are related to Clique Planarity; here we mention two notable ones. The problem of recognizing intersection graphs of translates of the same rectangle is N P-complete [6]. Note that this does not imply N P-hardness for our problem, since cliques always have such a representation. Map graphs allow to represent graphs containing large cliques in a readable way; they are contact graphs of internally-disjoint connected regions of the plane, where the contact can be even a single point. The recognition of map graphs has been studied in [7,14]. One can argue that there are graphs that admit a clique-planar representation, while not admitting any representation as a map graph, and vice versa. We now describe our contribution. Our study encountered several interesting and at a first glance unrelated theoretical problems. In more detail, our results are as follows.
-In Section 3 we show that Clique Planarity is N P-complete even if S contains just one clique with more than one vertex. This result is established by observing a relationship between Clique Planarity and a natural constrained version of the Clustered Planarity problem, in which we ask whether a path (rather than a tree as in the usual Clustered Planarity problem) can be added to each cluster to make it connected while preserving clustered planarity; we prove this problem to be N P-complete, a result which might be interesting in its own right. -In Section 4, we show how to decide Clique Planarity in linear time in the case in which each clique has a prescribed geometric representation, via a reduction to the problem of testing planarity for a graph with a given partial representation. -In Section 5, we concentrate on instances of Clique Planarity composed of two cliques. While we are unable to settle the complexity of this case, we show that the problem becomes equivalent to an interesting variant of the 2-Page Book Embedding problem, in which the graph is bipartite and the vertex ordering in the book embedding has to respect the vertex partition of the graph. This problem is in our opinion worthy of future research efforts. For now, we use this equivalence to establish a polynomial-time algorithm for the case in which the link-edges are assigned to the pages of the book embedding. -In Section 6, we study a Sugiyama-style problem where the cliques are arranged on levels according to a hierarchy. In this practical setting we show that Clique Planarity is solvable in polynomial time. This is achieved via a reduction to the T -level planarity problem [2].
Conclusions and open problems are presented in Section 7.

Intersection-link model
Let G be a graph and S be a set of cliques inducing a partition of the vertex set of G. In an intersection-link representation of (G, S): each vertex u is a geometric object R(u), which is a translate of an axis-aligned rectangle R; two rectangles R(u) and R(v) intersect if and only if edge (u, v) is an intersection-edge, that is, if and only if (u, v) belongs to a clique in S; and if (u, v) is a link-edge, then it is represented by a curve connecting the boundaries of R(u) and R(v).
To avoid degenerate intersections we assume that no two rectangles have their sides on the same horizontal or vertical line. The Clique Planarity problem asks whether an intersection-link representation of a pair (G, S) exists such that: Such a representation is called clique-planar. A pair (G, S) is clique-planar if it admits a clique-planar representation.
We now present two simple, yet important, combinatorial properties of intersection-link representations. Let Γ be an intersection-link representation of (K n , {K n }) and let B be the outer boundary of Γ . We have the following. Lemma 1. Traversing B clockwise, the sequence of encountered rectangles is not of the form ..., R(u), ..., R(v), ..., R(u), ..., R(v), for any u, v ∈ G.
Proof. The proof is based on the fact that the outer boundary of the union of R(u) and R(v) consists of two maximal portions, one belonging to R(u) and one to R(v).
Proof. We prove a sequence of claims.
(Claim A): Every maximal portion of B belonging to a single rectangle R(u) contains (at least) one corner of R(u). Namely, if part of a side of R(u) belongs to B, while its corners do not, then two distinct rectangles R(v) and R(z) enclose those corners. However, this implies that R(v) and R(z) do not intersect, a contradiction to the fact that Γ is a representation of (K n , {K n }).
(Claim B): If two adjacent corners of the same rectangle R(u) both belong to B, then the entire side of R(u) between them belongs to B. Namely, if a rectangle R(v) = R(u) intersects a side of R(u), then at least one of the two corners of that side lies in the interior of R(v), given that R(u) and R(v) are translates of the same rectangle; hence that corner does not belong to B.
(Claim C): Any rectangle R(u) does not define three distinct maximal portions of B. Suppose the contrary, for a contradiction. By Claim A, each maximal portion of B belonging to R(u) contains a corner of R(u). This implies the existence of two adjacent corners belonging to two distinct maximal portions of B. However, by Claim B the side of R(u) between those corners belongs to B, hence those corners belong to the same maximal portion of B, a contradiction.
Claim C and Lemma 1 imply the statement of the lemma.
The following lemma allows us to focus, without loss of generality, on special clique-planar representations, which we call canonical. Lemma 3. Let (G, S) admit a clique-planar representation Γ . There exists a clique-planar representation Γ of (G, S) such that: each vertex is represented by an axis-aligned unit square; and for each clique s ∈ S, all the squares representing vertices in s have their upper-left corner along a common line with slope 1.
Proof. Initialize Γ = Γ . Rescale Γ in such a way that the unit distance is very small with respect to the size of the rectangles representing vertices in Γ . For each clique s ∈ S, consider a closed polyline P s "very close" to the representation of s, so that it contains all and only the rectangles representing the vertices of s and it crosses at most once each curve representing a link-edge of G. Traverse P s clockwise. By Lemma 2 and by the clique planarity of Γ , the circular sequence of encountered curves representing link-edges and crossing P s contains edges incident to a subsequence of R(u 1 ), R(u 2 ), ..., R(u |s| ), R(u |s|−1 ), ..., R(u 2 ), for some permutation u 1 , ..., u |s| of the vertices of s. Remove the interior of P s . Put in the interior of P s unit squares Q(u 1 ), Q(u 2 ), ..., Q(u |s| ) representing u 1 , u 2 , ..., u |s| as required by the lemma and such that they all share a common point of the plane. Reroute the curves representing link-edges from the border of P s to the suitable ending squares. This can be done without introducing any crossings, because the circular sequence of the squares encountered when traversing the boundary of the square arrangement clockwise is Q(u 1 ), Q(u 2 ), ..., Q(u |s| ), Q(u |s|−1 ), ..., Q(u 2 ).

Hardness Results on Clique Planarity
In this section we prove that the Clique Planarity problem is not solvable in polynomial time, unless P=N P. In fact, we have the following. Theorem 1. It is N P-complete to decide whether a pair (G, S) is clique-planar, even if S contains just one clique with more than one vertex.
We prove Theorem 1 by showing a polynomial-time reduction from a constrained clustered planarity problem, which we prove to be N P-complete, to the Clique Planarity problem.
A clustered graph (G, T ) is a pair such that G is a graph and T is a rooted tree whose leaves are the vertices of G; the internal nodes of T distinct from the root correspond to subsets of vertices of G, called clusters. A clustered graph is flat if every cluster is a child of the root. The clustered planarity problem asks whether a given clustered graph (G, T ) admits a c-planar drawing, i.e., a planar drawing of G, together with a representation of each cluster µ in T as a simple region R µ of the plane such that: (i) every region R µ contains all and only the vertices in µ; (ii) every two regions R µ and R ν are either disjoint or one contains the other; and (iii) every edge intersects the boundary of each region R µ at most once.
Polynomial-time algorithms for testing the existence of a c-planar drawing of a clustered graph are known only in special cases, most notably, if it is c-connected, i.e., each cluster induces a connected subgraph [8,9]. It has long been known [9] that a clustered graph (G, T ) is c-planar if and only if a set of edges can be added to G so that the resulting graph is c-planar and c-connected. Any such set of edges is called saturator, and the subset of a saturator composed of those edges between vertices of the same cluster µ defines a saturator for µ. A saturator is linear if the saturator of each cluster is a path.
The Clustered Planarity with Linear Saturators (cpls) problem takes as input a flat clustered graph (G, T ) such that each cluster in T induces an independent set of vertices, and asks whether (G, T ) admits a linear saturator. Proof. Clearly, if E is a linear saturator, then (G , T ) is c-planar and thus G * is planar. Conversely, assume that G is planar and let Γ be a planar drawing. Since the vertices of each cluster are isolated in G, the region R µ for each cluster µ can be represented by a sufficiently narrow region around the corresponding path in G yielding a c-planar drawing of G . It follows that E is a linear saturator.
The following lemma connects the problem Clique Planarity with the problem Clustered Planarity with Linear Saturators.
Lemma 5. Given an instance (G, T ) of the cpls problem, an equivalent instance (G , S) of the Clique Planarity problem can be constructed in linear time.
Proof. Instance (G , S) is defined as follows. Initialize G = G. For each cluster µ ∈ T , add edges to G such that µ forms a clique and add this clique to S. Clearly, instance (G , S) can be constructed in linear time. We prove that (G, T ) admits a linear saturator if and only if (G , S) is clique-planar.
Suppose that (G, T ) admits a linear saturator. This implies that there exists a c-planar drawing Γ of (G , T ), where G is obtained by adding the saturator to G. We construct a clique-planar representation Γ of (G , S) starting from Γ as follows.
Consider a cluster µ of T represented by region R µ , let B µ be the boundary of R µ , and let u 1 , ..., u k be the vertices of µ ordered as they appear along the saturator for µ. For each edge (u, v) of G crossing B µ , subdivide (u, v) with a dummy vertex at this crossing point. Note that the order of the vertices of µ, corresponding to the order in which their incident edges cross B µ , is a subset of u 1 , ..., u k−1 , u k , u k−1 , ..., u 2 .
Remove from Γ all the vertices and (part of the) edges contained in the interior of R µ . Represent u 1 , ..., u k by pairwise-intersecting rectangles R(u 1 ), ..., R(u k ) that are translates of each other and whose upper-left corners touch a common line in this order. Scale Γ such that the arrangement can be placed in the interior of R µ . Then connect the subdivision vertices on B µ with the suitable rectangles. This is possible without introducing crossings since the order of the subdivision vertices on B µ defines an order of their end-vertices in µ which is a subsequence of u 1 , ..., u k−1 , u k , u k−1 , ..., u 2 , while the circular order in which the rectangles occur along the boundary of their arrangement is R(u 1 ), ..., R(u k ), R(u k−1 ), ..., R(u 2 ). By treating every other cluster of T analogously, we get a clique-planar representation of (G , S).
Conversely, suppose that (G , S) has a clique-planar representation Γ , which we assume to be canonical by Lemma 3. We define a set E as follows. For each clique s ∈ S, let R(u 1 ), ..., R(u k ) be the order in which the rectangles corresponding to s touch the line with slope 1 through their upper-left corners in Γ ; add to E all the edges (u i , u i+1 ), for i = 1, ..., k − 1. We claim that E is a linear saturator for (G, T ). Indeed, by Lemma 4, it suffices to show that G + E admits a planar drawing.
Construction of a linear saturator from a clique-planar representation.
Initialize Γ = Γ . We place each vertex v at the center of square R(v) and remove R(v) from Γ . We extend each edge (u, v) with two straight-line segments from the boundaries of R(u) and R(v) to u and v, respectively. This does not produce crossings; in fact, only the segments of two vertices u and v such that R(u) and R(v) intersect might cross. However, such segments are separated by the line through the intersection points of the boundaries of R(u) and R(v); see Fig. 2(a). We now draw the edges in E as straight-line segments. As before, this may not introduce a crossing with any other segment or edge. In fact consider an edge (u, v) in E and any segment e w incident to a vertex w = u, v in the same clique. Assume u, v, w are in this order along the line with slope 1 through them. Then (u, v) is separated from e w by the line through the two intersection points of the boundaries of R(v) and R(w); see Fig. 2(b). This concludes the proof.
Next, we prove that the cpls problem is N P-complete.
Theorem 2. The cpls problem is N P-complete, even if the underlying graph is a subdivision of a triangulated planar graph and there is just one cluster containing more than one vertex.
Proof. The problem clearly lies in N P. We give a polynomial-time reduction from the Hamiltonian Path problem in biconnected planar graphs [13].
Given a biconnected planar graph G we construct an instance (G , T ) of cpls that admits a linear saturator if and only if G has a Hamiltonian path. Initialize G = G. Let E be a planar embedding of G , as in Fig. 3(a). For each face f , add a vertex v f inside f and connect it to all the vertices incident to f . Since G is biconnected, each face f of E is bounded by a simple cycle, hence G is a triangulated planar graph. Subdivide with a dummy vertex each edge of G that is not incident to a vertex v f , for any face f of E, as in Fig. 3(b). Finally, add a cluster µ to T containing all the vertices of G and, for each of the remaining vertices, add to T a cluster containing only that vertex.
Suppose that G admits a Hamiltonian path P = v 1 , ..., v n and let Since every cluster different from µ contains only one vertex, all clusters of (G , T ) induce paths. A planar drawing of G can be obtained from a planar drawing Γ of G as follows. Note that, for each edge (v i , v i+1 ) ∈ E , vertices v i and v i+1 share two faces in Γ since the dummy vertex added to subdivide edge (v i , v i+1 ) has degree 2. Hence, each saturator can be routed inside one of these faces arbitrarily close to the length-2 path between v i and v i+1 neither crossing an edge of G nor another saturator edge. Thus G is planar, and by Lemma 4 E is a linear saturator for (G , T ).
Conversely, suppose (G , T ) admits a linear saturator E . We claim that E is a Hamiltonian path of G. By construction, the vertices of µ are exactly the vertices of G; also, each edge of E corresponds to an edge of G, due to the fact that two vertices of µ are incident to a common face if and only if they are adjacent in G. Hence, the path of G corresponding to E is Hamiltonian. This concludes the proof.

Clique-Planarity with Given Vertex Representations
In this section we show how to test Clique Planarity in linear time for instances (G, S) with given vertex representations. That is, a clique-planar representation Γ of (G , S) is given, where G is obtained from G by removing its link-edges, and the goal is to test whether the link-edges of (G, S) can be drawn in Γ to obtain a clique-planar representation Γ of (G, S).
We start with a linear-time preprocessing in which we verify that every vertex of G incident to a link-edge is represented in Γ by a rectangle incident to the outer boundary of the clique it belongs to. If the test fails, the instance is negative. Otherwise, we proceed as follows. We show a reduction to the Partial Embedding Planarity problem [1], which asks whether a planar drawing of a graph H exists extending a given drawing H of a subgraph H of H.
First, we define a connected component H s of H corresponding to a clique s ∈ S and its drawing H s . We remark that H s is a cactus graph, that is a connected graph that admits a planar embedding in which all the edges are incident to the outer face. Denote by B the boundary of the representation of s in Γ (see Fig. 4(a)). If s has one or two vertices, then H s is a vertex or an edge, respectively (and H s is any drawing of H s ). Otherwise, initialize H s to a simple cycle containing a vertex for each maximal portion of B belonging to a single rectangle (see Fig. 4(b)). Let H s be any planar drawing of H s with a suitable orientation. Each rectangle in Γ may correspond to two vertices of H s , but no more than two by Lemma 2. Insert an edge in H s between every two vertices representing the same rectangle and draw it in the interior of H s . By Lemma 1, these edges do not alter the planarity of H s . Contract the inserted edges in H s and H s (see Fig. 4(c)). This completes the construction of H s , together with its planar drawing H s .
Graph H is the union of graphs H s , over all the cliques s ∈ S; the drawings H s of H s are in the outer face of each other in H . Note that, because of the preprocessing, the endvertices of each link-edge of G are vertices of H ; then we define H as the graph obtained from H by adding, for each link-edge (u, v) of G, an edge between the vertices of H corresponding to u and v. We have the following: Lemma 6. There exists a planar drawing of H extending H if and only if there exists a clique-planar representation of (G, S) coinciding with Γ when restricted to (G , S).
Proof. Let H be a planar drawing of H extending H . We construct a clique-planar representation Γ of (G, S) as follows. Initialize Γ = H. For each clique s ∈ S, consider a closed polyline P s close to H s so that it contains all and only the vertices and edges of H s in its interior and it crosses at most once every other edge of H. Scale Γ so that, for every clique s ∈ S, a rectangle which is the bounding box of the representation of s in Γ fits in the interior of P s . Remove the interior of P s and put in its place a copy of the representation of s in Γ . Reroute the curves representing link-edges from the border of P s to the suitable ending rectangles. This can be done without introducing any crossings, because the vertices of H s appear along the walk delimiting the outer face of H s in the same order as the corresponding rectangles appear along the boundary B of the representation of s in Γ , by construction. Finally, a homeomorphism of the plane can be exploited to translate the representation of each clique to the position it has in Γ , while maintaining the clique planarity of the representation.
Let Γ be a clique-planar representation of (G, S). We construct a planar drawing H of H extending H as follows. Initialize H = Γ . For each clique s ∈ S, consider a closed polyline P s close to the representation of s in H so that it contains all and only the rectangles representing vertices of s and it crosses at most once each curve representing a link-edge of G. Remove the interior of P s and put in its place a scaled copy of H s . Reroute the curves representing link-edges from the border of P s to the suitable endvertices. As in the previous direction, this can be done without introducing any crossings. Finally, a homeomorphism of the plane can be exploited to transform H into a planar drawing that coincides with H when restricted to H.
This concludes the proof of the lemma.
We get the following main theorem of this section.

Testing Clique Planarity for Graphs composed of Two Cliques
In this section we study the Clique Planarity problem for pairs (G, S) such that |S| = 2. Observe that, if |S| = 1, then the Clique Planarity problem is trivial, since in this case G is a clique with no linkedge, hence a clique-planar representation of (G, S) can be easily constructed. The case in which |S| = 2 is already surprisingly non-trivial. Indeed, we could not determine the computational complexity of Clique Planarity in this case. However, we establish the equivalence between our problem and a book embedding problem whose study might be interesting in its own; by means of this equivalence we show a polynomialtime algorithm for a special version of the Clique Planarity problem. This book embedding problem is defined as follows. A 2-page book embedding is a plane drawing of a graph where the vertices are cyclically arranged along a closed curve , called the spine, and each edge is entirely drawn in one of the two regions of the plane delimited by . The 2-Page Book Embedding problem asks whether a 2-page book embedding exists for a given graph. This problem is N P-complete [15]. Now consider a bipartite graph G(V 1 ∪ V 2 , E). A bipartite 2-page book embedding of G is a 2-page book embedding such that all vertices in V 1 occur consecutively along the spine (and all vertices in V 2 occur consecutively, as well). We call the corresponding embedding problem Bipartite 2-Page Book Embedding (b2pbe).
Finally, we define a bipartite 2-page book embedding with spine crossings (b2pbesc), as a bipartite 2-page book embedding in which edges are not restricted to lie in one of the two regions delimited by , but each of them might cross once. These crossings are only allowed to happen in the two portions of delimited by a vertex of V 1 and a vertex of V 2 . We call the corresponding embedding problem Bipartite 2-Page Book Embedding with Spine Crossings (b2pbesc).
We now prove that the b2pbesc problem is equivalent to Clique Planarity for instances (G, S) such that |S| = 2. Consider any instance (G , {s 1 , s 2 }) of the Clique Planarity problem. An instance G(V 1 ∪ V 2 , E ) of the b2pbesc problem can be defined in which V 1 is the vertex set of s 1 and V 2 is the vertex set of s 2 ; also, E consists of all the link-edges of G . Conversely, given an instance G(V 1 ∪ V 2 , E ) of b2pbesc, an instance (G , {s 1 , s 2 }) of Clique Planarity can be constructed in which s 1 is a clique on V 1 and s 2 is a clique on V 2 ; the set of link-edges of G coincides with E. Observe that, since link-edges only connect vertices of different cliques and since edges of E only connect a vertex of V 1 to one of V 2 , each mapping generates a valid instance for the other problem. Also, these mappings define a bijection, hence the following lemma establishes the equivalence between the two problems. Proof. Suppose that there exists a b2pbesc B of G(V 1 ∪ V 2 , E ). We construct a clique-planar representation Γ of (G , S) as follows. Initialize Γ = B. Relabel the vertices in V 1 (resp. in V 2 ) as u 1 , ..., u k (resp. v 1 , ..., v h ) according to the order in which they appear along . Draw a closed curve λ 1 (λ 2 ) enclosing a portion of the spine containing all and only vertices u 1 , ..., u k (resp. v 1 , ..., v h ). Scale Γ so that λ 1 and λ 2 are large enough to contain a square of size (1 + ) × (1 + ) in their interiors, with > 0. Remove the interior of λ 1 and λ 2 . Draw pairwise-intersecting unit squares Q(u 1 ), ..., Q(u k ) (resp. Q(v 1 ), ..., Q(v h )) all in the interior of λ 1 (resp. of λ 2 ) with their upper-left corners in this order along a common line l 1 (resp. l 2 ). Reroute the curves representing portions of link-edges from the border of λ 1 and λ 2 to the suitable ending squares inside them. This can be done without introducing any crossings, because the vertices of V 1 (V 2 ) appear along in the same order as the corresponding squares touch l 1 (resp. l 2 ); also, the portion of a link-edge connecting a point on λ 1 with a point on λ 2 is contained in the original drawing of the edge of G, hence no two such portions cross each other. Thus, Γ is a clique-planar representation of (G , S).
Suppose that there exists a clique-planar representation Γ of (G , {s 1 , s 2 }). We construct a b2pbesc B of G(V 1 ∪ V 2 , E ) as follows. Refer to Fig. 5. Initialize B = Γ . By Lemma 2, the order in which the rectangles representing the vertices u 1 , ..., u k in s 1 are encountered when traversing the boundary B 1 of their arrangement clockwise, is a subsequence of R(u 1 ), ..., R(u k ), R(u k−1 ), ..., R(u 2 ). Hence, for any two points p a 1 on R(u 1 ) ∩ B 1 and p b 1 on R(u k ) ∩ B 1 , there exists a curve 1 between p a 1 and p b 1 entering R(u 1 ), ..., R(u k ) in this order. Place vertex u i of V 1 at the point where 1 enters R(u i ). Define 2 , p a 2 and p b 2 , and draw the vertices of V 2 analogously. Further, add to B two curves 12 and 21 , not intersecting each other, not intersecting the same link-edge, each intersecting a link edge at most once, and connecting p a 1 to p b 2 , and p a (V 2 ) appear along 1 (along 2 ) in the same order as the corresponding rectangles appear along B 1 (along B 2 ) in Γ , by construction. Finally, consider the curve composed of 1 , 12 , 2 , and 21 . We have that all the vertices of V 1 (of V 2 ) appear consecutively along , since they all lie on 1 (on 2 ); also, each edge e ∈ E crosses at most once, either on 12 or on 21 . Hence, B is a b2pbesc of G(V 1 ∪ V 2 , E ). This concludes the proof of the lemma.
We now consider a variant of the Clique Planarity problem for two cliques in which each clique is associated with a 2-partition of the link-edges incident to it, and the goal is to construct a clique-planar representation in which the link-edges in different sets of the partition exit the clique on "different sides". This constraint finds a correspondence with the variant of the (non-bipartite) 2-page book embedding problem, called Partitioned 2-page book embedding problem, in which vertices are allowed to be arbitrarily permuted along the spine, while the edges are pre-assigned to the pages of the book [12]. i be the part of B i from q i to p i in clockwise direction (this is the bottom side of Γ i ). We aim to construct a clique-planar representation of (G, S) in which all the link-edges in E a i (resp. in E b i ) intersect the arrangement Γ i of rectangles representing s i on the top side (resp. on the bottom side) of Γ i . We call the problem of determining whether such a representation exists 2-Partitioned Clique Planarity. We prove that 2-Partitioned Clique Planarity can be solved in quadratic time.
The algorithm is based on a reduction to equivalent special instances of Simultaneous Embedding with Fixed Edges (sefe) that can be decided in quadratic time. Given two graphs G 1 and G 2 on the same vertex set V , the sefe problem asks to find planar drawings of G 1 and G 2 that coincide on V and on the common edges of G 1 and G 2 . We have the following.
Planarity. An equivalent instance G 1 , G 2 of sefe such that G 1 = (V, E 1 ) and G 2 = (V, E 2 ) are 2-connected and such that the common graph G ∩ = (V, E 1 ∩ E 2 ) is connected can be constructed in linear time.
Proof. By Lemma 7, we can describe (G, {s 1 , s 2 }) by its equivalent instance G(V 1 ∪ V 2 , E ) of b2pbesc, where V 1 is the vertex set of s 1 , V 2 is the vertex set of s 2 , and E is the set of link-edges of (G, {s 1 , s 2 }). The partition {E a i , E b i } of the edges incident to s i translates to constraints on the side of the spine of the b2pbesc each of these edges has to be incident to. Namely, for each vertex u i ∈ V 1 , all the edges in E a 1 (in E b 1 ) incident to u i have to exit u i from the internal (resp. external) side of ; and analogously for the edges of E a 2 and E b 2 . This implies that edges in E a 1 ∩ E a 2 entirely lie inside , edges in E b 1 ∩ E b 2 entirely lie outside , while the other edges have to cross . Fig. 7. The SEFE Γ 1 , Γ 2 of G 1 , G 2 corresponding to Γ from Fig. 5.
We now describe how to construct G 1 , G 2 . Refer to Fig. 7. The common graph G ∩ contains a cycle C = (t 1 , r 1 , t 2 , t 3 , r 2 , t 4 , q 2 , q 1 ). Also, G ∩ contains two stars Q 1 and Q 2 centered at q 1 and q 2 , respectively, where Q 1 has a leaf w(u i ) for each vertex u ∈ V 1 and a leaf w(e) for each edge e ∈ E a 1 ∩ E b 2 , and where Q 2 has a leaf w (v) for each vertex v ∈ V 2 and a leaf w (e) for each edge e ∈ E b 1 ∩ E a 2 . Further, G ∩ contains trees T i rooted at t i , for i = 1, ..., 4, defined as follows. Tree T 1 contains a leaf z(e) adjacent to t 1 for each edge e ∈ E a 1 ∩ E b 2 ; also, it contains a vertex w 1 adjacent to t 1 ; finally, it contains a leaf z(u), adjacent to w 1 , for each vertex u ∈ V 1 that is incident to at least one edge in E b 1 . Tree T 2 contains a leaf z (e) adjacent to t 2 for each edge e ∈ E a 1 ∩ E b 2 ; also, it contains a vertex w 2 adjacent to t 2 ; finally, it contains a leaf z (u), adjacent to w 2 , for each vertex u ∈ V 1 that is incident to at least one edge in E a 1 . Tree T 3 contains a leaf x(e) adjacent to t 3 for each edge e ∈ E a 2 ∩E b 1 ; also, it contains a vertex w 3 adjacent to t 3 ; finally, it contains a leaf x(v), adjacent to w 3 , for each vertex v ∈ V 2 that is incident to at least one edge in E a 2 . Tree T 4 contains a leaf x (e) adjacent to t 4 for each edge e ∈ E a 2 ∩ E b 1 ; also, it contains a vertex w 4 adjacent to t 4 ; finally, it contains a leaf x (v), adjacent to w 4 , for each vertex v ∈ V 2 that is incident to at least one edge in E b 2 .
Finally, G ∩ contains two stars R 1 and R 2 centered at r 1 and r 2 , respectively, with the same number of leaves as T 1 . Namely, R 1 (R 2 ) contains a leaf r 1 (e) (a leaf r 2 (e)) adjacent to r 1 (to r 2 , resp.) for each edge e ∈ E a 1 ∩ E b 2 ; also, it contains a leaf r 1 (u) (a leaf r 2 (u), resp.) for each vertex u ∈ V 1 that is incident to at least one edge in E b 1 . Graph G 1 contains G ∩ plus the following edges. Consider each edge e = (u, v) with u ∈ V 1 and v ∈ V 2 . If e ∈ E a 1 ∩ E b 2 , graph G 1 has an edge (w(e), z(e)) and an edge (z (u), z (e)); if e ∈ E b 1 ∩ E a 2 , graph G 1 has an edge (w (e), x (e)) and an edge (x(v), x(e)); if e ∈ E a 1 ∩ E a 2 , graph G 1 has an edge (z (u), x(v)). For each vertex u ∈ V 1 , if u is incident to at least one edge in E b 1 , then G 1 contains edge (w(u), z(u)) and edge (r 1 (u), r 2 (u)), otherwise it contains edge (w(u), w 1 ). For each vertex v ∈ V 2 , if v is incident to at least one edge in E b 2 , then G 1 contains edge (w (v), x (v)), otherwise it contains edge (w (v), w 4 ). Graph G 2 contains G ∩ plus the following edges. Consider each edge e = (u, v) with u ∈ V 1 and v ∈ V 2 . If e ∈ E a 1 ∩ E b 2 , graph G 2 has an edge (w(e), z (e)), an edge (z(e), r 1 (e)), and an edge (r 2 (e), x (v)). If e ∈ E a 2 ∩ E b 1 , graph G 2 has an edge (r 2 (u), x (e)) and an edge (w (e), x(e)). If e ∈ E b 1 ∩ E b 2 , graph G 1 has an edge (r 2 (u), x (v)). For each vertex u ∈ V 1 , if u is incident to at least one edge in E a 1 , then G 2 contains edge (w(u), z (u)), otherwise it contains edge (w(u), w 2 ). Also, if u is incident to at least one edge in E b 1 , then The order of the leaves of Q 1 represents the order in which the vertices of s 1 and the crossings between edges of E a 2 ∩ E b 1 appear along ; analogously, the order of the leaves of Q 2 represents the order in which the vertices of s 2 and the crossings between edges of E a 1 ∩ E b 2 appear along . Hence, concatenating these two orders yields a total order of the vertices and of the crossings along . In the following we prove that this correspondence determines a b2pbesc, when starting from a sefe, and vice versa.
Suppose that G 1 , G 2 admits a sefe. Let O 1 and O 2 be the orders in which the leaves of Q 1 and of Q 2 appear around q 1 and q 2 , respectively. We obtain a b2pbesc B by concatenating O 1 and O 2 , where each vertex u i of V 1 corresponds to leaf w(u i ) of Q 1 , each vertex v j of V 2 corresponds to leaf w (v j ) of Q 2 , and the crossing between an edge e and the spine of B corresponds to either leaf w(e) of Q 1 or leaf w (e) of Q 2 , depending on whether e ∈ E b 1 ∩ E a 2 or e ∈ E a 1 ∩ E b 2 . Since the leaves of Q 1 corresponding to vertices of V 1 are all connected to vertex w 1 by paths belonging to the same graph G 1 , they appear consecutively around q 1 , and hence the corresponding vertices of V 1 appear consecutively along . Analogously, all the vertices of V 2 appear consecutively along , as the corresponding leaves of Q 2 are all connected to w 4 . These two facts imply that all the edges cross the spine in a point lying between a vertex of V 1 and a vertex of V 2 . Hence, the order of the vertices along the spine of B is consistent with a valid b2pbesc. We now show that this order also allows drawing the edges without crossings.
The routing of each edge e = (u i , v j ) is performed as follows. If e ∈ E a 1 ∩ E a 2 , then e is drawn as a curve on the internal side of . If e ∈ E b 1 ∩ E b 2 , then e is drawn as a curve on the external side of . If e ∈ E a 1 ∩ E b 2 , then e is drawn as a curve whose portion between u i and the crossing point y e is on the internal side of , and whose portion between y e and v j is on the external side of . If e ∈ E b 1 ∩ E a 2 , then e is drawn as a curve whose portion between u i and y e is on the external side of , and whose portion between y e and v j is on the internal side of .
First observe that, because of the edges connecting Q 1 with T 1 and T 2 , the clockwise order of the leaves of Q 1 coincides with the counterclockwise order of the leaves of T 1 and T 2 , when restricting these orders to the leaves corresponding to the same vertices and edges. The same holds for Q 2 with respect to T 3 and T 4 . Also, because of the edges connecting R 1 with T 1 and R 2 , the clockwise order of the leaves of R 2 is the same as the one of the leaves of T 1 .
We now prove that no two edges in the constructed book embedding cross each other. Observe that each edge either entirely lies in one of the two sides of , or it crosses once, hence it is composed of two portions in different sides of . Clearly, it suffices to prove that no two edges (or portions) on the same side of cross each other.
Consider the portions of the edges of G(V 1 ∪ V 2 , E ) that lie on the same side of , say on the internal side of : these are edges e = (u i , v j ) in E a 1 ∩ E a 2 , the portions of the edges e = (u m , v h ) in E a 1 ∩ E b 2 between u m and y e , and the portions of the edges e = (u l , v p ) in E b 1 ∩ E a 2 between y e and v p . Every edge of the first type corresponds to an edge (z (u i ), x(v j )) of G 1 ; every portion of an edge of the second type corresponds to an edge (z (u m ), z (e)) of G 1 ; and every portion of an edge of the third type corresponds to an edge (x(e), x(v p )) of G 1 . Since all these edges belong to G 1 , they do not cross in the given sefe. By construction, for each vertex of G incident to at least one of the considered edges, there is a corresponding leaf of either T 2 or T 3 in G ∩ ; also, for each of these edges that crosses , there is a corresponding leaf of either T 2 or T 3 in G ∩ . Further, these leaves appear, in the left-to-right order of the leaves of T 2 and T 3 , in the same order as they appear along , by the previous observation that the order of the leaves of T 2 (of T 3 ) coincides with the one of Q 1 (of Q 2 , resp.). This implies that the considered edges of G(V 1 ∪ V 2 , E ) do not cross in the internal side of . Analogous arguments can be used to prove that the portions of the edges of G(V 1 ∪ V 2 , E ) lying in the external side of do not cross each other. In this case, the edges of the sefe that have to be considered are (r 2 (u i ), x (v j )), (r 2 (u i ), x (e)), and (r 2 (e), x (v j )), which all belong to G 2 . We now prove the opposite direction. Suppose that G(V 1 ∪ V 2 , E ) admits a b2pbesc B. We construct a sefe of G 1 , G 2 as follows.
We define a linear ordering σ 1 of the vertices of V 1 and the crossings between and the edges in E a 1 ∩ E b 2 ; σ 1 is the clockwise order in which such vertices and crossings appear along starting at any vertex of V 2 . Observe that, since B is a b2pbesc, all the vertices in V 1 appear consecutively in σ 1 . Analogously, we define a linear ordering σ 2 of the vertices of V 2 and the crossings between and the edges in E a 2 ∩ E b 1 ; σ 2 is the clockwise order in which such vertices and crossings appear along starting at any vertex of V 1 . Observe that, since B is a b2pbesc, all the vertices in V 2 appear consecutively in σ 2 .
Recall that each leaf of Q 1 either corresponds to a vertex in V 1 or to an edge in E a 1 ∩ E b 2 . Thus, we can define a clockwise linear ordering of the leaves of Q 1 around q 1 as the corresponding vertices and crossings appear in σ 1 ; this linear ordering starts after edge (q 1 , t 1 ). A clockwise linear ordering of the leaves of Q 2 around q 2 is defined analogously from σ 2 starting from edge (q 2 , q 1 ).
The order of the leaves of trees T i , with i = 1, 2, 3, 4, and of stars R 1 and R 2 is also decided based on σ 1 and σ 2 . This allows us to draw all the edges of G 1 and G 2 that are incident to stars Q 1 , Q 2 , R 1 , and R 2 without crossings; in particular, the paths connecting q 1 to w 1 and w 2 , and those connecting q 2 to w 3 and w 4 can be drawn without crossings since the vertices of V 1 (and the vertices of V 2 ) are consecutive along in B. The fact that the edges connecting the leaves of T 2 and T 3 , and the edges connecting the leaves of R 2 and T 4 can be drawn without crossings is again due to the fact that, by construction, these edges correspond to portions of edges of G lying on the same side of .
Graph G ∩ is connected, by construction. The fact that G 1 and G 2 are 2-connected can be proved as follows. Graph G 1 is composed of the outer cycle C, plus a set of 2-connected components connecting pairs of vertices of C. One component connects q 1 to t 1 ; one component connects r 1 to r 2 ; one connects q 2 to t 4 ; and another one connects t 2 to t 3 . In particular, in order for this latter component to actually exist, at least one edge in E a 1 ∩ E a 2 must exist. However, this fact can be assumed without loss of generality, as otherwise two dummy vertices and an edge in E a 1 ∩ E a 2 between them could be added to the instance without altering the possibility of finding a b2pbesc. As for G 2 , it is also composed of the outer cycle C, plus a set of 2-connected components connecting pairs of vertices of C. One component connects q 1 to t 2 ; one connects t 1 to r 1 ; one connects r 2 to t 4 ; and another one connects q 2 to t 3 .
As G 1 , G 2 can be easily constructed in linear time, the lemma follows. Proof. Apply Lemma 8 to construct in linear time an instance G 1 , G 2 of sefe that is equivalent to (G, S) such that G 1 and G 2 are biconnected and their intersection graph G ∩ is connected. The statement follows from the fact that instances of sefe with this property can be solved in quadratic time [4].

Clique Planarity with Given Hierarchy
In this section we study a version of the Clique Planarity problem in which the cliques are given together with a hierarchical relationship among them. Namely, let (G, S) be an instance of Clique Planarity and let ψ : S → {1, ..., k}, with k ≤ |S|, be an assignment of the cliques in S to k levels such that, for each link-edge (u, v) of G connecting a vertex u of a clique s to a vertex v of a clique s , we have ψ(s ) = ψ(s ); an instance is proper if ψ(s ) = ψ(s ) ± 1 for each link-edge. We aim to construct canonical clique-planar representations of (G, S) such that: -(Property 1) for each clique s ∈ S, the top side of the bounding box of the representation of s lies on the line y = 2ψ(s), while the bottom side lies above the line y = 2ψ(s) − 2; and -(Property 2) each link-edge (u, v), with u ∈ s , v ∈ s , ψ(s ) < ψ(s ), is drawn as a y-monotone curve from the top side of R(u) to the bottom side of R(v).
We call the problem of testing whether such a representation exists Level Clique Planarity. We show how to test level clique planarity in quadratic time for proper instances via a linear-time reduction to equivalent proper instances of T-level Planarity [2].
A T -level graph (V, E, γ, T ) consists of: A T -level planar drawing of (V, E, γ, T ) is a planar drawing of G where the edges are y-monotone curves and the vertices in V i are placed along the line y = i, denoted by i , according to an order compatible with T i ; that is, for each internal node µ of T i , the leaves of the subtree of T i rooted at µ are consecutive along i .
A T -level graph is T -level planar if it admits a T -level planar drawing. The T -Level Planarity problem asks to test whether a T -level graph is T -level planar. We have the following.  Suppose that (V, E , γ, T ) admits a T -level planar drawing Γ , as in Fig. 8(a). We construct a clique-planar representation with the desired properties as follows; refer to Fig. 8(b). For each clique s ∈ S with ψ(s) = i, we construct a canonical representation of s in a bounding box of size (1 + ε) × (1 + ε), with 0 < ε < 1, and plug it between lines y = 2ψ(s) and y = 2ψ(s) − 2 with the top side of the bounding box lying on line y = 2ψ(s). Note that the bottom side of the bounding box is above the line y = 2ψ(s) − 2. Cliques on the same level are placed side-by-side, so that they do not touch each other. Finally, for each two consecutive levels V i and V i+1 , consider the edges in E connecting a vertex u ∈ V i with a vertex v ∈ V i+1 as they appear in Γ from left to right; we draw the corresponding link-edge (u, v) ∈ E as a polyline, lying to the right of any previously drawn edge between V i and V i+1 , composed of three segments: the first is a vertical segment connecting a point on the top side of R(u) with a point p u on the top side of the bounding box of s , the third is a vertical segment connecting a point on the bottom side of R(v) with a point p v on the bottom side of the bounding box of s , the middle one is a straight-line segment connecting p u with p v .
The obtained representation satisfies Properties 1 and 2 by construction. That the link-edges do not cross each other descends from the following two facts. First, the node w s in T ψ(s) enforces vertices of the same clique s to be consecutive along ψ(s) in Γ . Second, for each clique s ∈ S, the squares representing the vertices of s are in the same order as the corresponding vertices of s along ψ(s) . This implies that, for any two cliques s ∈ V i and s ∈ V i+1 , the left-to-right order in which the link-edges between s and s intersect the line y = 2ψ(s ) is the same as the one in which they intersect the line y = 2(ψ(s )) − (1 + ε), hence no two such link-edges cross.
Suppose that (G(V, E), S, ψ) admits a clique-planar representation satisfying Properties 1 and 2. We construct a T -level planar drawing Γ of (V, E , γ, T ) as follows. For i = 1, ..., k, consider a line i defined as y = 2i − 1. Place each vertex v ∈ V i , at the intersection between i and the left side of R(v). Note that such an intersection exists since the clique-planar representation of (G(V, E), S, ψ) satisfies Property 1. Draw each edge (u, v) with u ∈ V i and v ∈ V i+1 as a curve composed of three parts: The middle part coincides with the drawing of the corresponding link-edge, which connects a point p u on the top side of R(u) with a point p v on the bottom side of R(v); the first part is a curve connecting u with p u entirely contained inside R(u) not crossing any other edge (this can be done by routing the curve first following the left side of R(u) and then following the top side of R(u)); and the last part is a curve connecting v with p v entirely contained inside R(v) not crossing any other edge (this can be done by routing the curve first following the left side of R(v) and then following the bottom side of R(v)).
We show that Γ is a T -level planar drawing of (V, E , γ, T ). No two edges cross in Γ since the middle parts of the edges in E have the same drawing as the link-edges in E, which do not cross by hypothesis, while the first and the last parts do not cross by construction. Finally, the fact that the ordering of the vertices of V i along i is compatible with T i descends from the fact that i intersects all the rectangles of each clique s with ψ(s) = i and that no two rectangles representing vertices belonging to different cliques overlap. Hence, vertices belonging to the same clique, and hence children of the same internal node of T i , are consecutive along i .
The construction can be performed in linear time, thus proving the lemma.
We thus get the main result of this section.
Theorem 5. Level Clique Planarity is solvable in quadratic time for proper instances and in quartic time for general instances.
Proof. Any instance (G, S, ψ) of Level Clique Planarity can be made proper by introducing dummy cliques composed of single vertices to split link-edges spanning more than one level. This does not alter the level clique planarity of the instance and might introduce a quadratic number of vertices. Lemma 9 constructs in linear time an equivalent proper instance of T-level Planarity. The statement follows since T-level Planarity can be solved in quadratic time [2] for proper instances.

Conclusions and Open Problems
We initiated the study of hybrid representations of graphs in which vertices are geometric objects and edges are either represented by intersections (if part of dense subgraphs) or by curves (otherwise). Several intriguing questions arise from our research.