Abstract
For a clustered graph, i.e, a graph whose vertex set is recursively partitioned into clusters, the CPlanarity Testing problem asks whether it is possible to find a planar embedding of the graph and a representation of each cluster as a region homeomorphic to a closed disk such that (1) the subgraph induced by each cluster is drawn in the interior of the corresponding disk, (2) each edge intersects any disk at most once, and (3) the nesting between clusters is reflected by the representation, i.e., child clusters are properly contained in their parent cluster. The computational complexity of this problem, whose study has been central to the theory of graph visualization since its introduction in 1995 [Feng, Cohen, and Eades, Planarity for clustered graphs, ESA’95], has only been recently settled [Fulek and Tóth, Atomic Embeddability, Clustered Planarity, and Thickenability, to appear at SODA’20]. Before such a breakthrough, the complexity question was still unsolved even when the graph has a prescribed planar embedding, i.e, for embedded clustered graphs. We show that the CPlanarity Testing problem admits a singleexponential singleparameter FPT (resp., XP) algorithm for embedded flat (resp., nonflat) clustered graphs, when parameterized by the carvingwidth of the dual graph of the input. These are the first FPT and XP algorithms for this longstanding open problem with respect to a single notable graphwidth parameter. Moreover, the polynomial dependency of our FPT algorithm is smaller than the one of the algorithm by Fulek and Tóth. In particular, our algorithm runs in quadratic time for flat instances of bounded treewidth and bounded face size. To further strengthen the relevance of this result, we show that an algorithm with running time O(r(n)) for flat instances whose underlying graph has pathwidth 1 would result in an algorithm with running time O(r(n)) for flat instances and with running time \(O(r(n^2) + n^2)\) for general, possibly nonflat, instances.
Introduction
Many realworld data exhibit an intrinsic hierarchical structure that can be captured in the form of clustered graphs, i.e., graphs equipped with a recursive clustering of their vertices. This graph model has proved very powerful to represent information at different levels of abstraction and drawings of clustered networks appear in a wide variety of application domains, such as software visualization [65], knowledge representation [60], visual statistics [22], and data mining [63]. More formally, a clustered graph (for short, cgraph) is a pair \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\), where G is the underlying graph and \({\mathcal {T}}\) is the inclusion tree of \({\mathcal {C}}\), i.e., a rooted tree whose leaves are the vertices of G. Each nonleaf node \(\mu \) of \({\mathcal {T}}\) corresponds to a cluster containing the subset \(V_\mu \) of the vertices of G that are the leaves of the subtree of \({\mathcal {T}}\) rooted at \(\mu \).
A natural and wellestablished criterion for a readable visualization of a cgraph has been derived from the classical notion of graph planarity. A cplanar drawing of a cgraph \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) (see Fig. 7c) is a planar drawing of G together with a representation of each cluster \(\mu \) in \({\mathcal {T}}\) as a region \(D(\mu )\) homeomorphic to a closed disc such that: (1) for each cluster \(\mu \) in \({\mathcal {T}}\), region \(D(\mu )\) contains the drawing of the subgraph \(G[V_\mu ]\) of G induced by \(V_\mu \); (2) for every two clusters \(\mu \) and \(\eta \) in \({\mathcal {T}}\), it holds \(D(\eta ) \subseteq D(\mu )\) if and only if \(\eta \) is a descendant of \(\mu \) in \({\mathcal {T}}\); (3) each edge crosses the boundary of any cluster disk at most once; and (4) the boundaries of no two cluster disks intersect. A cgraph is cplanar if it admits a cplanar drawing.
The CPlanarity Testing problem, introduced by Feng et al. and Eades more than two decades ago [41], asks for the existence of a cplanar drawing of a cgraph. Despite several algorithms having been presented in the literature to construct cplanar drawings of cplanar cgraphs with nice aesthetic features [10, 38, 54, 62], determining the computational complexity of the CPlanarity Testing problem has been one of the most challenging quests in the graph drawing research area; see, e.g., the survey papers [19, 28, 69]. A generalization of the CPlanarity Testing problem is the problem of testing the planarity of hypergraphs, which was introduced by Johnson and Pollak [59]. Given a hypergraph (V, U), where V is a finite set of vertices and U is a finite set of hyperedges, i.e., subsets of V, the Hypergraph Planarity problem asks for the existence of a planar graph \(P = (V, E)\) such that the graph P[X] is connected, for every \(X \in U\). The Hypergraph Planarity problem was shown to be NPcomplete [59] and this negative result holds even if U is the union of two partitions [12]. In contrast, there are polynomialtime algorithms to test hypergraph planarity when P is required to belong to specific families of planar graphs [15, 20, 21, 23, 61, 72] or when U is the union of two partitions and, for every \(X \in U\), not only G[X] but also \(G[V \setminus X]\) is required to be connected [11]. To shed light on the complexity of the CPlanarity Testing problem, several researches have tried to highlight its connections with other notoriously difficult problems in the area [3, 69], as well as to consider relaxations [5, 7, 8, 11, 33, 40, 73] and more constrained versions [2, 4, 6, 9, 30, 42, 43] of the classical notion of cplanarity. Algebraic approaches have also been considered [44, 53]. Only recently, Fulek and Tóth settled the question by giving a polynomialtime algorithm for a generalization of the CPlanarity Testing problem, called Atomic Embeddability [47].
A cluster \(\mu \) is connected if \(G[V_\mu ]\) is connected, and it is disconnected otherwise. A cgraph is cconnected if every cluster is connected. Efficient algorithms for the cconnected case have been known since the early stages of the research on the problem [29, 36, 41]. Afterwards, polynomialtime algorithms have also been conceived for cgraphs satisfying other, weaker, connectivity requirements [27, 49, 52]. A cgraph is flat if each leaftoroot path in \(\mathcal{T}^{} \) consists of exactly two edges, that is, the clustering determines a partition of the vertex set; see, e.g.,Fig. 7a. For flat cgraphs polynomialtime algorithms have been presented for several restricted cases [2, 13, 16, 25, 39, 43, 45, 55, 57, 58].
Motivations and contributions. In this paper, we consider the parameterized complexity of the CPlanarity Testing problem for embedded cgraphs, i.e., cgraphs with a prescribed combinatorial embedding, having a connected underlying graph; see also [16, 26, 34, 58] for previous work in this direction. The focus on instances with a fixed embedding is a natural restriction as several graph drawing problems are often easier to solve in this setting. In fact, by our result in [34] there exists a lineartime reduction from CPlanarity Testing of embedded cgraphs to CPlanarity Testing of general cgraphs. Notably, such a reduction only works for instances with a connected underlying graph. We remark that all the existing algorithms for CPlanarity Testing of embedded cgraphs only deal with instances having a connected underlying graph. In fact, whether the CPlanarity Testing problem is polynomialtime solvable for embedded cgraphs having a disconnected underlying graph remains an open problem.
In Sect. 2, we show that the CPlanarity Testing problem retains its complexity when restricted to instances of bounded pathwidth and to connected instances of bounded treewidth. Such a result, which holds even for general, nonembedded, cgraphs, implies that the goal of devising an algorithm parameterized by graphwidth parameters that are within a constant factor from treewidth (e.g., branchwidth [66]) or that are bounded by pathwidth (e.g., treewidth, rankwidth [64], booleanwidth [1], and cliquewidth [32]) and with a dependency on the input size which improves upon the one in [47] appears to be a significant algorithmic challenge. The estimate on the running time of the algorithm presented in [47] is \(O(n^8)\) for flat cgraphs and \(O(n^{16})\) for nonflat cgraphs. However, as noted by the authors [46], these estimates depend on the running time of an algorithm presented by Carmesin [24, Section 6] to test whether a simply connected 2polyhedron embeds in \(R^3\), and the correctness of the claimed running time of this algorithm has not been confirmed yet.
Remarkably, before the results presented in [47], the computational complexity of the problem was still unsolved even for instances with faces of bounded size, and polynomialtime algorithms were known only for “small” faces and in the flat scenario. Namely, Jelinkova et al. [58] presented a quadratictime algorithm for 3connected flat cgraphs with faces of size at most 4. Subsequently, Di Battista and Frati [39] presented a lineartime/linearspace algorithm for embedded flat cgraphs with faces of size at most 5.
Motivated by the discussion above and by the results in Sect. 2, we focus our attention on embedded cgraphs \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) whose underlying graph G has both bounded treewidth and bounded face size, i.e., instances such that the carvingwidth of the dual \({{{\delta}}}(G)\) of G is bounded. Gu and Tamaki [51] showed that, for a planar graph, a carving decomposition of optimal width can be computed in \(O(n^3)\) time; further, Thilikos, Serna, and Bodlaender [71] gave an FPT algorithm running in \(O({\hat{g}}(\omega )n)\) time, where \({\hat{g}}\) is a computable function, to construct a carving decomposition of width \(\omega \) of a (notnecessarily planar) graph, if any, or to decide that none exists. In Sect. 3, we present an FPT (resp., XP) algorithm based on a dynamicprogramming approach on a special carvingdecomposition, namely, a bondcarving decomposition, of \({{{\delta }}}(G)\), to solve the problem for embedded flat (resp., nonflat) cgraphs. The key ingredient of our algorithm lies in the ability of maintaining a succinct description of the internal cluster connectivity via noncrossing partitions. We remark that, to the best of the authors’ knowledge, these are the first FPT and XP algorithms for the CPlanarity Testing problem, with respect to a single graphwidth parameter. More formally, we prove the following results.
Theorem 1.1
CPlanarity Testing can be solved in \(O(2^{4 \omega + \log \omega } n + n^2)\) time for any nvertex embedded flat cgraph \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\), where \(\omega \) is the carvingwidth of \({{\delta}}(G)\), if a carving decomposition of \({{{\delta }}}(G)\) of width \(\omega \) is provided, and in \(O\big ((2^{4 \omega + \log \omega } + {\hat{g}}(\omega )) n + n^2\big )\) time, otherwise.
Theorem 1.2
CPlanarity Testing can be solved in \(O(4^{4\omega + \log \omega } h^{2\omega 1}n + n^2)\) time for any nvertex embedded nonflat cgraph \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\), where \(\omega \) is the carvingwidth of \({{{\delta }}}(G)\) and h is the height of \(\mathcal T\), if a carving decomposition of \({{{\delta }}}(G)\) of width \(\omega \) is provided, and in \(O\big ((4^{4\omega + \log \omega } h^{2\omega 1} + {\hat{g}}(\omega ))n + n^2 \big )\) time, otherwise.
Since \(h \le n\), Theorem 1.2 immediately translates into a slicewise polynomial (XP) algorithm, parameterized by the dual carving width, for CPlanarity Testing of embedded nonflat cgraphs. We formalize this in the following.
Corollary 1.1
CPlanarity Testing can be solved in \(O(4^{4\omega + \log \omega } n^{2\omega })\) time for any nvertex embedded nonflat cgraph \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\), where \(\omega \) is the carvingwidth of \({{{\delta }}}(G)\), if a carving decomposition of \({{{\delta }}}(G)\) of width \(\omega \) is provided, and in \(O\big ((4^{4\omega + \log \omega } + {\hat{g}}(\omega ))n^{2\omega }\big )\) time, otherwise.
It is well known that the carvingwidth \({{\,\mathrm{cw}\,}}({{{\delta }}}(H))\) of the dual graph \({{{\delta }}}(H)\) of a plane graph H with maximum face size \(\ell (H)\) and treewidth \({{\,\mathrm{tw}\,}}(H)\) satisfies the relationship \({{\,\mathrm{cw}\,}}({{{\delta }}}(H)) \le \ell (H)({{\,\mathrm{tw}\,}}(H)+2)\) [14, 18]. Therefore, Theorem 1.1 and Corollary 1.1 provide the first^{Footnote 1} polynomialtime algorithms for instances of bounded face size and bounded treewidth. This also answers an open question posed by Di Battista and Frati [39, Open Problem (ii)] for flat instances of bounded treewidth; also, since any nvertex planar graph has treewidth in \(O(\sqrt{n})\), it provides an \(2^{O(\sqrt{n})}\) subexponentialtime algorithm for flat instances of bounded face size, which improves the previous \(2^{O(\sqrt{n}\log {n})}\) time bound presented in [34] for such instances. Finally, in Sect. 4, we exploit Theorems 1.1 and 1.2 to get singleparameter FPT and XP algorithms with respect to the embeddedwidth and to the dual cutwidth of the underlying graph.
Definitions and Preliminaries
In this section, we give definitions and preliminaries that will be useful throughout.
Graphs and connectivity. A graph \(G=(V,E)\) is a pair, where V is the set of vertices of G and E is the set of edges of G, i.e., pairs of vertices in V. A multigraph is a generalization of a graph that allows the existence of multiple copies of the same edge. The degree of a vertex is the number of its incident edges. We denote the maximum degree of G by \(\varDelta (G)\). Also, for any \(S \subseteq V\), we denote by G[S] the subgraph of G induced by the vertices in S.
A graph is connected if it contains a path between any two vertices. A cutvertex is a vertex whose removal disconnects the graph. A connected graph is 2connected if either it is an edge or it does not contain any cutvertices. The blocks of a graph are its maximal 2connected subgraphs.
Planar graphs and embeddings. A drawing of a graph is planar if it contains no edge crossings. A graph is planar if it admits a planar drawing. Two planar drawings of the same graph are equivalent if they determine the same rotation at each vertex, i.e, the same circular orderings for the edges around each vertex. A combinatorial embedding (for short, embedding) is an equivalence class of planar drawings. A planar drawing partitions the plane into topologically connected regions, called faces. The bounded faces are the inner faces, while the unbounded face is the outer face. A combinatorial embedding together with a choice for the outer face defines a planar embedding. An embedded graph (resp. plane graph) G is a planar graph with a fixed combinatorial embedding (resp. fixed planar embedding). The length of a face f of G is the number of occurrences of the edges of G encountered in a traversal of the boundary of f. The maximum face size \(\ell (G)\) of G is the maximum length over all faces of G.
CPlanarity. An embedded cgraph \(\mathcal{C}^{} (G,\mathcal{T}^{})\) is a cgraph whose underlying graph G has a prescribed combinatorial embedding, and it is cplanar if it admits a cplanar drawing that preserves the given embedding. Since we only deal with embedded cgraphs, in the remainder of the paper we will refer to them simply as cgraphs, excepts in the statements of theorems and lemmas where we explicitly specify whether the considered cgraphs are embedded or not. Also, when G and \(\mathcal T\) are clear from the context, we simply denote \(\mathcal{C}^{} (G,\mathcal{T}^{})\) as \(\mathcal C\). Given a nonroot cluster \(\mu \in \mathcal{T}^{} \), a vertex \(v \in V(G)\) is a vertex of \(\mu \), if \(v \in V_\mu \), and an edge \((u,v) \in E(G)\) is an intracluster edge of \(\mu \), if both u and v are in \(V_\mu \), and it is an intercluster edge of \(\mu \), otherwise. Note that, given two clusters \(\mu , \nu \in \mathcal{T}^{} \) such that \(\nu \) is an ancestor of \(\mu \), the intracluster edges of \(\mu \) are also intracluster edges of \(\nu \), but the reverse is not necessarily true.
A candidate saturating edge of \({\mathcal {C}}\) is an edge (u, v) not in G such that u and v are incident to the same face of G and there exists a nonroot cluster \(\mu \in \mathcal{T}^{} \) for which both u and v are in \(V_\mu \); refer to Fig. 7b. A cgraph \({\mathcal {C}}^{\prime }_{}(G^{\prime }_{},{\mathcal {T}}^{\prime }_{})\) with \({\mathcal {T}}' = {\mathcal {T}}\) obtained by adding to \(\mathcal{C}^{} \) a subset \(E^+\) of its candidate saturating edges is a super cgraph of \(\mathcal{C}^{} \); also, if \(G'\) is planar, then the set \(E^+\) is a planar saturation and the edges in \(E^+\) are the saturating edges of \({\mathcal {C}}\). Furthermore, cgraph \({\mathcal {C}}\) is holefree if there exists a face f in G such that, when f is chosen as the outer face, there does not exist any cycle whose vertices are in \(V_\mu \) that encloses in its interior a vertex not in \(V_\mu \), for some nonroot cluster \(\mu \in \mathcal{T}^{} \). Finally, two cgraphs are equivalent if they are both cplanar or they are both not cplanar.
Remark 2.1
In this paper, unless stated otherwise, we only consider cgraphs whose underlying graph is connected.
We will exploit the following characterization presented by Di Battista and Frati [39], which holds true also for nonflat cgraphs although originally only proved for flat cgraphs.
Theorem 2.1
([39], Theorem 1) An embedded cgraph \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) is cplanar if and only if:

(i)
G is planar,

(ii)
\({\mathcal {C}}\) is holefree, and

(iii)
there exists an embedded super cgraph \({\mathcal {C}}^{*}_{}(G^{*}_{},{\mathcal {T}}^{*}_{})\) of \({\mathcal {C}}\) such that \(G^*\) is planar and \({\mathcal {C}}^*\) is cconnected.
Condition i of Theorem 2.1 can be tested using any of the known lineartime planaritytesting algorithms. Condition ii of Theorem 2.1 can be verified in linear time as described by Di Battista and Frati [39, Lemma 7], by exploiting the lineartime algorithm for checking if an embedded, possibly nonflat, cgraph is holefree presented by Dahlhaus [36]. Therefore, in the following we will assume that any cgraph satisfies these conditions and thus view the CPlanarity Testing problem as one of testing Condition iii of Theorem 2.1.
Treewidth. A tree decomposition of a graph G is a tree T whose nodes, called bags, are labeled by subsets of vertices of G. For each vertex v of G the bags containing v must form a nonempty contiguous subtree of T, and for each edge (u, v) of G at least one bag of T must contain both u and v. The width of the decomposition is one less than the maximum cardinality of any bag. The treewidth \({{\,\mathrm{tw}\,}}(G)\) of G is the minimum width of any of its tree decompositions.
Cutsets and duality. Let \(G = (V,E)\) be a connected graph and let S be a subset of V. The partition \(\{S,V\setminus S\}\) of V is a cut of G and the set \(E(S,V\setminus S)\) of edges with an endpoint in S and an endpoint in \(V\setminus S\) is a cutset of G. Also, the cutset \(E(S,V\setminus S)\) is a bond if G[S] and \(G[V\setminus S]\) are both nonnull and connected.
For an embedded graph G, the dual \({{{\delta }}}(G)\) of G is the planar multigraph that has a vertex \(v_f\), for each face f of G, and an edge \((v_f,v_g)\), for each edge e shared by faces f and g; the edge e is the dual edge of \((v_f,v_g)\), and vice versa. Also, \(\delta (G)\) is 2connected if and only if G is 2connected. Figure 1a shows an embedded graph G (black edges) and its dual \({{\,{\delta }\,}}(G)\) (purple edges); we will use these graphs as running examples throughout the paper. The following duality is well known.
Lemma 2.1
([48], Theorem 14.3.1) If G is an embedded graph, then a set of edges is a cycle of G if and only if their dual edges form a bond in \({{{\delta }\,}}(G)\).
Carvingwidth. A carving decomposition of a graph \(G = (V,E)\) is a pair \((D, \gamma )\), where D is a rooted binary tree whose leaves are the vertices of G, and \(\gamma \) is a function that maps the nonroot nodes of D, called bags, to cutsets of G as follows. For any nonroot bag \(\nu \), let \(D_\nu \) be the subtree of D rooted at \(\nu \) and let \({\mathcal {L}}_\nu \) be the set of leaves of \(D_\nu \). Then, \(\gamma (\nu ) = E({\mathcal {L}}_\nu , V \setminus {\mathcal {L}}_\nu )\). The width of a carving decomposition \((D,\gamma )\) is the maximum of \(\gamma (\nu )\) over all bags \(\nu \) in D. The carvingwidth \({{\,\mathrm{cw}\,}}(G)\) of G is the minimum width over all carving decompositions of G. The dual carvingwidth is the carvingwidth of the dual of G. Note that, the maximum face size \(\ell (G)\) coincides with the maximum degree of \({{\,{\delta }\,}}(G)\), which is a lower bound for the \({{\,\mathrm{cw}\,}}({{\,{\delta }\,}}(G))\). A bondcarving decomposition is a special kind of carving decomposition in which each cutset is a bond of the graph; i.e., in a bondcarving decomposition every cutset separates the graph into two connected components [67, 70]. In [70], Seymour and Thomas presented a quadratictime algorithm to convert a carving decomposition into a bondcarving decomposition of the same width.
In this paper, we view a bondcarving decomposition of the vertices of the dual \({{\,{\delta }\,}}(G)\) of an embedded graph G as a decomposition of the faces of G; see Fig. 1c. A similar approach was followed in [14]. In particular, due to the duality expressed by Lemma 2.1, the cutsets \(\gamma (\nu )\) of the bags \(\nu \) of D correspond to cycles that can be used to recursively partition the faces of the primal graph, where these cycles are formed by the edges of the primal that are dual to those in each cutset.
Partitions. Let \({\mathcal {Q}} = \{q_1, q_2, \dots , q_n\}\) be a ground set. A partition of \({\mathcal {Q}}\) is a set \(\{Q_1,\dots ,Q_k\}\) of nonempty subsets \(Q_i\)’s of \({\mathcal {Q}}\), called parts, such that \({\mathcal {Q}}= \bigcup ^k_{i=1} Q_i\) and \(Q_i \cap Q_j = \emptyset \), with \(1 \le i < j \le k\). Observe that \(k \le {\mathcal {Q}}\).
Let now \({\mathcal {S}} = (s_1, s_2, \dots , s_n)\) be a cyclicallyordered set, i.e., a set equipped with a circular ordering. Let a, b, and c be three elements of \({\mathcal {S}}\) such that b appears after a and before c in the circular ordering of \({\mathcal {S}}\); we write \(a \prec _b c\). A partition P of \({\mathcal {S}}\) is crossing, if there exist elements \(a,c \in S_i\) and \(b,d \in S_j\), with \(S_i,S_j \in P\) and \(i \ne j\), such that \(a \prec _b c\) and \(c \prec _d a\); and, it is noncrossing, otherwise. We denote the set of all the noncrossing partitions of \({\mathcal {S}}\) by \({\mathcal {N}}{\mathcal {C}}({\mathcal {S}})\). Note that, \({\mathcal {N}}{\mathcal {C}}({\mathcal {S}})\) coincides with the Catalan number \({\mathcal {C}}{\mathcal {A}}{\mathcal {T}}(n)\) of n, which satisfies \({\mathcal {C}}{\mathcal {A}}{\mathcal {T}}(n) \le 2^{2n}\) [50, Chapter 19].
Relationship Between GraphWidth Parameters and Connectivity
In this section, we present reductions that shed light on the effect that the interplay between some notable graphwidth parameters and the connectivity of the underlying graph have on the computational complexity of the CPlanarity Testing problem.
We will exploit recent results by Cortese and Patrignani, who proved the following:

(a)
Any nvertex nonflat cgraph \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) can be transformed into an equivalent \(O(n \cdot h)\)vertex flat cgraph in quadratic time [31, Theorem 1], where h is the height of \(\mathcal T\).

(b)
Any nvertex flat cgraph can be turned into an equivalent O(n)vertex independent flat cgraph, i.e., a flat cgraph such that each nonroot cluster induces an independent set, in linear time [31, Theorem 2].
We remark that the reductions from [31] preserve the connectivity of the underlying graph.
Theorem 2.2
Let \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) be an nvertex (flat) cgraph and let h be the height of \(\mathcal T\). In \(O(n^2)\) time (in O(n) time), it is possible to construct an \(O(n\cdot h)\)vertex (O(n)vertex) independent flat cgraph \({\mathcal {C}}^{\prime }_{}(G^{\prime }_{},{\mathcal {T}}^{\prime }_{})\) that is equivalent to \({\mathcal {C}}\) such that:

(i)
\(G'\) is a collection of stars or

(ii)
\(G'\) is a tree.
Proof
Let \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) be an nvertex (flat) cgraph. By the results (a) and (b) above, we can construct an \(O(n\cdot h)\)vertex (O(n)vertex) independent flat cgraph \({\mathcal {C}}^{+}_{}(G^{+}_{},{\mathcal {T}}^{+}_{})\) equivalent to \(\mathcal C\) in \(O(n^2)\) time (in O(n) time). Note that, \(G^+\) only contains intercluster edges.
Consider the following transformation defined for a single edge \(e=(u,v)\) of \(G^+\), which constructs a new cgraph \({\mathcal {C}}^1\) starting from \({\mathcal {C}}^+\). First, subdivide the edge e with two dummy vertices \(u_e\) and \(v_e\) to create edges \((u,u_e)\), \((u_e,v_e)\), and \((v_e,v)\). Then, delete the edge \((u_e,v_e)\). Finally, assign \(u_e\) and \(v_e\) to a new cluster \(\mu _e\), and add \(\mu _e\) as a child of the root of the tree \({\mathcal {T}}^+\). To construct \({\mathcal {C}}'\) in case (i), we perform the above transformation for all the edges of \(G^+\). To construct \({\mathcal {C}}'\) in case (ii), as long as the graph contains a cycle, we perform the above transformation for an edge e of such a cycle. Since the transformation to obtain \({\mathcal {C}}^1\) from \({\mathcal {C}}^+\) takes O(1) time, the construction of \({\mathcal {C}}'\) from \({\mathcal {C}}^+\) can be done in linear time both in case (i) and (ii), the running time follows. Furthermore, Conditions i, ii of Theorem 2.1 are trivially satisfied by \({\mathcal {C}}'\) since \(G'\) contains no cycles.
To show the correctness of the reduction, it suffices to prove that \({\mathcal {C}}^1\) is cplanar if and only if \({\mathcal {C}}^+\) is cplanar. Suppose first that \({\mathcal {C}}^+\) is cplanar and thus by Theorem 2.1, it has a cconnected super cgraph \({\mathcal {C}}^{+}_{con}(G^{+}_{con},{\mathcal {T}}^{+}_{con})\) with \(G^+_{con}\) planar. We now construct a cconnected super cgraph \({\mathcal {C}}^{1}_{con}(G^{1}_{con},{\mathcal {T}}^{1}_{con})\) of \({\mathcal {C}}^1\) with \(G^1_{con}\) planar as follows. First, initialize \(G^1_{con} = G^+_{con}\) and \({\mathcal {T}}^1_{con} = {\mathcal {T}}^1\). As \(G^+_{con}\) is a super graph of \(G^+\), the edge e also belongs to \(G^+_{con}\) (and thus to \(G^1_{con}\)). Then, subdivide the edge e with the vertices \(u_e\) and \(v_e\) to create edges \((u,u_e)\), \((u_e,v_e)\), and \((v_e,v)\) in \(G^1_{con}\). Clearly, \(G^1_{con}\) is a super graph of \(G^1\); also, since e is an intercluster edge, all the clusters of \({\mathcal {T}}^+_{con}\) are still connected in \(G^1_{con}\). Also, the cluster \(\mu _e\) is connected in \(G^1_{con}\) as the edge \((u_e,v_e)\) is present in \(G^1_{con}\). Therefore, \({\mathcal {C}}^1_{con}\) is a cconnected super cgraph of \({\mathcal {C}}^1\) and thus, by Theorem 2.1, \({\mathcal {C}}^1\) is cplanar.
Suppose now that \({\mathcal {C}}^1\) is cplanar and thus, by Theorem 2.1, it has a cconnected super cgraph \({\mathcal {C}}^{1}_{con}(G^{1}_{con},{\mathcal {T}}^{1}_{con})\) with \(G^1_{con}\) planar. We now construct a cconnected super cgraph \({\mathcal {C}}^{+}_{con}(G^{+}_{con},{\mathcal {T}}^{+}_{con})\) of \({\mathcal {C}}^+\) with \(G^+_{con}\) planar as follows. First, initialize \(G^+_{con} = G^1_{con}\) and \({\mathcal {T}}^+_{con} = {\mathcal {T}}^+\). As \({\mathcal {C}}^1_{con}\) is cconnected, the cluster \(\mu _e\) is also connected, i.e., we have the edge \((u_e,v_e)\) in \(G^1_{con}\). Consider the path \((u, u_e, v_e, v)\) and replace it with the edge (u, v). Clearly, all the clusters of \({\mathcal {T}}^+_{con}\) are still connected in \(G^+_{con}\), and \(G^+_{con}\) is still planar. Therefore, \({\mathcal {C}}^+_{con}\) is a cconnected super cgraph of \({\mathcal {C}}^+\) and thus, by Theorem 2.1, \({\mathcal {C}}^+\) is cplanar.\(\square \)
We point out that by applying the reduction in the above proof without enforcing a specific embedding, Theorem 2.2 also holds for general instances of the CPlanarity Testing problem, i.e., nonembedded cgraphs. Moreover, since the reduction given in [31] also works for disconnected instances, applying the reduction of Theorem 2.2 for case (i) to a general disconnected instance \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) would result in an equivalent independent flat cgraph \({\mathcal {C}}^{\prime }_{}(G^{\prime }_{},{\mathcal {T}}^{\prime }_{})\) such that \(G'\) is a collection of stars. An immediate, yet important, consequence of this discussion is that an algorithm with running time O(r(n)) for flat instances whose underlying graph is a collection of stars would result in an algorithm with running time O(r(n)) for flat instances and with running time \(O(r(n^2) + n^2)\) for general, possibly nonflat, instances, where r is a computable function.
The proof of the following lemma, which will turn useful in the following sections, is based on the duality expressed by Lemma 2.1.
Lemma 2.2
Given an nvertex embedded cgraph \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) and a carving decomposition \((D,\gamma )\) of \({{\,{\delta }\,}}(G)\) of width \(\omega \), in \(O(n^2)\) time, it is possible to construct an O(n)vertex embedded cgraph \({\mathcal {C}}^{\prime }_{}(G^{\prime }_{},{\mathcal {T}}^{\prime }_{})\) that is equivalent to \({\mathcal {C}}\) such that \(G'\) is 2connected, and a carving decomposition \((D',\gamma ')\) of \({{\,{\delta }\,}}(G')\) of width \(\omega ' = \max (\omega ,4)\).
Proof
Let B(H) and X(H) be the set of blocks and cutvertices of a graph H respectively. For each cutvertex \(c \in X(H)\), let \(i_c(H)\) denotes the number of blocks incident to c and let \(i_H = \sum _{c \in X(H)}i_c(H)\). Since G is planar, we have that \(i_G \in O(n)\). We construct \({\mathcal {C}}^{\prime }_{}(G^{\prime }_{},{\mathcal {T}}^{\prime }_{})\) as follows.
Consider the following operation defined for a cutvertex \(c \in X(G)\). Let \(\mu \) be the cluster that is the parent of c in \({\mathcal {T}}\), and let (u, c) and (v, c) be two edges belonging to different blocks of G that are clockwise consecutive in the list of edges incident to c. Let f be the face of G that is to the left of the edge (u, c) when traversing this edge from u to c (and thus also to the left of the edge (v, c) when traversing this edge from c to v). Refer to Fig. 2. Consider the cgraph \({\mathcal {C}}^{+}_{}(G^{+}_{},{\mathcal {T}}^{+}_{})\) obtained as follows. Initialize \({\mathcal {C}}^+\) to \({\mathcal {C}}\). Then, embed a path \((u,c^+,v)\) inside the face f of \(G^+\), where \(c^+\) is a new vertex that we add as a child of \(\mu \) in \({\mathcal {T}}^+\); see Fig. 2. We denote by \(f'\) the face of \(G^+\) bounded by the cycle \((u,c^+,v,c)\) and by \(f''\) the other face of \(G^+\) incident to \(c^+\). We have that \({\mathcal {C}}\) and \({\mathcal {C}}^+\) are equivalent. This is due to the fact that any saturating edge (c, x) incident to c and lying in f (of a cconnected cplanar super cgraph of \({\mathcal {C}}\)) can be replaced by two saturating edges \((x,c^+)\) lying in \(f''\) and \((c^+,c)\) lying in \(f'\) (of a cconnected cplanar super cgraph of \({\mathcal {C}}^+\)), and vice versa.
We now show that \({{\,{\delta }\,}}(G^+)\) admits a carving decomposition \((D^+,\gamma ^+)\) of width \(\omega ^+ = \max (\omega ,4)\). In order to do so, we show how to modify the carving decomposition \((D,\gamma )\) of \({{\,{\delta }\,}}(G)\) of width \(\omega \) into \((D^+,\gamma ^+)\). Consider the leaf bag \(\nu _f\) of D corresponding to face f and let \(\alpha \) be the parent of \(\nu _f\) in D. We construct \(D^+\) from D as follows. First, we initialize \((D^+,\gamma ^+) = (D, \gamma )\); in the following, we denote by \(\nu '\) the bag of \(D^+\) corresponding to the bag \(\nu \) of D. We remove \(\nu '_f\) from \(D^+\), add a new nonleaf bag \(\lambda '\) as a child of \(\alpha '\) and two leaf bags \(\nu '_{f'}\), corresponding to face \(f'\), and \(\nu '_{f''}\), corresponding to face \(f''\), as children of \(\lambda '\); refer to Fig. 2. Let \(e_1=(f',f''')\), \(e_2=(f',f'')\), \(e_3=(f_1,f')\), and \(e_4=(f',f'')\) be the edges of \({{\,{\delta }\,}}(G^+)\) that are dual to the edges (u, c), \((u,c^+)\), (v, c), and \((v,c^+)\) of \(G^+\), respectively, where \(f'''\) is the face of \(G^+\) incident to (u, c) different from \(f'\). We have \(\gamma ^+(\nu '_{f'})= \{e_1,e_2,e_3,e_4\}\), \(\gamma ^+(\nu '_{f''})= (\gamma (\nu '_f) \setminus \{e_1,e_3\}) \cup \{e_2,e_4\}\), \(\gamma ^+(\lambda ') = \gamma (\nu '_f)\), and \(\gamma ^+(\nu ') = \gamma (\nu )\), for any other bag \(\nu \) belonging to both \(D^+\) and D. In particular, the size of the edgecuts defined by all the bags different from \(\nu '_{f'}\) stays the same, while the size of the edgecut of \(\nu '_{f'}\) is 4. Therefore, \((D^+,\gamma ^+)\) is a carving decomposition of \({{\,{\delta }\,}}(G^+)\) of width \(\omega ^+ = \max (\omega ,4)\).
Let c be a cutvertex in X(G). We perform the operation described above for each pair of clockwise consecutive edges incident to c in G which belong to different blocks of G. This results in a cgraph \({\mathcal {C}}^{}_{c}(G^{}_{c},{\mathcal {T}}^{}_{c})\) equivalent to \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) such that \(X(G_c) = X(G) \setminus \{c\}\), \(V(G_c) = V(G) + i_c(G)\), and \(i_{G_c} = i_G  i_c(G)\). Moreover, as discussed above, \({{\,{\delta }\,}}(G_c)\) admits a carving decomposition \((D_c,\gamma _c)\) of width \(\omega _c = \max (\omega ,4)\). The construction of the cgraph \({\mathcal {C}}_c\) and of the carving decomposition \((D_c,\gamma _c)\) can be achieved in linear time by exploiting standard doublylinked lists with pointers stored with the elements, which support the following two operations in constant time (according to a prescribed orientation of the edges that allows to define when a face leaves an edge to its left/right): (1) Given two clockwise consecutive edges incident to a common vertex, retrieve the face that leaves both such edges to its right/left, and (2) given an edge (u, c) and a face that leaves such an edge to its right/left, retrieve the edge (v, c) that leaves such a face to its left/right. Note that, such data structures can be constructed in linear time from the edgeface incidence graph of G; for implementation details see, e.g., [37].
Repeating the above procedure as long as no cutvertex is left, eventually yields a 2connected cgraph \({\mathcal {C}}^{\prime }_{}(G^{\prime }_{},{\mathcal {T}}^{\prime }_{})\), with \(V(G') = n + i_G = O(n)\), that is equivalent to \({\mathcal {C}}\) and a carving decomposition \((D',\gamma ')\) of \({{\,{\delta }\,}}(G')\) of width \(\omega ' = \max (\omega ,4)\). Since, for each cutvertex c, the execution of the above procedure takes \(O(V(G'))\) time and since the cutvertices and the blocks of graph \(G_c\) can be computed in \(O(V(G'))\) time [56], we have that \({\mathcal {C}}'\) and \((D',\gamma ')\) can be constructed in \(O(n^2)\) time. This concludes the proof. \(\square \)
A DynamicProgramming Algorithm for CPlanarity Testing
In this section, we present an FPT algorithm for the CPlanarity Testing problem of cgraphs parameterized by the dual carvingwidth. We first describe a dynamicprogramming algorithm to test whether a 2connected cgraph \({\mathcal {C}}\) is cplanar, by verifying whether \({\mathcal {C}}\) satisfies Condition iii of Theorem 2.1. Then, by combining this result and Lemma 2.2, we extend the algorithm to simplyconnected instances.
A key ingredient of our algorithm lies in the ability of maintaining a succinct description of the internal cluster connectivity of a subgraph of a given cgraph. This is done by exploiting noncrossing partitions of the vertex set of a cgraph. In the following, we provide definitions and operations that allow us to handle these partitions in an efficient way. Hereafter we first give concepts which are common to both flat and nonflat cgraphs. Then, in Sects. 3.1 and 3.2 we present concepts which are tailored for flat and nonflat cgraphs, respectively. Finally, in Sect. 3.3, we present our algorithm to test whether a 2connected cgraph \({\mathcal {C}}\) is cplanar.
Annotated Sets in Clustered Graphs. Let \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) be a cgraph. A set \({\mathcal {S}} = \{S_1, S_2, \dots , S_k\}\) such that \(S_i \subset V(G)\), for every \(i \in \{1,2,\dots ,k\}\), is a clusteredannotated set of \(\mathcal{C}^{} \) if each element \(S_i \in {\mathcal {S}}\) is associated with a nonroot cluster \(\mu _i \in \mathcal{T}^{} \). Next we define how the association between the elements \(S_i\) of a clusteredannotated set and clusters of \(\mathcal{T}^{} \) are altered by performing union and intersection operations.
Definition 3.1
Let \({\mathcal {S}}\) and \({\mathcal {S}}'\) be two clusteredannotated sets of a cgraph \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\). Let \(S \in \mathcal S\) and \(S' \in \mathcal S'\), and let \(\mu \) and \(\mu '\) be the clusters associated with S and \(S'\), respectively. Also, let Q be a subset of V(G). We have the following:

(a)
The cluster \(\mu _\cup \) associated with \(S_\cup = S \cup S'\) is the lowest common ancestor of \(\mu \) and \(\mu '\) in \(\mathcal{T}^{} \).

(b)
The cluster \(\mu _\cap \) associated with \(S_\cap = S \cap Q\) is \(\mu \).
Condition a of Definition 3.1 has a simple, yet important, consequence which we formally state below.
Remark 3.1
The intracluster edges of both \(\mu \) and \(\mu '\) are also the intracluster edges of \(\mu _\cup \), while the opposite is not necessarily true.
Flat CGraphs
Let \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) be a flat cgraph. A flat partition of a set \(V' \subseteq V(G)\) is a partition of \(V'\) that is also a clusteredannotated set of \(\mathcal{C}^{} \). A flat partition \(\{ S_1,\dots ,S_k \}\) is good if all the vertices of \(S_i\) are in \(V_{\mu _i}\) where \(\mu _i\) is the cluster associated with \(S_i\), for each part \(S_i\). As \(\mathcal{C}^{} \) is a flat cgraph, every vertex of G belongs to a unique nonroot cluster, therefore the association between parts and nonroot clusters in a good flat partition is uniquely defined. Furthermore, a flat partition of a cyclicallyordered set \(V' \subseteq V(G)\) is admissible if it is both good and noncrossing.
Let P be a good flat partition of a set \({\mathcal {Q}} \subseteq V(G)\) and let \({\mathcal {Q}}' \subset {\mathcal {Q}}\). The projection of P onto \({\mathcal {Q}}'\), denoted as \(P_{{\mathcal {Q}}'}\), is the flat partition of \({\mathcal {Q}}'\) obtained from P by first replacing each part \(S_i \in P\) with \(S_i \cap {\mathcal {Q}}'\) and then removing empty parts, if any. Since P is good and by Condition b of Definition 3.1, we have that each part of \(P_{{\mathcal {Q}}'}\) is associated with a nonroot cluster such that all its vertices belong to that cluster. Therefore, \(P_{{\mathcal {Q}}'}\) is good.
We define the binary operator \(\uplus _F\), called generalized union, that given two good flat partitions \(P'\) and \(P''\) of sets \({\mathcal {Q}}' \subseteq V(G)\) and \({\mathcal {Q}}'' \subseteq V(G)\), respectively, returns a good flat partition \(P^* = P' \uplus _F P''\) of \({\mathcal {Q}}' \cup {\mathcal {Q}}''\) obtained as follows. Initialize \(P^* = P' \cup P''\). Then, as long as there exist \(Q_i,Q_j \in P^*\) such that \(Q_i \cap Q_j \ne \emptyset \), replace sets \(Q_i\) and \(Q_j\) with their union \(Q_i \cup Q_j\) in \(P^*\). We now argue that \(P^*\) is good. First, since \(P'\) and \(P''\) are both good, \(Q_i\) and \(Q_j\) are associated with nonroot clusters, say \(\mu \) and \(\mu '\). Second, since \(\mathcal{C}^{} \) is a flat cgraph, \(Q_i \cap Q_j \ne \emptyset \) implies that \(\mu = \mu '\). Finally, by Condition a of Definition 3.1, \(Q_i \cup Q_j\) is associated with \(\mu \). We have the following.
Lemma 3.1
The generalized union \(P^* = P' \uplus _F P''\) of two good flat partitions \(P'\) and \(P''\) can be computed in \(O({\mathcal {Q}}'+{\mathcal {Q}}'')\) time.
Proof
We show how to compute \(P^*\) in \(O({\mathcal {Q}}'+{\mathcal {Q}}'')\) time. Let \(P' = \{Q'_1,\dots ,Q'_{k'}\}\) and \(P'' = \{Q''_1,\dots ,Q''_{k''}\}\). We construct an undirected graph \(G^*\) as follows. First, for each element \(a \in {\mathcal {Q}}' \cup {\mathcal {Q}}''\), we add a vertex \(v_a\) to \(V(G^*)\). Then, for each part \(Q'_i \in P'\) (resp. \(Q''_i \in P''\)), we add a vertex \(v_{Q'_i}\) (resp. \(v_{Q''_i}\)) to \(V(G^*)\). Finally, for each element \(x \in Q'_i\) (resp. \(x \in Q''_i\)), we add an edge \((v_x, v_{Q'_i})\) (resp. \((v_x, v_{Q''_i})\)) to \(E(G^*)\). As \(k' \le {\mathcal {Q}}'\) and \(k'' \le {\mathcal {Q}}''\), \(V(G^*) \le {\mathcal {Q}}'+{\mathcal {Q}}''+k'+k'' \le 2({\mathcal {Q}}'+{\mathcal {Q}}'')\) and \(E(G^*) \le {\mathcal {Q}}'+{\mathcal {Q}}''\).
Observe that, for every part \(Q'_i \in P'\) (resp. \(Q''_i \in P''\)), the set \(V_{Q'_i} = \{v_{Q'_i}\} \cup \{v_x  x \in Q'_i\}\) (resp. \(V_{Q''_i} = \{v_{Q''_i}\} \cup \{v_x  x \in Q''_i\}\)) induces a star in \(G^*\). Therefore, there exist \(Q'_i \in P'\) and \(Q''_j \in P''\) such that \(Q'_i \cap Q''_j \ne \emptyset \) if and only if \(V_{Q'_i \cup Q''_j} = \{v_{Q'_i}\} \cup \{v_{Q''_j}\} \cup \{v_x  x \in Q'_i \cup Q''_j\} \) induces a connected subgraph of \(G^*\). We now perform a breadthfirst search (BFS) in \(G^*\) to find all the connected components of \(G^*\). Let \(C= \{C_1, C_2, \dots , C_l\}\) be the set of all the connected components. For every \(C_i \in C\), we construct a new part \(Q^*_i\) by removing from \(C_i\) the vertices corresponding to parts in \(P'\) and \(P''\). The set \(\{Q^*_1, \dots , Q^*_l\}\) is our required \(P^*\). Since the BFS runs in \(O(V(G^*)+E(G^*))\) time, the lemma follows. \(\square \)
An admissible flat partition P of a cyclicallyordered set \({\mathcal {S}} \subseteq V(G)\) can be naturally associated with a 2connected plane graph G(P) as follows; see, e.g., Fig. 3c. The outer face of G(P) is a cycle C(P) whose vertices are the elements in \({\mathcal {S}}\) and the clockwise order in which they appear along C(P) is the same as in \({\mathcal {S}}\). Also, for each part \(S_i \in P\) such that \(S_i \ge 2\), graph G(P) contains a vertex \(v_i\) in the interior of C(P) that is adjacent to all the elements in \(S_i\), i.e., removing all the edges of C(P) yields a collection of stars, whose central vertices are the \(v_i\)’s, and isolated vertices. To show that G(P) is planarly embedded, we only need to prove that the edges incident to the central vertices of any two different stars do not cross. In particular, let \(v_1\) and \(v_2\) be the central vertices of two different stars and let \((v_1,a)\), \((v_1, b)\), \((v_2, c)\), and \((v_2,d)\) be edges of G(P). Since \(a, b \in S_1\) and \(c, d \in S_2\) and since P is noncrossing, we have that both c and d are encountered when traversing the cycle C from a to b either clockwise or counterclockwise. Therefore, either \(v_1\) and all its incident edges are embedded in the interior of the cycle composed of the edges \((v_2, c)\), \((v_2,d)\), and the edges of the subpath of the cycle C encountered while traversing C from c to d either clockwise or counterclockwise. We say that G(P) is the cyclestar associated with P.
We also extend the definitions of generalized union and projection to admissible flat partitions by regarding the corresponding cyclicallyordered sets as unordered. We remark that the projection of an admissible flat partition always yields an admissible flat partition. On the other hand, the generalized union of two admissible flat partitions may produce a flat partition which is good but crossing. However, in the following we define an operator, central to our algorithm, which given two admissible flat partitions (with some additional properties) returns an admissible flat partition.
Definition 3.2
Let \(P'\) and \(P''\) be two admissible flat partitions of cyclicallyordered sets \({\mathcal {S}}' \subseteq V(G)\) and \({\mathcal {S}}'' \subseteq V(G)\), respectively, with the following properties (where \({\mathcal {S}}_\cap = \{s_1, s_2, \dots , s_k\}\) denotes the set of elements that are common to \({\mathcal {S}}'\) and \({\mathcal {S}}''\)): (i) \({\mathcal {S}}_\cap  \ge 2\) and \(({\mathcal {S}}' \cup {\mathcal {S}}'') \setminus {\mathcal {S}}_\cap \ne \emptyset \), (ii) the elements of \({\mathcal {S}}_\cap \) appear consecutively both in \({\mathcal {S}}'\) and \({\mathcal {S}}''\), and (iii) the cyclic ordering of the elements in \({\mathcal {S}}_\cap \) determined by \({\mathcal {S}}'\) is the reverse of the cyclic ordering of these elements determined by \({\mathcal {S}}''\).
The binary operator, called bubble merge, returns an admissible flat partition obtained as follows; refer to Fig. 3. Consider the cyclestars \(G(P')\) and \(G(P'')\) associated with \(P'\) and \(P''\), respectively.

First, identify the vertices corresponding to the same element of \({\mathcal {S}}_\cap \) in both \(C(P')\) and \(C(P'')\) (see Fig. 3a) in such a way that no vertex of \(C(P')\) lies inside \(C(P'')\), and viceversa. Since the elements in \({\mathcal {S}}_\cap \) are consecutive along both \(C(P')\) and \(C(P'')\), by item (ii), and since the ordering of such elements along \(C(P')\) is the reverse of their ordering along \(C(P'')\), by item (iii), this yields a new plane graph H (see Fig. 3b). Note that H is 2connected since \(G(P')\) and \(G(P'')\) are 2connected and since \({\mathcal {S}}_\cap  \ge 2\); therefore, the outer face \(f_H\) of H is a simple cycle.

Second, traverse \(f_H\) clockwise to construct a cyclicallyordered set \({\mathcal {S}}^* \subseteq {\mathcal {S}}' \cup {\mathcal {S}}''\) on the vertices of \(f_H\).

Finally, set \(P^* = (P' \uplus _F P'')_{{\mathcal {S}}^*}\). \(P^*\) is good by the definition of generalized union and projection. The fact that \(P^*\) is a noncrossing partition of \({\mathcal {S}}^*\) follows immediately from the planarity of H (see Fig. 3c).
Lemma 3.1 and the fact that the graph H in Definition 3.2 can be easily constructed from \(P'\) and \(P''\) in linear time imply the following.
Lemma 3.2
The bubble merge of two admissible flat partitions \(P'\) and \(P''\) can be computed in \(O({\mathcal {S}}'+{\mathcal {S}}'')\) time.
NonFlat CGraphs
In this subsection, we show how the concepts of flat partition, good flat partition, admissible flat partition, generalized union, projection, and bubble merge need to be naturally extended to nonflat cgraphs. To this aim, recall that an intracluster edge is an edge that connects two vertices of the same cluster. Therefore, in a nonflat cgraph \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\), an intracluster edge for a cluster \(\mu \in \mathcal T\) is also an intracluster edge for all the clusters that are encountered on the path from \(\mu \) to the root of \(\mathcal T\).
In the context of nonflat cgraphs, we are going to use an extension of the notion of noncrossing partition that takes into account the inclusion between clusters. Let \({\mathcal {Q}} = \{q_1, q_2, \dots , q_n\}\) be a ground set. In a recursive partition \(P = \{Q_1,\dots ,Q_k\}\) of \({\mathcal {Q}}\), it holds that either \(Q_i \cap Q_j = \emptyset \) or \(Q_i \subset Q_j\), with \(1 \le i < j \le k\). Observe that \(k \le 2{\mathcal {Q}}  1\), as it is possible to represent the hierarchy of P by means of a rooted tree whose leaves are the elements in \({\mathcal {Q}}\) and whose internal vertices have degree greater than 2, except possibly for the root which may have degree 2.
Let now \({\mathcal {S}} = (s_1, s_2, \dots , s_n)\) be a cyclicallyordered set. A recursive partition P of \({\mathcal {S}}\) is crossing, if there exist elements \(a,c \in S_i\) and \(b,d \in S_j\), with \(S_i,S_j \in P\) and \(S_i \cap S_j = \emptyset \) (i.e. neither \(S_i\) nor \(S_j\) are contained in one another), such that \(a \prec _b c\) and \(c \prec _d a\); and, it is noncrossing, otherwise. We observe that the size of the set \({\mathcal {R}}{\mathcal {N}}{\mathcal {C}}({\mathcal {S}})\) of all the noncrossing recursive partitions of \({\mathcal {S}}\) coincides with \({\mathcal {C}}{\mathcal {A}}{\mathcal {T}}(2n1)\), as each noncrossing recursive partition in \({\mathcal {R}}{\mathcal {N}}{\mathcal {C}}({\mathcal {S}})\) can be paired with exactly one rooted ordered tree on \(2n1\) vertices whose leaves are the elements of \({\mathcal {S}}\) [50, Chapter 32].
Let \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) be a cgraph. The depth of a cluster \(\mu \in \mathcal{T}^{} \) is the length of the path between \(\mu \) and the root cluster in \(\mathcal{T}^{} \). Observe that, the root cluster has depth 0. A cluster \(\nu \in \mathcal{T}^{} \) is an ancestor (resp., successor) of a cluster \(\mu \in \mathcal{T}^{} \), with \(\mu \ne \nu \), if \(\mu \) belongs to the subtree of \(\mathcal{T}^{} \) rooted at \(\nu \) (resp., \(\nu \) belongs to the subtree of \(\mathcal{T}^{} \) rooted at \(\mu \)). Observe that, a cluster is neither an ancestor nor a successor of itself. Given a set \(S \subseteq V(G)\), the lowest common ancestor of S in \({\mathcal {T}}\) is the deepest cluster \(\mu \in {\mathcal {T}}\) such that all the vertices of S are in \(V_\mu \). A nonflat partition of a set \(V' \subseteq V(G)\) is a recursive partition of \(V'\) that is also a clusteredannotated set of \(\mathcal{C}^{} \). A nonflat partition \({\mathcal {S}} = \{ S_1,\dots ,S_k \}\) is good if (i) all the vertices of \(S_i\) are in \(V_{\mu _i}\), where \(\mu _i\) is the cluster associated with \(S_i\), for each part \(S_i \in {\mathcal {S}}\), and (ii) for any two parts \(S_i, S_j \in {\mathcal {S}}\) such that \(S_i \subset S_j\), \(\mu _i\) should be a successor of \(\mu _j\). Let \({\mathcal {S}}= \{ S_1,\dots ,S_k \}\) be a good nonflat partition. Since \(\mathcal{C}^{} \) is a nonflat cgraph and \({\mathcal {S}}\) is good, for each part \(S_i \in {\mathcal {S}}\), the cluster associated with \(S_i\) must be either the lowest common ancestor \(\mu _i\) of \(S_i\) in \({\mathcal {T}}\) or a nonroot ancestor of \(\mu _i\) in \({\mathcal {T}}\). The details of how this association is defined are given in Sect. 3.3. Furthermore, a nonflat partition of a cyclicallyordered set \(V' \subseteq V(G)\) is admissible if it is both good and noncrossing. The definition of projection of a nonflat partition onto a set is identical to the corresponding definition in the flat setting.
In order to the extend the definition of generalized union to be applicable to pairs of good nonflat partitions, we introduce the following auxiliary directed graph; refer to Fig. 4. Given a pair \((P', P'')\) of good nonflat partitions of sets \({\mathcal {Q}}' \subset V(G)\) and \({\mathcal {Q}}'' \subset V(G)\), respectively, we construct a graph \(A(P', P'')\) as follows. The vertex set of \(A(P',P'')\) contains a vertex \(v_\mu \) if there exists a part \(S \in P' \cup P''\) that is associated with the cluster \(\mu \). The edge set of \(A(P', P'')\) contains an edge \(v_\mu v_\nu \) directed from \(v_\mu \) to \(v_\nu \), if \(\nu \) is an ancestor of \(\mu \) in \({\mathcal {T}}\) and there exists no vertex \(v_\tau \) in the vertex set of \(A(P', P'')\) such that the cluster \(\tau \) is in the path connecting \(\mu \) and \(\nu \) in \({\mathcal {T}}\). Observe that, by construction, the underlying undirected graph of \(A(P',P'')\) is a forest. Also, two parts \(S', S'' \in P' \cup P''\) intersect only if there exists a directed path in \(A(P', P'')\), possibly of length 0, between the vertices corresponding to the clusters to which \(S'\) and \(S''\) are associated with. This holds since there exists a directed path between two vertices of \(A(P', P'')\) only if the corresponding clusters are one ancestor of the other in \({\mathcal {T}}\).
We are now ready to define the generalized union \(\uplus _R\) of \(P'\) and \(P''\), which returns a nonflat partition \(P^* = P' \uplus _R P''\) of \({\mathcal {Q}}' \cup {\mathcal {Q}}''\) obtained as follows; refer to Fig. 5. We initialize \(P^* = P' \cup P''\). Then, we perform the following procedure consisting of two phases.

Phase 1. We visit the vertices of \(A(P', P'')\). When we are at a vertex \(v_\mu \), as long as there exist \(Q_i,Q_j \in P^*\) such that \(Q_i\) and \(Q_j\) are associated with the same cluster \(\mu \) and \(Q_i \cap Q_j \ne \emptyset \), we remove sets \(Q_i\) and \(Q_j\) from \(P^*\) and add the set \(Q_i \cup Q_j\) to \(P^*\). By Condition a of Definition 3.1, the set \(Q_i \cup Q_j\) is associated with the cluster \(\mu \). Observe that, after this phase is completed, any two parts \(Q_i,Q_j \in P^*\) intersect only if \(Q_i\) and \(Q_j\) are associated with different clusters.

Phase 2. We again visit the vertices of \(A(P', P'')\), but according to a topological ordering of such vertices from sources to sinks. When we are at a vertex \(v_\mu \), as long as there exist \(Q_i,Q_j \in P^*\) such that (a) \(Q_i \cap Q_j \ne \emptyset \), and (b) \(Q_i\) is associated with the cluster \(\mu \), \(Q_j\) is associated with the cluster \(\nu \), and \(v_\mu v_\nu \) is an edge of \(A(P', P'')\), we remove the part \(Q_j\) from \(P^*\) and add the part \(Q_i \cup Q_j\) to \(P^*\). By Condition a of Definition 3.1, the set \(Q_i \cup Q_j\) is associated with the cluster \(\nu \).
By the above definition, the generalized union of \(P'\) and \(P''\) can be easily computed in quadratic time. We formalize this fact in the following.
Lemma 3.3
The generalized union \(P^* = P' \uplus P''\) of two good nonflat partitions \(P'\) and \(P''\) can be computed in \(O\big (({\mathcal {Q}}'+{\mathcal {Q}}'')^2\big )\) time.
In the same way as an admissible flat partition P can be naturally associated with a cyclestar G(P), an admissible nonflat partition \(P'\) of a cyclicallyordered set \({\mathcal {S}} \subset V(G)\) can be naturally associated with a 2connected plane graph \(G_R(P')\), as follows. The outer face of \(G_R(P')\) is a cycle \(C(P')\) whose vertices are the elements in \({\mathcal {S}}\) and the clockwise order in which they appear along \(C(P')\) is the same as in \({\mathcal {S}}\). Also, for each part \(S_i \in P'\), graph \(G_R(P')\) contains a vertex \(v_i\) in the interior of \(C(P')\). We further add the following edges to the graph \(G_R(P')\). First, we add an edge connecting two vertices \(v_i\) and \(v_j\) if and only if \(S_j\) is the smallest part in \(P'\) such that \(S_i \subset S_j\). Then, we add an edge connecting a vertex \(v \in {\mathcal {S}}\) with a vertex \(v_i\) if and only if \(S_i\) is the smallest part in \(P'\) containing v. We say that \(G_R(P')\) is the cycletree associated with \(P'\); see Fig. 6c for an example.
The definition of bubble merge of two admissible nonflat partition is identical to the corresponding definition in the flat setting where, however, the operator \(\uplus _R\) is used instead of the operator \(\uplus \), and the role played by cyclestars is now assumed by the cycletrees associated with the input admissible nonflat partitions; refer to Fig. 6. Since the cycletree \(G_R(P)\) associated with an admissible nonflat partition on a cyclicallyordered set \(\mathcal S \subseteq V(G)\) can be constructed in \(O(\mathcal{S}^2)\) time and it has size linear in \(\mathcal S\), the bubble merge of two admissible nonflat partitions \(P'\) and \(P''\) of cyclicallyordered sets \({\mathcal {S}}'\) and \({\mathcal {S}}''\), respectively, can be easily computed in quadratic time. We formalize this fact in the following.
Lemma 3.4
The bubble merge of two admissible nonflat partitions \(P'\) and \(P''\) can be computed in \(O\big ((\mathcal{S}' + \mathcal{S}'')^2\big )\) time.
Algorithm
Let \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\) be a 2connected, possibly nonflat, cgraph. Let \((D, \gamma )\) be a bondcarving decomposition of \({{\,\delta\,}}(G)\) of width at most \(\omega \) and let \(\nu \) be a nonroot bag of D. We denote by \(F_\nu \) the set of faces of G that are dual to the vertices of \({{\,\delta\,}}(G)\) that are leaves of the subtree \(D_\nu \) of D rooted at \(\nu \). Also, let \(G_\nu \) be the embedded subgraph of G induced by the edges incident to the faces in \(F_\nu \). Since \((D, \gamma )\) is a bondcarving decomposition of \({{\,\delta\,}}(G)\), there exists a unique face of \(G_\nu \) not in \(F_\nu \), which we denote as \(f^\infty _\nu \). The interface graph \(I_\nu \) of \(\nu \) is the subgraph of \(G_\nu \) induced by the edges that are incident to \(f^\infty _\nu \). The boundary \(B_\nu \) of \(\nu \) is the vertex set of \(I_\nu \). Note that, the edges of \(I_\nu \) are dual to those in \(\gamma (\nu )\). By Lemma 2.1 and by the definition of bondcarving decomposition, we derive the next observation about \(I_\nu \).
Observation 3.1
The interface graph \(I_\nu \) of \(\nu \) is a cycle of length at most \(\omega \).
Since G is 2connected, by Observation 3.1 the vertices in \(B_\nu \) have a natural (clockwise) circular ordering defined by cycle \(I_\nu \). Therefore, from now on, we regard \(B_\nu \) as a cyclicallyordered set.
In the following, for the sake of simplicity, we refer to flat partitions and nonflat partitions simply as partitions, and assume that in the context of nonflat and flat cgraphs such a term refers to the appropriate notion. Similarly, we denote the generalized union of good partitions by \(\uplus \), and assume that in the context of nonflat and flat cgraphs such a term refers to the operation \(\uplus _F\) and \(\uplus _R\), respectively. We will exploit the following useful observation concerning the generalized union.
Observation 3.2
Let \(P'\) and \(P''\) be two good partitions of a set \(V' \subset V(G)\), let \(P^* = P' \uplus P''\), and let S be a part in \(P'\). Then, there exists a part \(S^* \in P^*\) such that \(S \subseteq S^*\) and \(S^*\) is associated with the cluster S is associated with.
Let \(P \in {\mathcal {N}}{\mathcal {C}}(B_\nu )\) be an admissible partition and let \({\mathcal {C}}^{}_{\nu }(G^{}_{\nu },{\mathcal {T}}^{}_{\nu })\) be the cgraph obtained by restricting \({\mathcal {C}}\) to \(G_\nu \). Also, let \({\mathcal {C}}^{\diamond }_{\nu }(G^{\diamond }_{\nu },{\mathcal {T}}^{\diamond }_{\nu })\) be a super cgraph of \({\mathcal {C}}_\nu \) containing no saturating edges in the interior of \(f^\infty _\nu \) and such that \(G^\diamond _\nu \) is planar. We have the following definition.
Definition 3.3
The cgraph \({\mathcal {C}}^\diamond _\nu \) realizes P if (refer to Fig. 7):

(a)
for every two vertices \(u, v \in B_\nu \), we have that if u and v are in the same part \(S_i \in P\), then they are connected in \(G^\diamond _\nu \) by paths of intracluster edges of the cluster \(S_i\) is associated with,

(b)
for every two vertices \(u, v \in B_\nu \) and for every path \(p_{uv}\) connecting u and v in \(G^\diamond _\nu \), consider the lowest common ancestor \(\mu \) of \(V(p_{uv})\) in \(\mathcal{T}^{} \). If \(\mu \) is a nonroot cluster, then there exists a part \(S_i \in P\) such that \(u, v \in S_i\) and the cluster associated with \(S_i\) is either \(\mu \) or a nonleaf successor of \(\mu \),

(c)
for each cluster \(\mu \) in \({\mathcal {T}}\) such that \(V_\mu \cap B_\nu \ne \emptyset \), each vertex of \(\mu \) in \(G_\nu \) is connected to some vertex of \(\mu \) in \(B_\nu \) by paths of intracluster edges of \(\mu \) in \(G^\diamond _\nu \),

(d)
for each cluster \(\mu \) in \({\mathcal {T}}\) such that \(V_\mu \cap B_\nu \ne \emptyset \) and for every vertex \(v \in V(\mu ) \cap B_\nu \), there exists a part in P that contains v which is associated with \(\mu \) or with a nonleaf successor of \(\mu \), and

(e)
for each cluster \(\mu \) in \({\mathcal {T}}\) such that \(V_\mu \cap B_\nu = \emptyset \) and \(V_\mu \cap V(G_\nu ) \ne \emptyset \), all the vertices of \(\mu \) are in \(G_\nu \) and are connected by paths of intracluster edges of \(\mu \) in \(G^\diamond _\nu \).
Conditions a and b of Definition 3.3 imply that each part \(S_i\) of P is in a onetoone correspondence with a connected component of \(G^\diamond _\nu [V_\mu ]\), where \(\mu \) is the cluster \(S_i\) is associated with. Conditions c and e of Definition 3.3 do not depend on partition P. However, they are necessary for the existence of a super cgraph \({\mathcal {C}}^*\) of \(\mathcal{C}^{} \) satisfying Theorem 2.1 whose restriction to \(G_\nu \) coincides with \({\mathcal {C}}^\diamond _\nu \). In fact, Condition c of Definition 3.3 reflects the possibility for the clusters which intersect \(B_\nu \) and that are not yet connected by means of intracluster edges of \({\mathcal {C}}^\diamond _\nu \) to reach connectivity by means of intracluster edges of \({\mathcal {C}}^*\) that lie outside \(I_\nu \). Let \(\mu '\) be a cluster such that \(V_{\mu '} \cap B_\nu \ne \emptyset \). Observe that, by Condition c of Definition 3.3, a connected component of \(G^\diamond _\nu [V_{\mu '}]\) is in onetoone correspondence with a partition of the set \(V_{\mu '} \cap B_\nu \) such that all the vertices belonging to the same connected component of \(G^\diamond _\nu [V_{\mu '}]\) are in the same part. This observation, together with Conditions b and d of Definition 3.3, ensures that each connected component of \(G^\diamond _\nu [V_{\mu '}]\) is represented by a part of P. Moreover, Condition e of Definition 3.3 ensures that cycle \(I_\nu \) does not form a cluster separator, that is, a cycle of G such that the vertices of some cluster \(\mu \) appear both in its interior and in its exterior, but not in it. Thus, partition P “represents” the internalcluster connectivity in \({\mathcal {C}}^\diamond _\nu \) of the clusters whose vertices appear in \(B_\nu \) in a potentially positive instance. Also, P is realizable by \({\mathcal {C}}_\nu \) if there exists a super cgraph \({\mathcal {C}}^{\diamond }_{\nu }(G^{\diamond }_{\nu },{\mathcal {T}}^{\diamond }_{\nu })\) of \({\mathcal {C}}_\nu \) that realizes P containing no saturating edges in the interior of \(f^\infty _\nu \) and such that \(G^\diamond _\nu \) is planar.
We are going to exploit the next lemma, which holds for any bondcarving decomposition.
Lemma 3.5
Let \(\rho '\) and \(\rho ''\) be the two children of the root \(\rho \) of D. Then , \(I_{\rho '} = I_{\rho ''}\).
Proof
Let \({\mathcal {L}}_{\rho '}\) and \({\mathcal {L}}_{\rho ''}\) be the set of leaves of the subtree of D rooted at \(\rho '\) and \(\rho ''\), respectively. Recall that, \(\gamma (\rho ') = E({\mathcal {L}}_{\rho '}, V \setminus {\mathcal {L}}_{\rho '})\) and \(\gamma (\rho '') = E({\mathcal {L}}_{\rho ''}, V \setminus {\mathcal {L}}_{\rho ''})\). Since \({\mathcal {L}}_{\rho '} = V \setminus {\mathcal {L}}_{\rho ''}\) and \({\mathcal {L}}_{\rho ''} = V \setminus {\mathcal {L}}_{\rho '}\), we have \(\gamma (\rho ')=\gamma (\rho '')\). Thus, cycles \(I_{\rho '}\) and \(I_{\rho ''}\) are composed of the edges of G that are dual to the same edges of \({{\,\delta\,}}(G)\).\(\square \)
Lemma 3.5 allows us to derive the following useful characterization.
Theorem 3.1
(Characterization) The 2connected embedded cgraph \({\mathcal {C}}(G, {\mathcal {T}})\) is cplanar if and only if there exist admissible partitions \(P' \in {\mathcal {N}}{\mathcal {C}}(B_{\rho '})\) and \(P'' \in {\mathcal {N}}{\mathcal {C}}(B_{\rho ''})\), where \(\rho '\) and \(\rho ''\) are the two children of the root \(\rho \) of D, such that:

(i)
\(P'\) and \(P''\) are realizable by \({\mathcal {C}}^{}_{\rho '}(G^{}_{\rho '},{\mathcal {T}}^{}_{\rho '})\) and by \({\mathcal {C}}^{}_{\rho ''}(G^{}_{\rho ''},{\mathcal {T}}^{}_{\rho ''})\), respectively, and

(ii)
for each cluster \(\mu \) in \({\mathcal {T}}\) such that \(V_\mu \cap B_{\rho '} \ne \emptyset \), there exists exactly one part \(S \in P^*\), with \(P^* = P' \uplus P''\), such that \(S = V_\mu \cap B_{\rho '}\) and S is associated with either \(\mu \) or with a nonleaf successor of \(\mu \).
Proof
We first prove the only if part. Let \({\mathcal {C}}^{\diamond }_{}(G^{\diamond }_{},{\mathcal {T}}^{\diamond }_{})\) be a cconnected super cgraph of \({\mathcal {C}}\) with \(G^\diamond \) planar, which exists by Theorem 2.1. Let \({\mathcal {C}}^{\diamond }_{\rho '}(G^{\diamond }_{\rho '},{\mathcal {T}}^{\diamond }_{\rho '})\) and \({\mathcal {C}}^{\diamond }_{\rho ''}(G^{\diamond }_{\rho ''},{\mathcal {T}}^{\diamond }_{\rho ''})\) be the super cgraphs of \({\mathcal {C}}_{\rho '}\) and \({\mathcal {C}}_{\rho ''}\) induced by \({\mathcal {C}}^\diamond \), respectively. We first define two admissible partitions \(P' \in {\mathcal {N}}{\mathcal {C}}(B_{\rho '})\) and \(P'' \in {\mathcal {N}}{\mathcal {C}}(B_{\rho ''})\) as follows. We describe the construction of \(P'\), the construction of \(P''\) being analogous. For each cluster \(\mu \in {\mathcal {T}}_{\rho '}\), consider each connected component H of the cluster \(\mu \) restricted to \(G^\diamond _{\rho '}\). Let \(S = V(H) \cap B_{\rho '}\). If \(S \notin P'\), then we associate S with \(\mu \) and add it to \(P'\). Otherwise, S already belongs to \(P'\); let \(\nu \) be the cluster associated with S. Observe that, \(\nu \) is either a successor or an ancestor of \(\mu \). We associate S with the deepest cluster between \(\nu \) and \(\mu \). Clearly, by construction, the partitions \(P'\) and \(P''\) are realizable by \({\mathcal {C}}^{}_{\rho '}(G^{}_{\rho '},{\mathcal {T}}^{}_{\rho '})\) and \({\mathcal {C}}^{}_{\rho ''}(G^{}_{\rho ''},{\mathcal {T}}^{}_{\rho ''})\), respectively. Observe that, by the above construction, for each cluster \(\mu \) in \({\mathcal {T}}\) such that \(V_\mu \cap B_{\rho '} \ne \emptyset \), each vertex in \(V_\mu \cap B_{\rho '}\) belongs to at least one part in \(P'\) (and to at least one part in \(P''\)) that is associated with either \(\mu \) or with a nonleaf successor of \(\mu \). Let \(\mu \) be a cluster such that \(V_\mu \cap B_{\rho '} \ne \emptyset \). Since \({\mathcal {C}}^{\diamond }_{}(G^{\diamond }_{},{\mathcal {T}}^{\diamond }_{})\) is a cconnected cgraph, the cluster \(\mu \) induces a single connected component. Therefore, by the definition of generalized union, all the parts in \(P'\) and in \(P''\) whose vertices belong to \(V_\mu \) contribute to generating a part \(S \in P^*\), with \(P^* = P' \uplus P''\), such that \(S = V_\mu \cap B_{\rho '}\). In particular, by Condition a of Definition 3.1, S is associated with either \(\mu \) or with a nonleaf successor of \(\mu \).
We now prove the if part. By Lemma 3.5, it holds \(G = G_{\rho '} \cup G_{\rho ''}\) and \(I_{\rho '}=I_{\rho ''} = G_{\rho '} \cap G_{\rho ''}\). Let \({\mathcal {C}}^\diamond _{\rho '}\) be a super cgraph of \({\mathcal {C}}_{\rho '}\) realizing \(P'\) and let \({\mathcal {C}}^\diamond _{\rho ''}\) be a super cgraph of \({\mathcal {C}}_{\rho ''}\) realizing \(P''\); these cgraphs exist since Condition i holds. Let \({\mathcal {C}}^\diamond \) be the super cgraph of \({\mathcal {C}}\) obtained by augmenting \({\mathcal {C}}\) with the saturating edges of both \({\mathcal {C}}^\diamond _{\rho '}\) and \({\mathcal {C}}^\diamond _{\rho ''}\). We have that \(G^\diamond \) is planar since both \(G^\diamond _{\rho '}\) and \(G^\diamond _{\rho ''}\) are planar, since \(G^\diamond _{\rho '}\) and \(G^\diamond _{\rho ''}\) share the common interface \(I_{\rho '}=I_{\rho ''}\), by Lemma 3.5, and since there are no saturating edges of \({\mathcal {C}}^\diamond _{\rho '}\) (resp. \({\mathcal {C}}^\diamond _{\rho ''}\)) that lie in the interior of \(f^\infty _{\rho '}\) (resp. \(f^\infty _{\rho ''}\)).
We show that every cluster \(\mu \) is connected in \({\mathcal {C}}^\diamond \), provided that Condition ii holds. This proves that \({\mathcal {C}}^\diamond \) is a cconnected super cgraph of \({\mathcal {C}}\), thus by Condition iii of Theorem 2.1, cgraph \(\mathcal C\) is cplanar. We let \(B = B_{\rho '} = B_{\rho ''}\) and distinguish two cases, based on whether some vertices of \(\mu \) appear along cycle \(I_{\rho '}=I_{\rho ''}\) or not.
Consider first a cluster \(\mu \) containing vertices in B. By Condition c of Definition 3.3, we have that every vertex in \(\mu \) either belongs to B or it is connected by paths of intracluster edges of \(\mu \) in either \({\mathcal {C}}^\diamond _{\rho '}\) or \({\mathcal {C}}^\diamond _{\rho ''}\) to a vertex in B. Since, by Condition ii of the statement, there exists only one part \(S_\mu \in P^*\) such that \(S_\mu = V_\mu \cap B_{\rho '}\), we have that the different parts of \(P'\) and of \(P''\) containing vertices of \(\mu \) are joined together by the vertices of \(\mu \) in B. Therefore, the cluster \(\mu \) is connected in \({\mathcal {C}}^\diamond \). Finally, consider a cluster \(\mu \) such that no vertex of \(\mu \) belongs to B. Then, all the vertices of cluster \(\mu \) only belong to either \({\mathcal {C}}_{\rho '}\) or \({\mathcal {C}}_{\rho ''}\), by Condition e of Definition 3.3. Suppose that \(\mu \) only belongs to \({\mathcal {C}}_{\rho '}\), the case when \(\mu \) only belongs to \({\mathcal {C}}_{\rho ''}\) is analogous. Since \({\mathcal {C}}^\diamond _{\rho '}\) realizes \(P'\), by Condition e of Definition 3.3, all the vertices of \(\mu \) in \(G_\rho '\) are connected by paths of intracluster edges of \(\mu \). Thus, cluster \(\mu \) is connected in \({\mathcal {C}}^\diamond \), since it is connected in \({\mathcal {C}}^\diamond _{\rho '}\). This concludes the proof.\(\square \)
Theorem 3.1 implies that the algorithmic core of our problem lies in the computation of the set \({A}_\nu \) of all admissible partitions of \(B_\nu \) that are realizable by \({\mathcal {C}}_\nu \), for every nonroot bag \(\nu \) of D. Observe that the size of \({A}_\nu \) depends on both the size of \(B_\nu \) and the height h of \(\mathcal{T}^{} \) as any part in a partition can be associated with at most \(h2\) clusters, namely the nonroot clusters in the path between the lowest common ancestor of the vertices in the part and the root of \(\mathcal T\). Therefore, we can upper bound \({A}_\nu \) in the flat and in the nonflat case by \({\mathcal {N}}{\mathcal {C}}(B_\nu )\) and by \(h^{2B_\nu 1} \cdot {{\mathcal {R}}{\mathcal {N}}{\mathcal {C}}(B_\nu )}\), respectively.
We now present our main algorithmic tool.
Algorithm 1. Let \((D,\gamma )\) be a bondcarving decomposition of \({{\,\delta\,}}(G)\) of width \(\omega \). We process the bags of D bottomup and compute the following relevant information, for each nonroot bag \(\nu \) of D: (1) the set \(A_\nu \), and (2) for each admissible partition \(P \in A_\nu \), for each part \(S_i \in P\), and for each cluster \(\mu \) that is either the cluster associated with \(S_i\) or a nonroot ancestor of such cluster, the number \(count(S_i, \mu )\) of vertices of cluster \(\mu \) belonging to \(G_\nu \) which are either in \(S_i\) or are connected to some vertex of \(S_i\) by paths of intracluster edges of \(\mu \) in \({\mathcal {C}}^\diamond _\nu \). Since there may exist parts \(S_1, S_2 \in P\) such that \(S_1 \supset S_2\), for any cluster \(\mu \) which is either the cluster associated with \(S_1\) or a nonroot ancestor of such cluster, we have that the vertices of cluster \(\mu \) belonging to \(G_\nu \) which are either in \(S_2\) or are connected to some vertex of \(S_2\) by paths of intracluster edges of \(\mu \) in \({\mathcal {C}}^\diamond _\nu \) are also counted in \(count(S_1,\mu )\). In that case, to avoid double counting of these vertices of \(\mu \), the value of \(count(S_2, \mu )\) is set to \(\texttt {NULL}\).

If \(\nu \) is a leaf bag of D, then \(G_\nu =I_\nu \) consists of the vertices and edges of a single face of G. Further, by Observation 3.1, graph \(G_\nu \) is a cycle of length at most \(\omega \). In this case, \(A_\nu \) simply coincides with the set of all the admissible partitions of \(B_\nu \) for which each part is associated with its lowest common ancestor. In fact, since \(G_\nu \) is a simple cycle \(I_\nu \), for any admissible partition P of \(B_\nu \) we can construct a super cgraph \({\mathcal {C}}^{\diamond }_{\nu }(G^{\diamond }_{\nu },{\mathcal {T}}^{\diamond }_{\nu })\) of \({\mathcal {C}}_\nu \) that realizes P containing no saturating edges in the interior of \(f^\infty _\nu \) and such that \(G^\diamond _\nu \) is planar as follows: Let \(G_R(P)\) (resp. G(P)) be the cycletree (resp. cyclestar) associated with the partition P if \(\mathcal{C}^{} \) is nonflat (resp. flat). Since the proof is identical in both the cases, in the following we denote both \(G_R(P)\) and G(P) by \(G_P\). Recall that each vertex \(u \in V(G_P) \setminus B_\nu \) corresponds to a part \(S_u\) in P and that such a part is associated with the cluster \(\mu _u\). Consider an edge \((u,v) \in E(G_P)\) such that \(v \in B_\nu \), \(u \in V(G_P) \setminus B_\nu \), and such that there exists no other vertex \(w \in V(G_P) \setminus B_\nu \) for which \(\mu _w\) is a descendant of \(\mu _u\) in \(\mathcal{T}^{} \). Contracting the edge (u, v) to v results in a plane graph such that \(G_P[S_u]\) is connected. We repeatedly identify such an edge and contract it to its endpoint in \(B_\nu \). Observe that, at the end of above recursive procedure, we get that \(V(G_P) = B_\nu \), that \(G_P\) is a super graph of \(I_\nu \), and that, for every part \(S \in P\), the graph \(G_P[S]\) is connected. By considering \(G^\diamond _\nu = G_P\) and \({\mathcal {T}}^\diamond _\nu = {\mathcal {T}}_\nu \), we obtain the desired super cgraph \({\mathcal {C}}^\diamond _\nu \) of \({\mathcal {C}}_\nu \) that realizes P. Therefore, we can construct \(A_\nu \) by enumerating all the possible noncrossing partitions of \(B_\nu \) and by testing whether each such partition is good in \(O(\omega )\) time. Note that, the total number of noncrossing partition of \(B_\nu \) is at most \({\mathcal {C}}{\mathcal {A}}{\mathcal {T}}(\omega ) \le 2^{2\omega }\) when \(\mathcal{C}^{} \) is flat, and it is at most \({\mathcal {C}}{\mathcal {A}}{\mathcal {T}}(2\omega 1) \le 2^{4\omega 2}\) when \(\mathcal{C}^{} \) is nonflat. Further, for each \(P \in A_\nu \), we can compute all counters \(count(S_i, \mu )\) for every \(S_i \in P\) and for every cluster \(\mu \) that is either the cluster associated with \(S_i\) or a nonroot ancestor of such cluster, in total \(O(\omega + h)\) time, by visiting \(G_P\).

If \(\nu \) is a nonleaf nonroot bag of D, we have already computed the relevant information for the two children \(\nu '\) and \(\nu ''\) of \(\nu \). In the following way, we either detect that \({\mathcal {C}}\) does not satisfy Condition iii of Theorem 2.1 or construct the relevant information for \(\nu \):

(1)
Initialize \(A_\nu = \emptyset \);

(2)
For every pair of realizable admissible partitions \(P' \in A_{\nu '}\) and \(P'' \in A_{\nu ''}\), perform the following operations:

(2a)
Compute \(P^* = P' \uplus P''\) and compute the counters \(count(S_i, \mu )\) (as described in the proof of Lemma 3.6), for each \(S_i \in P^*\) and for each cluster \(\mu \) that is either the cluster associated with \(S_i\) or a nonroot ancestor of such cluster, from the counters of the parts in \(P' \cup P''\) whose union is \(S_i\).

(2b)
If there exists some \(S_i \in P^*\) such that \(S_i \cap B_\nu = \emptyset \) and some cluster \(\mu \) that is either the cluster associated with \(S_i\) or a nonroot ancestor of such cluster for which \(count(S_i, \mu ) \ne \texttt {NULL}\) and \(count(S_i, \mu )\) is smaller than the number of vertices in \(\mu \), then reject the instance.

(2c)
Compute and add P to \(A_\nu \).

(2a)

(3)
Remove duplicates from \(A_\nu \), if any.

(1)
Remark 3.2
Algorithm 1 rejects the instance at step (2b), if \(I_\nu \) forms a cluster separator. This property is independent of the specific generalized union \(P^*\) considered at this step and implies that no \(P^*\) (and, thus, no P at step (2c)) can satisfy Condition e of Definition 3.3.
The next lemma is concerned with the correctness and the time complexity of Algorithm 1.
Lemma 3.6
For each nonroot bag \(\nu \) of D, Algorithm 1 computes the relevant information for \(\nu \) in \(O(2^{4 \omega + \log \omega })\) time if \(\mathcal{C}^{} \) is flat and in \(O(4^{4 \omega + \log \omega }n)\) time if \(\mathcal{C}^{} \) is nonflat, given the relevant information for its children.
Proof
Let \(\nu '\) and \(\nu ''\) be the two children of \(\nu \) in D. We will first show the correctness of the algorithm and then argue about the running time.
Let \(A_\nu \) be the set of all the admissible partitions of \(B_\nu \) that are realizable by \({\mathcal {C}}_\nu \) and let \(A^*_\nu \) be the set of all the admissible partitions of \(B_\nu \) computed by Algorithm 1. We show \(A^*_\nu \) = \(A_\nu \).
We first prove \(A_\nu \subseteq A^*_\nu \). Let \(P_\nu \) be a realizable admissible partition in \(A_\nu \). Since \(P_\nu \) is realizable by \({\mathcal {C}}_\nu \), there exists a super cgraph \({\mathcal {C}}^{*}_{\nu }(G^{*}_{\nu },{\mathcal {T}}^{*}_{\nu })\) of \({\mathcal {C}}_\nu \) that realizes \(P_\nu \) containing no saturating edges in the interior of \(f^\infty _\nu \) and such that \(G^*_\nu \) is planar. Let \({\mathcal {C}}^{*}_{\nu '}(G^{*}_{\nu '},{\mathcal {T}}^{*}_{\nu '})\) (resp. \({\mathcal {C}}^{*}_{\nu ''}(G^{*}_{\nu ''},{\mathcal {T}}^{*}_{\nu ''})\)) be the super cgraph of \({\mathcal {C}}^{}_{\nu '}(G^{}_{\nu '},{\mathcal {T}}^{}_{\nu '})\) (resp. of \({\mathcal {C}}^{}_{\nu ''}(G^{}_{\nu ''},{\mathcal {T}}^{}_{\nu ''})\)) obtained by adding to \({{\mathcal {C}}}_{\nu '}\) (resp. to \({{\mathcal {C}}}_{\nu ''}\)) all the saturating edges in \(G^*_\nu \) laying in the interior of the faces of \(G_{\nu '}\) (resp. of \(G_{\nu ''}\)) that are also faces of \(G_\nu \). Clearly, cgraph \({\mathcal {C}}^{*}_{\nu '}(G^{*}_{\nu '},{\mathcal {T}}^{*}_{\nu '})\) (resp. cgraph \({\mathcal {C}}^{*}_{\nu ''}(G^{*}_{\nu ''},{\mathcal {T}}^{*}_{\nu ''})\)) contains no saturating edges in the interior of \(f^\infty _{\nu '}\) (resp. in the interior of \(f^\infty _{\nu ''}\)), since such a face does not belong to \(G_\nu \). We first define two admissible partitions \(P' \in {\mathcal {N}}{\mathcal {C}}(B_{\nu '})\) and \(P'' \in {\mathcal {N}}{\mathcal {C}}(B_{\nu ''})\) as follows. We describe the construction of \(P'\), the construction of \(P''\) being analogous. For each cluster \(\mu \in {\mathcal {T}}_{\nu '}\), consider each connected component H of the cluster \(\mu \) restricted to \(G^*_{\nu '}\). Let \(S = V(H) \cap B_{\nu '}\). If \(S \notin P'\), then we associate S with \(\mu \) and add it to \(P'\). Otherwise, S already belongs to \(P'\); let \(\alpha \) be the cluster associated with S. Observe that, \(\alpha \) is either a successor or an ancestor of \(\mu \). We associate S with the deepest cluster between \(\alpha \) and \(\mu \). Clearly, by construction, the partitions \(P'\) and \(P''\) are realizable by \({\mathcal {C}}^{}_{\nu '}(G^{}_{\nu '},{\mathcal {T}}^{}_{\nu '})\) and \({\mathcal {C}}^{}_{\nu ''}(G^{}_{\nu ''},{\mathcal {T}}^{}_{\nu ''})\), respectively. By hypothesis, we have \(P' \in A_{\nu '}\) and \(P'' \in A_{\nu ''}\). We show that when step (2) of Algorithm 1 considers partitions \(P'\) and \(P''\), it successfully adds \(P_\nu \) to the set \(A^*_\nu \). By the construction of \({\mathcal {C}}^*_{\nu '}\) and \({\mathcal {C}}^*_{\nu ''}\) and the subsequent definitions of \(P'\) and of \(P''\), we have that . Therefore, we only need to show that when the algorithm considers the pair \((P',P'')\), it does not reject the instance at step (2b), and thus \(P_\nu \) is added to \(A^*_\nu \) at step (2c). Let \(P^* = P' \uplus P''\), which is constructed at step (2a) of the algorithm. Suppose, for a contradiction, that \(\mathcal C\) is rejected at step (2b). Then, there exists a part \(S_i\) of \(P^*\) and a cluster \(\mu \) that is either the cluster associated with \(S_i\) or a nonroot ancestor of such cluster such that \(S_i \cap B_\nu = \emptyset \) and \(count(S_i, \mu )\) is smaller than the number of vertices in the cluster \(\mu \). Therefore, the cluster \(\mu \) contains vertices that belong to \(G \setminus G_\nu \), which implies that \(P_\nu \) cannot satisfy Condition e of Definition 3.3, a contradiction. This concludes the proof of this direction.
We now prove \(A^*_\nu \subseteq A_\nu \). Let P be a partition in \(A^*_\nu \) obtained from the partitions \(P' \in A_{\nu '}\) and \(P'' \in A_{\nu ''}\) (selected at step (2) of the algorithm). Next, we show that P is realizable by \({\mathcal {C}}_\nu \). This implies that \(A^*_\nu \subseteq A_\nu \).
By the definition of realizable partition, there exists a super cgraph \({\mathcal {C}}^{*}_{\nu '}(G^{*}_{\nu '},{\mathcal {T}}^{*}_{\nu '})\) (resp. \({\mathcal {C}}^{*}_{\nu ''}(G^{*}_{\nu ''},{\mathcal {T}}^{*}_{\nu ''})\)) of \({\mathcal {C}}^{}_{\nu '}(G^{}_{\nu '},{\mathcal {T}}^{}_{\nu '})\) (resp. of \({\mathcal {C}}^{}_{\nu ''}(G^{}_{\nu ''},{\mathcal {T}}^{}_{\nu ''})\)) that realizes \(P'\) (resp. \(P''\)) containing no saturating edges in the interior of \(f^\infty _{\nu '}\) (resp. of \(f^\infty _{\nu ''}\)) and such that \(G^*_{\nu '}\) (resp. \(G^*_{\nu ''}\)) is planar. Let \({\mathcal {C}}^{*}_{\nu }(G^{*}_{\nu },{\mathcal {T}}^{*}_{\nu })\) be the super cgraph of \({\mathcal {C}}^{}_{\nu }(G^{}_{\nu },{\mathcal {T}}^{}_{\nu })\) constructed by adding to \({\mathcal {C}}_{\nu }\) the saturating edges in \({\mathcal {C}}^*_{\nu '}\) and \({\mathcal {C}}^*_{\nu ''}\). We show that the cgraph \({\mathcal {C}}^{*}_{\nu }(G^{*}_{\nu },{\mathcal {T}}^{*}_{\nu })\) realizes P, contains no saturating edges in the interior of \(f^\infty _\nu \), and \(G^*_\nu \) is planar.
First, we have that \(G^*_\nu \) is planar, since \(G^*_{\nu '}\) and \(G^*_{\nu ''}\) are planar and do not contain saturating edges in the interior of \(f^\infty _{\nu '}\) and of \(f^\infty _{\nu ''}\), respectively. By the previous arguments, we also have that \(f^\infty _{\nu }\) contains no saturating edges.
We show that Condition a of Definition 3.3 holds. Recall that . We prove that all the vertices in the same part S of P are connected in \(\mathcal{C}^*_\nu \) by means of intracluster edges of the cluster S is associated with. Let \(S_i\) be a part of P that also belongs to \(P'\) or to \(P''\). Then, since \(\mathcal{C}^*_{\nu '}\) and \(\mathcal{C}^*_{\nu ''}\) realize \(P'\) and \(P''\), respectively, the vertices of \(S_i\) are connected in \(C^*_\nu \) by paths of intracluster edges of the cluster \(S_i\) is associated with, as they are connected by paths of intracluster edges of the cluster \(S_i\) is associated with, in either \(\mathcal{C}^*_{\nu '}\) or \(\mathcal{C}^*_{\nu ''}\), by Condition a of Definition 3.3. Otherwise, let \(S_i\) be a part of P that does not belong to either \(P'\) or \(P''\). Then, by Definition 3.2, the part \(S_i\) is obtained by intersecting \(B_\nu \) and a part \(S^*_i\) of the generalized union \(P^* = P' \uplus P''\). Thus, by Condition b of Definition 3.1, \(S_i\) and \(S^*_i\) are associated with the same cluster \(\mu \). Also, the vertices in each of the parts of \(P'\) and of \(P''\) contributing to the creation of \(S^*_i\) are connected by paths of intracluster edges of \(\mu \) in \(\mathcal{C}^*_{\nu '}\) and \(\mathcal{C}^*_{\nu ''}\), respectively, by Remark 3.1 and by Condition a of Definition 3.3. Therefore, we have that the connectivity of such sets implies the connectivity of the elements of \(S_i\) by paths of intracluster edges of \(\mu \) that connect at their shared vertices in \(B_{\nu '} \cap B_{\nu ''}\).
Next, we show that Condition b of Definition 3.3 holds. We prove that for any two vertices u and v of \(B_\nu \), if they are connected by a path L in \(G^*_\nu \) for which the lowest common ancestor of V(L) in \(\mathcal{T}^{} \) is a nonroot cluster \(\mu '\), then they belong to a part of \(P^* = P' \uplus P''\) associated with a cluster \(\mu ''\), which is either \(\mu '\) or a nonleaf successor of \(\mu '\) in \(\mathcal{T}^{} \). By Definition 3.2 and by Condition b of Definition 3.1, this in turn implies that u and v belong to a part of P associated with \(\mu ''\). Let \(L_1, L_2, \cdots , L_k\) be the maximal subpaths of L composed of intracluster edges belonging to either \(\mathcal{C}^*_{\nu '}\) or \(\mathcal{C}^*_{\nu ''}\) such that \(L_i\) and \(L_{i+1}\) share an endpoint, for \(i \in \{1, \dots , k1\}\). Note that, the endpoints of each path \(L_i\) both belong to \(B_{\nu '}\) or \(B_{\nu ''}\). Therefore, by Condition a of Definition 3.3, the endpoints of \(L_i\) belong to a part \(S_i\) of \(P'\) or \(P''\), and the cluster associated with \(S_i\) is either \(\mu '\) or a successor of \(\mu '\). As \(L_i\) and \(L_{i+1}\) share an endpoint, by the definition of generalized union, we have that \(P^*\) contains a part \(S^* \supseteq S_1 \cup S_2 \cdots \cup S_k\). Since \(u \in S_1\) and \(v \in S_k\), \(S^*\) contains both u and v. Moreover, by Condition a of Definition 3.1 and by Observation 3.2, the cluster associated with \(S^*\) is either \(\mu '\) or a nonleaf successor of \(\mu '\) in \(\mathcal{T}^{} \).
We now show that Condition c of Definition 3.3 holds. Suppose, for a contradiction, that there exists some cluster \(\mu \) whose vertices appear in \(B_\nu \) such that there is at least one vertex x of \(\mu \) in \(G_\nu \) that is not connected by a path of intracluster edges of \(\mu \) to some vertex of \(\mu \) in \(B_\nu \). Since \(P'\) and \(P''\) are realizable by \(\mathcal{C}_{\nu '}\) and by \(\mathcal{C}_{\nu ''}\), by Condition c of Definition 3.3, there exists a vertex \(t \in B_{\nu '} \cup B_{\nu ''}\) of \(\mu \) such that either \(t = x\) or x is connected to t by means of intracluster edges of \(\mu \). If \(t \in B_\nu \), we get a contradiction. Otherwise, consider the part \(S_i \in P^*\) which contains t such that the cluster \(\mu '\) associated with \(S_i\) is either \(\mu \) or a nonleaf successor of \(\mu \). Note that, such a part exists by Condition d of Definition 3.3. We have that \(S_i \cap B_\nu = \emptyset \) as otherwise there would exist a path of intracluster edges of \(\mu \) connecting x to a vertex in \(B_\nu \). Therefore, \(count(S_i, \mu )\) is smaller than the number of vertices of \(\mu \) since \(V_{\mu } \cap B_\nu \ne \emptyset \). Thus, step (2b) would reject the instance, and P would not be added to \(A^*_\nu \), a contradiction.
We now show that Condition d of Definition 3.3 holds. Let \(\mu \) be a cluster in \(\mathcal{T}^{} \) such that \(V_\mu \cap B_\nu \ne \emptyset \). As \(B_\nu \subseteq B_{\nu '} \cup B_{\nu ''}\), every vertex \(v \in V_\mu \cap B_\nu \) belongs to \(B_{\nu '} \cap B_\nu \) or \(B_{\nu ''} \cap B_\nu \). Since \(P'\) and \(P''\) are realizable by \(\mathcal{C}_{\nu '}\) and \(\mathcal{C}_{\nu ''}\), respectively, by Condition d of Definition 3.3, there exists a part S in \(P'\) or \(P''\) such that \(v \in S\) and the cluster associated with S is either \(\mu \) or a nonleaf successor of \(\mu \). By Obsecrvation 3.2 and Condition d of Definition 3.1, we have a part in P containing v and it is associated with either \(\mu \) or a nonleaf successor of \(\mu \).
Finally, we show that Condition e of Definition 3.3 holds. Suppose, for a contradiction, that there exists some cluster \(\mu \) whose vertices only belong to \(V(G_\nu ) \setminus B_\nu \) and that there exist two vertices u and v of \(\mu \) in \(G_\nu \) that are not connected by a path of intracluster edges of \(\mu \) in \(G^*_\nu \). First consider the case that \(V_\mu \cap (B_{\nu '} \cup B_{\nu ''} = \emptyset )\). Then, since \(P'\) and \(P''\) are realizable by \(\mathcal{C}_{\nu '}\) and \(\mathcal{C}_{\nu ''}\), by Condition e of Definition 3.3, we have that all the vertices of \(\mu \) are either in \(G_{\nu '}\) and are connected by paths of intracluster edges of \(\mu \) in \(G^*_{\nu '}\) or all the vertices of \(\mu \) are either in \(G_{\nu ''}\) and are connected by paths of intracluster edges of \(\mu \) in \(G^*_{\nu ''}\), a contradiction. Otherwise, by Condition c of Definition 3.3 there exists a vertex \(t \in B_{\nu '} \cup B_{\nu ''}\) of \(\mu \) such that either \(t= u\) or u is connected to t by means of intracluster edges of \(\mu \) in either \(\mathcal{C}_{\nu '}\) or \(\mathcal{C}_{\nu ''}\). If \(t \in B_\nu \), we get a contradiction. Otherwise, consider the part \(S_i \in P^*\) that contains t. By Condition d of Definition 3.3, the cluster \(\mu '\) associated with \(S_i\) is either \(\mu \) or a nonleaf successor of \(\mu \). We have that \(S_i \cap B_\nu = \emptyset \) as \(V_\mu \cap B_\nu = \emptyset \). Therefore, \(count(S_i, \mu )\) is smaller than the number of vertices of \(\mu \), as \(v \notin S_i\). Thus, step (2b) would reject the instance, and P would not be added to \(A^*_\nu \), a contradiction.
We conclude by analyzing the running time.
First, we show that Step (2a) can be performed in \(O(B_{\nu '} + B_{\nu ''})\) time if \(\mathcal{C}^{} \) is flat, and in \(O((B_{\nu '} + B_{\nu ''})^2 \cdot h)\) time if \(\mathcal{C}^{} \) is nonflat. Since the generalized union \(P^*\) can be computed in \(O(B_{\nu '} + B_{\nu ''})\) time, by Lemma 3.1 in the flat case, and in \(O((B_{\nu '} + B_{\nu ''})^2)\) time, by Lemma 3.3 in the nonflat case, we only need to show that whenever a new part \(S \in P^*\) stems from the union of two parts \(S_1\) and \(S_2\), we can compute the counters for S in O(h) time. Clearly, the part S can be labeled with the two parts \(S_1\) and \(S_2\) generating it in the course of the generalized union operation. Let \(\mu _1\) and \(\mu _2\) be the clusters associated with \(S_1\) and \(S_2\), respectively. By definition of generalized union, we have that \(S_1 \cap S_2 > 0\) and either \(\mu _1 = \mu _2\) or one of \(\mu _1\) and \(\mu _2\), say \(\mu _1\), is an ancestor of the other. The counters associated with S are computed as follows. We first consider the case that \(\mu _1 = \mu _2\). In this case, we set \(count(S, \alpha ) = count(S_1, \alpha ) + count(S_2, \alpha )  k_\alpha \), where \(k_\alpha = (S_1 \cap S_2) \cap V_\alpha \), for every cluster \(\alpha \) that is either \(\mu _1\) or a nonroot ancestor of \(\mu _1\). We now consider the case that \(\mu _1\) is an ancestor of \(\mu _2\). Similarly to the previous case, we set \(count(S, \alpha ) = count(S_1, \alpha ) + count(S_2, \alpha )  k_\alpha \), for every cluster \(\alpha \) that is either \(\mu _1\) or a nonroot ancestor of \(\mu _1\). Recall that, in this case, we replace \(S_1\) with S, but \(S_2\) stays in \(P^*\) after the union of \(S_1\) and \(S_2\). Therefore, since the connectivity of the vertices of a cluster \(\alpha \), which is either \(\mu _1\) or an ancestor of \(\mu _1\), through the vertices in \(S_2\) by means of intracluster edges of \(\alpha \) is now reached through the vertices in S, we update \(count(S_2, \alpha ) = \texttt {NULL}\) to avoid double counting. Since, there can be at most \(h2\) counters associated with any part, we obtain the claimed running time.
Step (2b) can be performed in \(O(B_{\nu '} + B_{\nu ''})\) time if \(\mathcal{C}^{} \) is flat, and in \(O((B_{\nu '} + B_{\nu ''}) \cdot h)\) time if \(\mathcal{C}^{} \) is nonflat. This is due to the fact that the number of parts in \(P^*\) is \(O(B_{\nu '} + B_{\nu ''})\), and that for each part which has an empty intersection with \(B_\nu \), we need to check all its at most \(h2\) counters, if \(\mathcal{C}^{} \) is nonflat.
Step (2c) can be performed in \(O(B_{\nu '} + B_{\nu ''})\) time if \(\mathcal{C}^{} \) is flat, and in \(O((B_{\nu '} + B_{\nu ''})^2)\) time if \(\mathcal{C}^{} \) is nonflat as the bubble merge P can be computed in \(O(B_{\nu '} + B_{\nu ''})\) time, by Lemma 3.2 in the flat case, and in \(O((B_{\nu '} + B_{\nu ''})^2)\) time, by Lemma 3.4 in the nonflat case.
Step (3) can be performed in \(O\big (B_\nu  \cdot {\mathcal {N}}{\mathcal {C}}(B'_\nu ) \cdot {\mathcal {N}}{\mathcal {C}}(B''_\nu )\big )\) time if \(\mathcal{C}^{} \) is flat, and in \(O\big (B_\nu  h^{2B'_\nu  + 2B'_\nu 2}\cdot {\mathcal {R}}{\mathcal {N}}{\mathcal {C}}(B'_\nu ) \cdot {\mathcal {R}}{\mathcal {N}}{\mathcal {C}}(B''_\nu )\big )\) time if \(\mathcal{C}^{} \) is nonflat. In fact, the set \(A_\nu \) computed at step (2) has size in \(O(A'_\nu  \cdot A''_\nu )\). In turn, \(A'_\nu \) (resp. \(A''_\nu \)) is upper bounded in the flat and in the nonflat case by \({\mathcal {N}}{\mathcal {C}}(B'_\nu )\) (resp. \({\mathcal {N}}{\mathcal {C}}(B''_\nu )\)) and by \(h^{2B'_\nu 1} \cdot {{\mathcal {R}}{\mathcal {N}}{\mathcal {C}}(B'_\nu )}\) (resp. \(h^{2B''_\nu 1} \cdot {\mathcal {R}}{\mathcal {N}}{\mathcal {C}}(B''_\nu )\)), respectively. Therefore, since each partition in \(A_\nu \) can be injectively mapped to a string whose length is in \(O(B_\nu )\), in order to remove duplicates from \(A_\nu \), we can sort the partitions in \(A_\nu \) in \(O(B_\nu  \cdot A_\nu )\) using radix sort, and then scan the obtained sorted list to remove consecutive duplicated partitions. This yields the stated running time for Step 3.
We are now the ready to provide the overall running time of Algorithm 1. The number of pairs of realizable partitions considered at Step (2) is bounded by \({\mathcal {N}}{\mathcal {C}}(B_{\nu '}) \cdot {\mathcal {N}}{\mathcal {C}}(B_{\nu ''})\), which is bounded by \(2^{2(B_{\nu '}+B_{\nu ''})}\) if \(\mathcal{C}^{} \) is flat, and it is bounded by \(h^{2B'_\nu  + 2B'_\nu 2} \cdot {\mathcal {R}}{\mathcal {N}}{\mathcal {C}}(B'_\nu ) \cdot {\mathcal {R}}{\mathcal {N}}{\mathcal {C}}(B''_\nu )\), which is bounded by \(h^{2B'_\nu  + 2B'_\nu 2} \cdot 2^{4(B_{\nu '}+B_{\nu ''})}\) if \(\mathcal{C}^{} \) is nonflat. Moreover, the running time of Step (2) is upper bounded by Step 2a. Since, \(B_{\nu '}\le \omega \) and \(B_{\nu ''}\le \omega \), we therefore have that the overall running time of Step (2) is \(O(\omega \cdot 2^{4\omega }) = O(2^{4\omega + \log \omega })\) time if \(\mathcal{C}^{} \) is flat, and in \(O(\omega ^2 \cdot h \cdot h^{2\omega 2} \cdot 2^{8\omega }) = O(4^{4\omega + \log \omega } h^{2\omega 1})\) time if \(\mathcal{C}^{} \) is nonflat. Observe that, the running time of Step (2) dominates the running time of Step (3). Thus, Algorithm 1 runs in \(O(2^{4\omega + \log \omega })\) time, if \(\mathcal{C}^{} \) is flat, and in \(O(4^{4\omega + \log \omega } h^{2\omega 1})\) if \(\mathcal{C}^{} \) is nonflat. \(\square \)
By Lemma 3.6 and since D contains O(n) bags, we have the following.
Lemma 3.7
Sets \(A_{\rho '}\) and \(A_{\rho ''}\) can be computed in \(O(2^{4\omega + \log \omega }n)\) time, if \(\mathcal{C}^{} \) is flat, and in \(O(4^{4\omega + \log \omega } h^{2\omega 1}n)\) if \(\mathcal{C}^{} \) is nonflat.
We obtain the next theorems by combining Lemma 3.7 and Theorem 3.1, where the additive \(O(n^2)\) factor in the running time derives from the time needed to convert a carving decomposition of \({{\,\delta\,}}(G)\) into a bondcarving decomposition of the same width [70].
Theorem 3.2
CPlanarity Testing can be solved in \(O(2^{4 \omega + \log \omega } n + n^2)\) time for any 2connected nvertex embedded flat cgraph \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\), if a carving decomposition of \({{\,\delta\,}}(G)\) of width \(\omega \) is provided.
Theorem 3.3
CPlanarity Testing can be solved in \(O(4^{4\omega + \log \omega } h^{2\omega 1}n + n^2)\) time for any 2connected nvertex embedded nonflat cgraph \({\mathcal {C}}^{}_{}(G^{}_{},{\mathcal {T}}^{}_{})\), if a carving decomposition of \({{\,\delta\,}}(G)\) of width \(\omega \) is provided.
We are finally ready to prove our main result.
Proof of Theorems 1.1 and 1.2
Let \((D,\gamma )\) be a carving decomposition of \({{\,\delta\,}}(G)\) of optimal width \(\omega = {{\,\mathrm{cw}\,}}({{\,\delta\,}}(G))\). First, we apply Lemma 2.2 to \({\mathcal {C}}\) to obtain, in \(O(n^2)\) time, a 2connected O(n)vertex flat cgraph \({\mathcal {C}}^{\prime }_{}(G^{\prime }_{},{\mathcal {T}}^{\prime }_{})\) equivalent to \({\mathcal {C}}\) and a corresponding carving decomposition \((D',\gamma ')\) of width \(\omega ' \le \max (\omega ,4)\). Then, we apply either Theorem 3.2 or Theorem 3.3 to test whether \({\mathcal {C}}'\) (and thus \({\mathcal {C}}\)) is cplanar depending on whether \(\mathcal{C}^{} \) is flat or nonflat, respectively. The running time follows from the running time of Theorem 3.2 and 3.3, from the fact that \(\omega '= O(\omega )\), \(V(G') \in O(n)\), and that a carving decomposition of \({{\,\delta\,}}(G)\) of optimal width \(\omega \) can be computed in \(O({\hat{g}}(\omega )n)\) time [71], where \({\hat{g}}\) is a computable function. This concludes the proof of the theorems. \(\square \)
GraphWidth Parameters Related to the Dual CarvingWidth
In this section, we discuss implications of our algorithm for instances of bounded embeddedwidth and of bounded dual cutwidth.
Embeddedwidth. A tree decomposition of an embedded graph G respects the embedding of G if, for every face f of G, at least one bag contains all the vertices of f [17]. The embeddedwidth \({{\,\mathrm{emw}\,}}(G)\) of G is the minimum width of any of its tree decompositions that respect the embedding of G. For consistency with other graphwidth parameters, in the original definition of this width measure [17] the vertices of the outer face are not required to be in some bag. Here, we adopt the variant presented in [34], where the tree decomposition must also include a bag containing the outer face. We have the following.
Lemma 4.1
Let G be an embedded graph. Then, \({{\,\mathrm{cw}\,}}({{\,\delta\,}}(G)) \le {{{\,\mathrm{emw}\,}}}^2(G) + 2{{{\,\mathrm{emw}\,}}}(G)\).
Proof
Recall that the dual \({{\,\delta\,}}(G)\) of G has maximum degree \(\ell (G)\) and maximum face size \(\varDelta (G)\), where \(\ell (G)\) and \(\varDelta (G)\) are the maximum face size and the maximum degree of the graph G, respectively. It is wellknown that the treewidth \({{\,\mathrm{tw}\,}}(G)\) of G and the treewidth \({{\,\mathrm{tw}\,}}({{\,\delta\,}}(G))\) of \({{\,\delta\,}}(G)\) satisfy the relation: \({{\,\mathrm{tw}\,}}({{\,\delta\,}}(G)) \le {{\,\mathrm{tw}\,}}(G) + 1\) [18]. Also, for any graph H, the carvingwidth \({{\,\mathrm{cw}\,}}(H)\) of H satisfies the relation: \({{\,\mathrm{cw}\,}}(H) \le \varDelta (H)({{\,\mathrm{tw}\,}}(H)+1)\) [14]. Therefore, we have \({{\,\mathrm{cw}\,}}({{\,\delta\,}}(G)) \le \ell (G)({{\,\mathrm{tw}\,}}(G)+2)\). Finally, the embeddedwidth \({{{\,\mathrm{emw}\,}}}(G)\) of G satisfies the relations: \({{{\,\mathrm{emw}\,}}}(G)\ge \ell (G)\) and \({{{\,\mathrm{emw}\,}}}(G)\ge {{\,\mathrm{tw}\,}}(G)\), by definition [17, 34]. Combining the above inequalities, we get the stated bound for the carvingwidth of \({{\,\delta\,}}(G)\).\(\square \)
Cutwidth. Let \(\pi \) be a linear order of the vertex set of a graph \(G=(V,E)\). By splitting \(\pi \) into two linear orders \(\pi _1\) and \(\pi _2\) such that \(\pi \) is the concatenation of \(\pi _1\) and \(\pi _2\), we define a cut of \(\pi \). The width of this cut is the number of edges between a vertex in \(\pi _1\) and a vertex in \(\pi _2\). The width of \(\pi \) is the maximum width over all its possible cuts. Finally, the cutwidth of G is the minimum width over all the possible linear orders of V. The dual cutwidth is the cutwidth of the dual of G.
The following relationship between cutwidth and carvingwidth has been proved in [68].
Theorem 4.1
(Theorem 4.3, [68]) The carvingwidth of G is at most twice its cutwidth.
By Lemma 4.1 and Theorem 4.1, we have that singleparameter FPT and XP algorithms also exist with respect to the embeddedwidth and to the dual cutwidth of the underlying graph for flat and nonflat cgraphs, respectively.
Conclusions
In this paper, we studied the CPlanarity Testing problem for cgraphs with a prescribed combinatorial embedding. We showed that the problem is polynomialtime solvable when the dual carvingwidth of the underlying graph of the input cgraph is bounded. In particular, we provided a fixedparameter tractable and a slicewise polynomial algorithm for the CPlanarity Testing problem for embedded flat and nonflat cgraphs, respectively. This also addresses a question we posed in [34], regarding the existence of notable graphwidth parameters such that the CPlanarity Testing problem for embedded flat cgraphs is fixedparameter tractable with respect to a single one of them. Namely, we answer this question in the affirmative when the parameters are the embeddedwidth of the underlying graph, and the carvingwidth and cutwidth of its planar dual.
References
Adler, I., BuiXuan, B., Rabinovich, Y., Renault, G., Telle, J.A., Vatshelle, M.: On the booleanwidth of a graph: structure and applications. In: D.M. Thilikos (ed.) WG 2010, LNCS, vol. 6410, pp. 159–170 (2010). https://doi.org/10.1007/9783642169267_16
Akitaya, H.A., Fulek, R., Tóth, C.D.: Recognizing weak embeddings of graphs. In: A. Czumaj (ed.) SODA ’18, pp. 274–292. SIAM (2018). https://doi.org/10.1137/1.9781611975031.20
Angelini, P., Da Lozzo, G.: SEFE = Cplanarity? Comput. J. 59(12), 1831–1838 (2016). https://doi.org/10.1093/comjnl/bxw035
Angelini, P., Da Lozzo, G.: Clustered planarity with pipes. Algorithmica 81(6), 2484–2526 (2019). https://doi.org/10.1007/s0045301800541w
Angelini, P., Da Lozzo, G.: Beyond clustered planar graphs. In: S. Hong, T. Tokuyama (eds.) Beyond Planar Graphs, Communications of NII Shonan Meetings, pp. 211–235. Springer (2020). https://doi.org/10.1007/9789811565335_12
Angelini, P., Da Lozzo, G., Di Battista, G., Frati, F.: Strip planarity testing for embedded planar graphs. Algorithmica 77(4), 1022–1059 (2017). https://doi.org/10.1007/s0045301601289
Angelini, P., Da Lozzo, G., Di Battista, G., Frati, F., Patrignani, M., Roselli, V.: Relaxing the constraints of clustered planarity. Comput. Geom. 48(2), 42–75 (2015). https://doi.org/10.1016/j.comgeo.2014.08.001
Angelini, P., Da Lozzo, G., Di Battista, G., Frati, F., Patrignani, M., Rutter, I.: Intersectionlink representations of graphs. J. Graph Algorithms Appl. 21(4), 731–755 (2017). https://doi.org/10.7155/jgaa.00437
Angelini, P., Da Lozzo, G., Di Battista, G., Frati, F., Roselli, V.: The importance of being proper: (in clusteredlevel planarity and Tlevel planarity). Theor. Comput. Sci. 571, 1–9 (2015). https://doi.org/10.1016/j.tcs.2014.12.019
Angelini, P., Frati, F., Kaufmann, M.: Straightline rectangular drawings of clustered graphs. Discrete Comput. Geom. 45(1), 88–140 (2011). https://doi.org/10.1007/s004540109302z
Athenstädt, J.C., Cornelsen, S.: Planarity of overlapping clusterings including unions of two partitions. J. Graph Algorithms Appl. 21(6), 1057–1089 (2017). https://doi.org/10.7155/jgaa.00450
Athenstädt, J.C., Hartmann, T., Nöllenburg, M.: Simultaneous embeddability of two partitions. In: C.A. Duncan, A. Symvonis (eds.) Graph Drawing—22nd International Symposium, GD 2014, Würzburg, Germany, September 24–26, 2014, Revised Selected Papers, Lecture Notes in Computer Science, vol. 8871, pp. 64–75. Springer (2014). https://doi.org/10.1007/9783662458037_6
Biedl, T.: Drawing planar partitions III: Two Constrained Embedding Problems. Tech. Report RRR 1398, Rutcor Research Report (1998)
Biedl, T.C., Vatshelle, M.: The pointset embeddability problem for plane graphs. Int. J. Comput. Geometry Appl. 23(4–5), 357–396 (2013). https://doi.org/10.1142/S0218195913600091
Bixby, R.E., Wagner, D.K.: An almost lineartime algorithm for graph realization. Math. Oper. Res. 13(1), 99–123 (1988). https://doi.org/10.1287/moor.13.1.99
Bläsius, T., Rutter, I.: A new perspective on clustered planarity as a combinatorial embedding problem. Theor. Comput. Sci. 609, 306–315 (2016). https://doi.org/10.1016/j.tcs.2015.10.011
Borradaile, G., Erickson, J., Le, H., Weber, R.: Embeddedwidth: a variant of treewidth for plane graphs (2017). arXiv:1703.07532
Bouchitté, V., Mazoit, F., Todinca, I.: Treewidth of planar graphs: connections with duality. ENDM 10, 34–38 (2001). https://doi.org/10.1016/S15710653(04)003531
Brandenburg, F., Eppstein, D., Goodrich, M.T., Kobourov, S.G., Liotta, G., Mutzel, P.: Selected open problems in graph drawing. In: G. Liotta (ed.) GD ’03, LNCS, vol. 2912, pp. 515–539. Springer (2003). https://doi.org/10.1007/9783540245957_55
Brandes, U., Cornelsen, S., Pampel, B., Sallaberry, A.: Blocks of hypergraphsapplied to hypergraphs and outerplanarity. In: C.S. Iliopoulos, W.F. Smyth (eds.) Combinatorial Algorithms—21st International Workshop, IWOCA 2010, London, UK, July 26–28, 2010, Revised Selected Papers, Lecture Notes in Computer Science, vol. 6460, pp. 201–211. Springer (2010). https://doi.org/10.1007/9783642192227_21
Brandes, U., Cornelsen, S., Pampel, B., Sallaberry, A.: Pathbased supports for hypergraphs. J. Discrete Algorithms 14, 248–261 (2012). https://doi.org/10.1016/j.jda.2011.12.009
Brandes, U., Lerner, J.: Visual analysis of controversy in usergenerated encyclopedias. In: IEEE VAST ’07, pp. 179–186. IEEE Computer Society (2007). https://doi.org/10.1109/VAST.2007.4389012
Buchin, K., van Kreveld, M.J., Meijer, H., Speckmann, B., Verbeek, K.: On planar supports for hypergraphs. J. Graph Algorithms Appl. 15(4), 533–549 (2011). https://doi.org/10.7155/jgaa.00237
Carmesin, J.: Embedding simply connected 2complexes in 3space—v. A refined kuratowskitype characterisation (2017)
Chimani, M., Di Battista, G., Frati, F., Klein, K.: Advances on testing cplanarity of embedded flat clustered graphs. In: C.A. Duncan, A. Symvonis (eds.) GD ’14, LNCS, vol. 8871, pp. 416–427. Springer (2014). https://doi.org/10.1007/9783662458037_35
Chimani, M., Klein, K.: Shrinking the search space for clustered planarity. In: W. Didimo, M. Patrignani (eds.) GD ’12, LNCS, vol. 7704, pp. 90–101. Springer (2012). https://doi.org/10.1007/9783642367632_9
Cornelsen, S., Wagner, D.: Completely connected clustered graphs. J. Discrete Algorithms 4(2), 313–323 (2006). https://doi.org/10.1016/j.jda.2005.06.002
Cortese, P.F., Di Battista, G.: Clustered planarity. In: J.S.B. Mitchell, G. Rote (eds.) SoCG ’05, pp. 32–34. ACM (2005). https://doi.org/10.1145/1064092.1064093
Cortese, P.F., Di Battista, G., Frati, F., Patrignani, M., Pizzonia, M.: Cplanarity of cconnected clustered graphs. J. Graph Algorithms Appl. 12(2), 225–262 (2008)
Cortese, P.F., Di Battista, G., Patrignani, M., Pizzonia, M.: On embedding a cycle in a plane graph. Discret. Math. 309(7), 1856–1869 (2009). https://doi.org/10.1016/j.disc.2007.12.090
Cortese, P.F., Patrignani, M.: Clustered planarity = flat clustered planarity. In: T.C. Biedl, A. Kerren (eds.) GD 2018, LNCS, vol. 11282, pp. 23–38. Springer (2018). https://doi.org/10.1145/1064092.1064093
Courcelle, B., Engelfriet, J., Rozenberg, G.: Handlerewriting hypergraph grammars. J. Comput. Syst. Sci. 46(2), 218–270 (1993). https://doi.org/10.1007/9783030044145_2
Da Lozzo, G., Di Battista, G., Frati, F., Patrignani, M.: Computing nodetrix representations of clustered graphs. J. Graph Algorithms Appl. 22(2), 139–176 (2018). https://doi.org/10.7155/jgaa.00461
Da Lozzo, G., Eppstein, D., Goodrich, M.T., Gupta, S.: Subexponentialtime and FPT algorithms for embedded flat clustered planarity. In: A. Brandstädt, E. Köhler, K. Meer (eds.) WG 2018, LNCS, vol. 11159, pp. 111–124. Springer (2018). https://doi.org/10.1007/9783030002565_10
Da Lozzo, G., Eppstein, D., Goodrich, M.T., Gupta, S.: Cplanarity testing of embedded clustered graphs with bounded dual carvingwidth. In: B.M.P. Jansen, J.A. Telle (eds.) 14th International Symposium on Parameterized and Exact Computation, IPEC 2019, September 11–13, 2019, Munich, Germany, LIPIcs, vol. 148, pp. 9:1–9:17. Schloss DagstuhlLeibnizZentrum für Informatik (2019). https://doi.org/10.4230/LIPIcs.IPEC.2019.9
Dahlhaus, E.: A linear time algorithm to recognize clustered graphs and its parallelization. In: C.L. Lucchesi, A.V. Moura (eds.) LATIN ’98, LNCS, vol. 1380, pp. 239–248. Springer (1998). https://doi.org/10.1007/BFb0054325
Di Battista, G., Didimo, W.: Gdtoolkit. In: Tamassia, R. (ed.) Handbook on Graph Drawing and Visualization, pp. 571–597. Chapman and Hall/CRC, London (2013)
Di Battista, G., Didimo, W., Marcandalli, A.: Planarization of clustered graphs. In: P. Mutzel, M. Jünger, S. Leipert (eds.) GD ’01, LNCS, vol. 2265, pp. 60–74. Springer (2001). https://doi.org/10.1007/3540458484_5
Di Battista, G., Frati, F.: Efficient cplanarity testing for embedded flat clustered graphs with small faces. J. Graph Algorithms Appl. 13(3), 349–378 (2009)
Didimo, W., Giordano, F., Liotta, G.: Overlapping cluster planarity. J. Graph Algorithms Appl. 12(3), 267–291 (2008)
Feng, Q., Cohen, R.F., Eades, P.: Planarity for clustered graphs. In: P.G. Spirakis (ed.) ESA’95, LNCS, vol. 979, pp. 213–226. Springer (1995). https://doi.org/10.1007/3540603131_145
Forster, M., Bachmaier, C.: Clustered level planarity. In: P. van Emde Boas, J. Pokorný, M. Bieliková, J. Stuller (eds.) SOFSEM ’04, LNCS, vol. 2932, pp. 218–228. Springer (2004). https://doi.org/10.1007/9783540246183_18
Fulek, R., Kyncl, J.: Hananitutte for approximating maps of graphs. In: B. Speckmann, C.D. Tóth (eds.) SoCG ’18, LIPIcs, vol. 99, pp. 39:1–39:15. Schloss Dagstuhl  LeibnizZentrum fuer Informatik (2018). https://doi.org/10.4230/LIPIcs.SoCG.2018.39
Fulek, R., Kyncl, J., Malinovic, I., Pálvölgyi, D.: Efficient cplanarity testing algebraically. CoRR abs/1305.4519 (2013). arXiv:1305.4519
Fulek, R., Kyncl, J., Malinovic, I., Pálvölgyi, D.: Clustered planarity testing revisited. Electr. J. Comb. 22(4), P4.24 (2015)
Fulek, R., Tóth, C.D.: Atomic embeddability, clustered planarity, and thickenability. CoRR abs/1907.13086 (2019). arXiv:1907.13086
Fulek, R., Tóth, C.D.: Atomic embeddability, clustered planarity, and thickenability. In: S. Chawla (ed.) Proceedings of the 2020 ACMSIAM Symposium on Discrete Algorithms, SODA 2020, Salt Lake City, UT, USA, January 5–8, 2020, pp. 2876–2895. SIAM (2020). https://doi.org/10.1137/1.9781611975994.175
Godsil, C.D., Royle, G.F.: Algebraic Graph Theory. Graduate texts in Mathematics. Springer, Berlin (2001). https://doi.org/10.1007/9781461301639
Goodrich, M.T., Lueker, G.S., Sun, J.Z.: Cplanarity of extrovert clustered graphs. In: P. Healy, N.S. Nikolov (eds.) GD ’05, LNCS, vol. 3843, pp. 211–222. Springer (2005). https://doi.org/10.1007/11618058_20
Grimaldi, R.: Fibonacci and Catalan Numbers: An Introduction. Wiley, London (2012)
Gu, Q., Tamaki, H.: Optimal branchdecomposition of planar graphs in O$(n^3)$ time. ACM Trans. Algorithms 4(3), 30:130:13 (2008). https://doi.org/10.1145/1367064.1367070
Gutwenger, C., Jünger, M., Leipert, S., Mutzel, P., Percan, M., Weiskircher, R.: Advances in cplanarity testing of clustered graphs. In: S.G. Kobourov, M.T. Goodrich (eds.) GD ’02, LNCS, vol. 2528, pp. 220–235. Springer (2002). https://doi.org/10.1007/3540361510_21
Gutwenger, C., Mutzel, P., Schaefer, M.: Practical experience with hananitutte for testing cplanarity. In: C.C. McGeoch, U. Meyer (eds.) ALENEX ’14, pp. 86–97. SIAM (2014). https://doi.org/10.1137/1.9781611973198.9
Hong, S., Nagamochi, H.: Convex drawings of hierarchical planar graphs and clustered planar graphs. J. Discrete Algorithms 8(3), 282–295 (2010). https://doi.org/10.1016/j.jda.2009.05.003
Hong, S.H., Nagamochi, H.: Simpler algorithms for testing twopage book embedding of partitioned graphs. Theoretical Computer Science (2016)
Hopcroft, J.E., Tarjan, R.E.: Efficient algorithms for graph manipulation [H] (algorithm 447). Commun. ACM 16(6), 372–378 (1973). https://doi.org/10.1145/362248.362272
Jelínek, V., Jelínková, E., Kratochvíl, J., Lidický, B.: Clustered planarity: embedded clustered graphs with twocomponent clusters. In: I.G. Tollis, M. Patrignani (eds.) GD ’08, LNCS, vol. 5417, pp. 121–132. Springer (2008). https://doi.org/10.1007/9783642002199_13
Jelínková, E., Kára, J., Kratochvíl, J., Pergel, M., Suchý, O., Vyskocil, T.: Clustered planarity: small clusters in cycles and Eulerian graphs. J. Graph Algorithms Appl. 13(3), 379–422 (2009)
Johnson, D.S., Pollak, H.O.: Hypergraph planarity and the complexity of drawing venn diagrams. J. Graph Theory 11(3), 309–325 (1987). https://doi.org/10.1002/jgt.3190110306
Kamada, T., Kawai, S.: A general framework for visualizing abstract objects and relations. ACM Trans. Graph. 10(1), 1–39 (1991). https://doi.org/10.1145/99902.99903
Kaufmann, M., van Kreveld, M.J., Speckmann, B.: Subdivision drawings of hypergraphs. In: I.G. Tollis, M. Patrignani (eds.) Graph Drawing, 16th International Symposium, GD 2008, Heraklion, Crete, Greece, September 21–24, 2008. Revised Papers, Lecture Notes in Computer Science, vol. 5417, pp. 396–407. Springer (2008). https://doi.org/10.1007/9783642002199_39
Nagamochi, H., Kuroya, K.: Drawing cplanar biconnected clustered graphs. Discret. Appl. Math. 155(9), 1155–1174 (2007). https://doi.org/10.1016/j.dam.2006.04.044
Niggemann, O.: Visual data mining of graph based data. Ph.D. thesis, University of Paderborn, Germany (2001). http://ubdata.unipaderborn.de/ediss/17/2001/niggeman/disserta.pdf
Oum, S., Seymour, P.D.: Approximating cliquewidth and branchwidth. J. Comb. Theory Ser. B 96(4), 514–528 (2006). https://doi.org/10.1016/j.jctb.2005.10.006
Paiva, R., Rodrigues, G.N., Bonifácio, R., Ladeira, M.: Exploring the combination of software visualization and data clustering in the software architecture recovery process. In: S. Ossowski (ed.) Proceedings of the 31st Annual ACM Symposium on Applied Computing, Pisa, Italy, April 4–8, 2016, pp. 1309–1314. ACM (2016). https://doi.org/10.1145/2851613.2851765
Robertson, N., Seymour, P.D.: Graph minors. X. Obstructions to treedecomposition. J. Comb. Theory. Ser. B 52(2), 153–190 (1991). https://doi.org/10.1016/00958956(91)90061N
Rué, J., Sau, I., Thilikos, D.M.: Dynamic programming for graphs on surfaces. ACM Trans. Algorithms 10(2), 8:18:26 (2014). https://doi.org/10.1145/2556952
Sasák, R.: Comparing 17 graph parameters. Master’s thesis, Department of Informatics, University of Bergen, Bergen, Norway (2010)
Schaefer, M.: Toward a theory of planarity: hanani–tutte and planarity variants. J. Graph Algorithms Appl. 17(4), 367–440 (2013). https://doi.org/10.7155/jgaa.00298
Seymour, P.D., Thomas, R.: Call routing and the ratcatcher. Combinatorica 14(2), 217–241 (1994). https://doi.org/10.1007/BF01215352
Thilikos, D.M., Serna, M.J., Bodlaender, H.L.: Constructive linear time algorithms for small cutwidth and carvingwidth. In: D.T. Lee, S. Teng (eds.) ISAAC ’00, LNCS, vol. 1969, pp. 192–203. Springer (2000). https://doi.org/10.1007/3540409963_17
van Bevern, R., Kanj, I.A., Komusiewicz, C., Niedermeier, R., Sorge, M.: Twins in subdivision drawings of hypergraphs. In: Y. Hu, M. Nöllenburg (eds.) Graph Drawing and Network Visualization—24th International Symposium, GD 2016, Athens, Greece, September 19–21, 2016, Revised Selected Papers, Lecture Notes in Computer Science, vol. 9801, pp. 67–80. Springer (2016). https://doi.org/10.1007/9783319501062_6
Vial, J.J.B., Da Lozzo, G., Goodrich, M.T.: Computing kmodal embeddings of planar digraphs. In: M.A. Bender, O. Svensson, G. Herman (eds.) ESA 2019, LIPIcs, vol. 144, pp. 17:1–17:16. Schloss Dagstuhl  LeibnizZentrum fuer Informatik (2019). https://doi.org/10.4230/LIPIcs.ESA.2019.17
Funding
Open access funding provided by Università degli Studi Roma Tre within the CRUICARE Agreement.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
A preliminary version of this paper appeared in Proceedings of the 14th International Symposium on Parameterized and Exact Computation (IPEC), Munich, Germany, 2019 [35]. Da Lozzo was supported in part by H2020MSCARISE project 734922“CONNECT” and by MIUR Project “AHeAD” under PRIN 20174LF3T8. Eppstein was supported in part by the US NSF under Grants CCF1618301 and CCF1616248. Goodrich was supported in part by the US NSF under Grant 1815073. Gupta was supported in part by the Zuckerman STEM Leadership Program.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Da Lozzo, G., Eppstein, D., Goodrich, M.T. et al. CPlanarity Testing of Embedded Clustered Graphs with Bounded Dual CarvingWidth. Algorithmica 83, 2471–2502 (2021). https://doi.org/10.1007/s00453021008392
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00453021008392
Keywords
 Clustered planarity
 Carvingwidth
 Noncrossing partitions
 Fixedparameter tractability