Keywords

1 Introduction

The crossing number \(\mathrm {cr}(G)\) of a graph G is the minimum number of pairwise edge crossings in a drawing of G in the plane. We refer to Sect. 2 for the definitions of a drawing and edge crossings. Finding the crossing number of a graph is one of the most prominent combinatorial optimization problems in graph theory and is NP-hard already in very special cases, e.g., even when considering a planar graph with one added edge [5]. Moreover, we know that computing the crossing number is APX-hard [3], i.e., there does not exist a PTAS (unless P=NP).

On the other hand, there is an algorithm [1] that approximates not directly the crossing number, but the quantity \(n+\mathrm {cr}(G)\) where \(n=|V(G)|\); its currently best incarnation does so within a factor of \({{\mathcal O}}(\log ^2 n)\) [11]. The first sublinear approximation factor of \(\tilde{{{\mathcal O}}}(n^{0.9})\) has been achieved by [9]. Concerning rectilinear drawings of dense graphs there is another recent approximation result [12]. Much better crossing number approximation results are known for some restricted graph classes, such as for graphs embeddable in a fixed surface [15, 17] and for graphs from which few edges or vertices can be removed to make them planar [4, 6, 7, 18].

Despite this recent progress in crossing number approximations in special cases, there are nearly no nontrivial formulas or efficient algorithms for computing the exact crossing number in sufficiently “rich” graph classes. Even for very nicely structured classes such as the complete graphs, the complete bipartite graphs and the toroidal grids (Cartesian products of cycles), their exact crossing numbers are only conjectured, but not proved (e.g., we do not know \(\mathrm {cr}(K_{13})\,\)).

One notable exception (to near-impossibility of computing efficiently the exact crossing number) is that the exact crossing number can be efficiently computed (even in linear time) when it is bounded [16, 19]; more precisely, that Crossing Number is in linear-time FPT when parameterized by the solution value. However, considering nontrivially rich graph classes with unbounded crossing number, there currently seems to be only one such further efficient result by Biedl et al. [2]; computing the exact crossing number for maximal graphs of pathwidth exactly 3.

Our paper brings one more small piece to this crossing-number puzzle. A vertex cover in a graph G is a set X of vertices of G such that every edge of G has at least one end in X. We prove that it is possible to compute in FPT the exact crossing number of a simple graph G when the minimum vertex cover size of G is bounded as a parameter.

Theorem 1

Given a simple graph G, the problem to compute the crossing number of G and the corresponding optimal drawing of G is fixed-parameter tractable with respect to the parameter \(k=|X|\) where \(X\subseteq V(G)\) is a vertex cover of G.

We remark that computing the minimum vertex cover X is itself in FPT when parameterized by |X| [10], and so we do not need X on the input.

Although bounding the vertex cover also bounds the pathwidth of a graph, our Theorem 1 is incomparable with [2] since their result gives exact values only for pathwidth 3 (for higher values of pathwidth [2] gives an approximation). Another notable point is that the classes of graphs of bounded vertex cover are monotone (closed under taking subgraphs), while the exact algorithm in [2] requires maximal graphs of pathwidth 3 (again, for non-maximal such graphs there is only a 2-approximation).

In the algorithm of Theorem 1 we follow the approach of Lokshtanov [20], who showed that Integer Quadratic Programming is in FPT when parameterized by the number of variables and the maximum of the absolute values of the coefficients. Lokshtanov then used his IQP algorithm to show that the problem Optimal Linear Arrangement of a graph G is in FPT when parameterized by the minimum vertex cover size of G. In the Optimal Linear Arrangement problem of a graph G, the task is to find a linear ordering of the vertex set of G which minimizes the sum of “lengths” of the edges of G. With respect to this, it is worth to note that the first NP-hardness proof for Crossing Number [14] used a simple reduction from Optimal Linear Arrangement, one which asymptotically preserves almost any reasonable graph parameter including vertex cover. Although we cannot directly apply our algorithm to the result of that reduction (due to a presence of parallel edges, as explained below), a simple modification along the lines of that reduction allows to deduce Lokshtanov’s result for Optimal Linear Arrangement from our algorithm.

2 Basic Definitions

We use the standard terminology of graph theory. A special attention has to be paid to simplicity of graphs – while (non-)simplicity is usually not an issue for the crossing number (just subdivide parallel edges), it becomes important with respect to the minimum vertex cover. Therefore, we will consider simple graphs throughout the paper by default, and we will use the term multigraph otherwise.

A drawing of a graph \(G=(V,E)\) is a mapping of the vertices V to distinct points in the plane, and of the edges E to simple curves connecting their respective end points but not containing any other vertex point. When convenient, we will refer to the elements (vertices and edges) of the drawing as to the corresponding elements of G. A crossing is a common point of two distinct edge curves, other than their common end point. It is well established that the search for an optimal solution to the crossing number problem can be restricted to so called good drawings: any pair of edges crosses at most once, adjacent edges do not cross, and there is no crossing point in common of three or more edges.

Definition 2

The problem Crossing Number asks for a good drawing D of a given graph G with the least possible number of crossings.

The number of crossings in a particular drawing D is denoted by \(\mathrm {cr}(D)\) and the minimum over all good drawings D of a graph G by \(\mathrm {cr}(G)\). We call \(\mathrm {cr}(D)\) and \(\mathrm {cr}(G)\) the crossing number of the drawing D and the graph G, respectively.

We will also need to deal with weighted crossing number. Consider a graph H with a weight assignment \(w:E(H)\rightarrow \mathbb N\). Then a crossing between edges \(e,f\in E(H)\) naturally counts as \(w(e)\cdot w(f)\) crossings (as if they were bunches of w(e) and w(f) parallel edges). The weighted crossing number \(\mathrm {cr}(H)\) of weighted H is defined as in Definition 2 while counting crossings this weighted way.

Following [20], we introduce the problem Integer Quadratic Programming (IQP) in a generalized form.Footnote 1 Its input consists of a \(k\times k\) integer matrix \({{\varvec{Q}}}\), an \(m\times k\) and \(m'\times k\) integer matrices \({{\varvec{A}}}\) and \({{\varvec{C}}}\), a k-dimensional integer vector \({{\varvec{p}}}\), and m- and \(m'\)-dimensional integer vectors \({{\varvec{b}}}\) and \({{\varvec{d}}}\). The task is to find an optimal solution \({{\varvec{z}}}^\circ \) to the following optimization problem:

$$\begin{aligned} \text {Minimize}\qquad&{{\varvec{z}}}^T{{\varvec{Q}}}{{\varvec{z}}}&+\> {{\varvec{p}}}^T{{\varvec{z}}} \nonumber \\ \text {subject to}\qquad&{{\varvec{A}}}{{\varvec{z}}}&\le ~ {{\varvec{b}}} \\&{{\varvec{C}}}{{\varvec{z}}}&=~ {{\varvec{d}}} \nonumber \\\nonumber&{{\varvec{z}}}&\in ~ \mathbb Z^k \end{aligned}$$
(1)

Note that “finding a solution” of an IQP instance means exactly one of the following three outcomes: the instance is infeasible and we correctly detect that, or the instance is feasible and unbounded and we again detect that, or the instance is feasible and bounded and we output an optimal solution \({{\varvec{z}}}^\circ \).

Theorem 3

(Lokshtanov [20]). Consider the Integer Quadratic Programming problem as above (1), where the input consists of the integer matrices \({{\varvec{A}}}\), \({{\varvec{C}}}\), \({{\varvec{Q}}}\) and the integer vectors \({{\varvec{b}}}\), \({{\varvec{d}}}\), \({{\varvec{p}}}\). Let L denote the length of the combined bit-representation of this input, and let \(\lambda \) be the largest absolute value of the entries in the matrices \({{\varvec{A}}}\), \({{\varvec{C}}}\) and \({{\varvec{Q}}}\), and the entries in the vector \({{\varvec{p}}}\). There exists an algorithm which finds a solution of this instance of IQP in time \(f(k,\lambda )\cdot L^{{{\mathcal O}}(1)}\) for some computable function f (that is, fixed-parameter tractable with input size L and parameters k and \(\lambda \)).

3 Clustered Optimal Drawings

We start with a high-level idea of our solution. Consider a simple graph G and a vertex cover \(X\subseteq V(G)\) of fixed size \(k=|X|\). Then \(V(G)\setminus X\) is an independent set and every vertex of \(V(G)\setminus X\) can be classified by its neighbourhood in X (and this classification is unique up to automorphisms). At the first sight it thus appears natural to form “uniform” clusters of the vertices with the same neighbourhood (to be treated the same way, whatever this means), and so seemingly “reduce” the input size to \({{\mathcal O}}(2^k)\) and then solve it in FPT by brute force. This is, unfortunately, not at all sufficient.Footnote 2

As we will see, while solving the crossing number problem, it would be enough to additionally classify the vertices of \(V(G)\setminus X\) by the cyclic ordering of their edges in the (yet to be found) optimal drawing of G. Furthermore, it will also be useful to restrict the arguments to the aforementioned good drawings (pairs of edges crosses at most once and adjacent pairs do not cross). In particular, in a good drawing the edges incident to one common vertex always form an uncrossed star. We give the following core definition (see also Fig. 1):

Definition 4

Let G be a graph with a vertex cover X, and D be a good drawing of G. Then two vertices \(x,y\in V(G)\setminus X\) belong to the same topological cluster in D (with implicit respect to X) if their neighbourhood in X is the same, and the clockwise cyclic order of the neighbours of x within D is the same as the clockwise cyclic order of the neighbours of y.

(Note that a vertex of X does not belong to any topological cluster in D.)

Fig. 1.
figure 1

An illustration of topological clusters with respect to the vertex cover formed by the middle four black vertices: any two blue (square) vertices on the left belong to the same topological cluster, and likewise for any two red (diamond) vertices. Any blue and a red vertex belong to different topological clusters. (Color figure online)

We aim to show that an optimal drawing of our graph G can be obtained in such a form that the topological clusters of vertices and the incident edges are “drawn closely together”. The same idea, only for the special case of the complete bipartite graph \(G=K_{k,n}\), has already been used by Christian, Richter and Salazar [8] (their research goal, though, was different). Our paper can be considered a generalization of (a part of) [8]. To achieve our goal, we separate two kinds of crossings and rigorously describe a topological clustering of a drawing of G.

Assume a good drawing D of G. Having two edges \(e,f\in E(G)\) such that one end of e belongs to the same topological cluster in D as one end of f, we say that a (possible) crossing of e and f is a cluster crossing. All other edge crossings occurring in D are called non-cluster crossings (and they include all crossings on edges with both ends in X). Here we denote by \(\mathrm {cr^n}(D)\) the number of non-cluster crossings (possibly weighted) in the drawing D.

In the following definition we, informally, select one weighted “representative” of each topological cluster of a drawing D.

Definition 5

A drawing \(D_X\) is called a topological clustering of the drawing D (of a graph G) with respect to its vertex cover X if the following hold:

  • \(D_X\) is an induced subdrawing of D and \(V(D_X)\supseteq X\),

  • every vertex of \(V(D)\setminus X\) belongs to the same topological cluster in D as some vertex of \(V(D_X)\setminus X\),

  • no two vertices of \(V(D_X)\setminus X\) are in the same topological cluster in \(D_X\), and

  • \(D_X\) is equipped with a weight function \(c:V(D_X)\setminus X\rightarrow \mathbb N\) such that, for every \(t\in V(D_X)\setminus X\), the size of the topological cluster in D containing t equals c(t).

Note that there can be many (topologically) different topological clusterings \(D_X\) of the same drawing D, depending on how the “representative” vertices from \(V(D_X)\setminus X\) are chosen. See also Fig. 2

Fig. 2.
figure 2

An illustration: the graph on the left has a vertex cover X formed by the three black vertices. There are three topological clusters wrt. X, depicted by the blue (square), red (diamond) and yellow (triangle) vertices. On the right, we can see two different topological clusterings of this graph, with the weights in the node circles. (Color figure online)

In view of Definition 5, it will be useful to consider the crossing number of the following independently weighted graphs. For a graph H, an independent set \(Y\subseteq V(H)\), and a weight function \(c:Y\rightarrow \mathbb N\), let the edge weights in H be as follows: for \(e\in E(H)\) having one end \(x\in Y\) we set \(c'(e):=c(x)\), and for edges e with both ends in \(V(H)\setminus Y\) we set \(c'(e)=1\). This defines the weighted crossing number of H and, in particular for \(Y=V(D_X)\setminus X\), the weighted crossing number \(\mathrm {cr}(D_X)\) of \(D_X\) with respect to its weight function c.

We can now formulate and prove the core claim:

Lemma 6

For every good drawing D of a graph G with a vertex cover X, there exists its topological clustering \(D_X\) such that the number of non-cluster crossings in D is at least \(\mathrm {cr}(D_X)\).

Proof

We start by setting \(D':=D\), and then we will inductively choose suitable representatives of the topological clusters of \(D'\) until we arrive at desired \(D_X\).

Let the cost of a vertex x of \(D'\) be the sum of all non-cluster(!) crossings carried by the edges of \(D'\) incident to x. We pick any (nonempty) topological cluster \(S\subseteq V(D')\setminus X\) and choose a vertex \(s_0\in S\) having the least cost among those of S. If \(|S|>1\), we iterate the following over all \(s\in S\setminus \{s_0\}\);

  • remove s and its incident edges from the drawing \(D'\),

  • choose a new vertex \(s'\) in a tiny neighbourhood of \(s_0\) in \(D'\), and draw the edges of \(s'\) in a tiny strip along the edges of \(s_0\) while making only such non-cluster crossings as those that exist on the edges of \(s_0\).

Since \(s_0\) and s have had the same neighbourhood, the new drawing \(D''\) as a graph (with \(s'\)) is isomorphic to \(D'\) and the vertices \(s_0\) and \(s'\) still belong to the same topological cluster. Moreover, since \(s_0\) has been chosen with the least cost, we have \(\mathrm {cr^n}(D'')\le \mathrm {cr^n}(D')\). (New cluster crossings can be simply ignored.)

At the end of the previous procedure, we get a drawing \(D^\circ \) (isomorphic to \(D'\)) which has no more non-cluster crossings than \(D'\), and all edges of the cluster S are drawn “the same way closely together” in \(D^\circ \). From this it follows that the number of non-cluster crossings carried by the edges incident to the cluster S in \(D^\circ \) equals |S|-times this number on the edges incident to \(s_0\) in \(D'\). We therefore define \(D_1\) as the induced subdrawing of \(D'\) obtained by deleting the vertices of \(S\setminus \{s_0\}\) and assigning the weight \(c(s_0)=|S|\). In the setting of independently weighted graph underlying \(D_1\), we get \(\mathrm {cr^n}(D_1)=\mathrm {cr^n}(D^\circ )\le \mathrm {cr^n}(D')\).

We finish the proof inductively. Let r be the number of topological clusters of given D. For \(i=1,2,\ldots ,r-1\), we now repeat the previous steps for \(D':=D_i\), obtaining a subdrawing \(D_{i+1}\) such that \(\mathrm {cr^n}(D_{i+1})\le \mathrm {cr^n}(D_i)\). Finally, \(D_{r}\) is a topological clustering of D with respect to X by Definition 4 and we conclude \(\mathrm {cr}(D_{r})=\mathrm {cr^n}(D_{r})\le \ldots \le \mathrm {cr^n}(D_1)\le \mathrm {cr^n}(D)\).    \(\square \)

4 Counting the Crossings in Clusters and Between

In order to complement Lemma 6, we need to estimate also the number of cluster crossings in a drawing D. This is actually quite easy using the fact that two vertices in the same topological cluster have the same cyclic ordering of their neighbours. We use the following simple claim (cf. Fig. 3):

Lemma 7

([8, Lemma 2.1]). Let xy be the two vertices of degree m in \(K_{2,m}\) for \(m\ge 3\). Consider any good drawing D of \(K_{2,m}\) such that the clockwise cyclic order of the neighbours of x within D is the same as the clockwise cyclic order of the neighbours of y. Then \(\mathrm {cr}(D)\ge \lfloor \frac{m}{2}\rfloor \cdot \lfloor \frac{m-1}{2}\rfloor :=Z(m)\).

Corollary 8

Consider a good drawing D of a graph G with a vertex cover X, and a topological cluster \(S\subseteq V(D)\setminus X\) of size \(c=|S|\). Let the degree of vertices in S be m. Then the number of cluster crossings in D between the edges incident with S is at least \({c\atopwithdelims ()2}\cdot \lfloor \frac{m}{2}\rfloor \cdot \lfloor \frac{m-1}{2}\rfloor ={c\atopwithdelims ()2}\cdot Z(m)\).

Readers may notice that the formula \({c\atopwithdelims ()2}\cdot \lfloor \frac{m}{2}\rfloor \cdot \lfloor \frac{m-1}{2}\rfloor \) in the lemma is not symmetric in c and m – it grows on one hand with \(c^2/2\) and on the other hand with \(m^2/4\). This is correct since the setting is also not symmetric. The vertices in S are required to have the same cyclic order of neighbours in D, but the neighbours of S do not have this property.

Proof

Let \(Z(m)=\lfloor \frac{m}{2}\rfloor \cdot \lfloor \frac{m-1}{2}\rfloor \). For \(s\in S\), denote by \(R_s\subseteq G\) the subgraph (a star) induced by s and the incident edges of s in G.

There is nothing to prove (the bound equals 0) for \(m\le 2\) or \(c=1\). Otherwise, for every pair \(s_1,s_2\in S\), \(s_1\not =s_2\), we apply Lemma 7 to the subdrawing \(D_{s_1,s_2}\) of D induced by \(R_{s_1}\cup R_{s_2}\), getting at least Z(m) crossings within \(D_{s_1,s_2}\). If \(s_3\in S\) is different from \(s_1\) and \(s_2\), then the crossings in \(D_{s_1,s_3}\) are all distinct from the crossings in \(D_{s_1,s_2}\); this is since \(E(D_{s_1,s_2})\cap E(D_{s_1,s_3})=E(R_{s_1})\), but the edges on \(R_{s_1}\) are all incident to \(s_1\) and so they cannot mutually cross in a good drawing. Consequently, each of the \(c\atopwithdelims ()2\) invocations of Lemma 7 contributes a collection of at least Z(m) new crossings, providing the overall lower bound of \({c\atopwithdelims ()2}\cdot Z(m)\) cluster crossings between the edges incident with S.    \(\square \)

Fig. 3.
figure 3

Left: an optimal drawing of \(K_{2,7}\) achieving the minimum number of \(Z(7)=9\) crossings among all drawings in which the two vertices of degree 7 have the same cyclic order of their neighbours (as in Lemma 7). Right: “stacking” the left subdrawings such that the total number of cluster crossings here matches the lower bound given by Corollary 8.

The next step is to introduce an “abstract level” of a topological clustering. Simply put, a drawing D is an abstract topological clustering of a graph G with respect to its vertex cover X if D is a topological clustering of some drawing of G, but without the weight function. More precisely:

Definition 9

A drawing \(C_X\) is an abstract topological clustering of a graph G with respect to its vertex cover X if the following hold:

  • \(C_X\) is a good drawing of an induced subgraph of G containing X,

  • for every vertex \(w\in V(G)\setminus X\) there is a vertex in \(V(C_X)\setminus X\) having the same neighbourhood as w in G, and

  • no two vertices of \(V(C_X)\setminus X\) are in the same topological cluster in \(C_X\).

We will further use the term of planarization of a drawing D, which is the plane graph obtained from D by turning every crossing into a new degree-4 vertex. Two drawings \(D_1\) and \(D_2\) of the same graph are combinatorially equivalent if the same pairs of edges cross in \(D_1\) as in \(D_2\), moreover in the same order of the crossings on each edge, and their planarizations are equivalent plane graphs (i.e., with the same collection of faces).

Lemma 10

Consider a graph G with a vertex cover X of size \(k=|X|\). Then every abstract topological clustering of G has size at most singly exponential in k, and the number of combinatorially non-equivalent abstract topological clusterings of G is bounded from above by a doubly exponential function of k.

Proof

A topological cluster in a drawing of G is uniquely determined by one of \(2^k\) possible neighbourhood subsets in X, and one of up to \((k-1)!\) cyclic orders of the neighbours. Hence an abstract topological clustering C of G has at most \(k+2^k(k-1)!\le k^{{{\mathcal O}}(k)}\) vertices. Hence the number of edges and of pairs of edges of C is bounded from above by \(k^{{{\mathcal O}}(k)}\), which also implies \(\mathrm {cr}(C)\le k^{{{\mathcal O}}(k)}\). Hence the planarization of C has at most \(k^{{{\mathcal O}}(k)}\) vertices, and there are altogether at most \(2^{k^{{{\mathcal O}}(k)}}\) such possible nonequivalent planarizations of abstract topological clusterings of G.    \(\square \)

A consequence of Lemma 10 is that we can, in FPT time, process all possible abstract topological clusterings of any graph G with a small vertex cover. Therefore, from now on, we may just fix one abstract topological clustering \(C_X\) of G and discuss how to optimize the crossing number over all such drawings of G whose topological clustering comes from \(C_X\). The latter problem will be reduced to a bounded instance of IQP, similarly as the special case of complete bipartite graphs has been handled in aforementioned [8].

4.1 IQP Formulation for Crossings

In regard of Definition 9 and the coming arguments, it will be useful to consider the following “compressed” representation of a graph G with a small vertex cover X. Let \(G_X\) denote the subgraph of G induced by X, and consider the function \(h:2^X\rightarrow \mathbb N_0\) such that, for any \(Y\subseteq X\), h(Y) is the number of vertices of G outside of X whose neighbourhood in G is exactly Y. Clearly, \(G_X\) and h determine G up to an isomorphism (and the size of this description can be only logarithmic compared to the size of G).

For given G and X, let us fix any abstract topological clustering \(C_X\) of G with respect to X. For \(Y \subseteq X\), let S(Y) be the set of vertices of \(V(C_X) \setminus X\) whose neighborhood in X is exactly Y. Note that h(Y) is non-zero iff S(Y) is non-empty. Let \(Y_1, \ldots , Y_l\) be an enumeration of all subsets of X which map to a non-zero value under h; then \(\bigcup _{i = 1}^{\,l} S(Y_i) = V(C_X) \setminus X\). For \(i \in \{1, \ldots , l\}\), let \(g(i) = |S(Y_i)|\) and let \(S(Y_i) = \{v_{(i, 1)}, \ldots , v_{(i, g(i))}\}\).

For an illustration, in Fig. 2 (on the right, but ignoring the weights since we are considering an abstract clustering) we have got \(l=2\) (\(Y_1=X\) and \(Y_2\) are the two bottom vertices of X), and \(g(1)=2\) (blue and red clusters) and \(g(2)=1\) (yellow cluster). Altogether, \(V(C_X) \setminus X\) has three vertices there.

Let I be an index set defined as \(I := \{ (i, j) \mid 1 \le i \le l, 1 \le j \le g(i)\}\). Similarly as in [8], we define the following crossing vector \({{\varvec{p}}} = (p_\alpha \mid \alpha \in I)\) and the crossing matrix \({{\varvec{Q}}} = (q_{\alpha , \beta } \mid \alpha ,\beta \in I)\), such that the intended use of \({{\varvec{p}}}\) is to count the crossings between the edges of \(G_X\) and the edges incident to each topological cluster corresponding to a vertex of \(V(C_X)\setminus X\), and the intended use of \({{\varvec{Q}}}\) is to count the cluster crossings of each one of the topological clusters (the diagonal entries) and the non-cluster crossings between pairs of the clusters (the other entries):

  • The crossing vector \({{\varvec{p}}}\,\): Let \(e_1, \ldots , e_r\) be an enumeration of the edges in \(G_X\). For \(\alpha \in I\) and \(i \in \{1, \ldots , r\}\), let \(p^i_\alpha \) be the number of edges incident to \(v_\alpha \) that cross \(e_i\) in \(C_X\). Then \(p_\alpha = \sum _{i = 1}^{r} p^i_\alpha \).

  • The crossing matrix \({{\varvec{Q}}}\,\): Let \(\alpha ,\beta \in I\). If \(\alpha \ne \beta \), define \(q_{\alpha , \beta }\) as the number of crossings in \(C_X\) between the edges incident to \(v_\alpha \) and the edges incident to \(v_\beta \). If \(\alpha = \beta = (i, j)\), then \(q_{\alpha , \alpha } := Z(|Y_i|) = \big \lfloor \frac{|Y_i|}{2} \big \rfloor \cdot \big \lfloor \frac{|Y_i|-1}{2} \big \rfloor \).

(\(Z(\cdot )\) has been defined in Lemma 7 and Corollary 8.)

To recapitulate where we stand now; we have fixed an abstract topological clustering \(C_X\) of G, and in order to proceed to a drawing of G (underlied by \(C_X\)), we first need to assign suitable integer weights to the vertices of \(V(C_X) \setminus X\). Our goal is to minimize the total number of crossings in the constructed drawing of G. However, we only have \(C_X\) and some assigned weights on \(V(C_X) \setminus X\), which together define the topological clustering \(D_X\) of a drawing of G. The crossing number \(\mathrm {cr}(D_X)\) is, via Lemma 6, related to the number of non-cluster crossings in a desired drawing of G (refer to the proof of Theorem 12 for a precise formulation). But it is not sufficient to minimize \(\mathrm {cr}(D_X)\) since the cluster crossings in a drawing of G also play important role.

To complete the picture with cluster crossings, we define (cf. Corollary 8)

$$ \mathrm {cl}(D_X) := \sum _{t\in V(D_X)\setminus X} {c(t)\atopwithdelims ()2}\cdot Z\big (d(t)\big ) = \sum _{t\in V(D_X)\setminus X} {c(t)\atopwithdelims ()2}\cdot \left\lfloor \frac{d(t)}{2}\right\rfloor \cdot \left\lfloor \frac{d(t)-1}{2}\right\rfloor ,$$

where c is the weight function of \(D_X\) and d(t) denotes the degree of t (which is the same in \(D_X\) as in G). Again, we refer to the proof of Theorem 12 for further treatment of the relation of \(\mathrm {cl}(D_X)\) to the cluster crossings in a drawing of G.

Lemma 11

Let \(C_X\) be an abstract topological clustering of G with respect to a vertex cover X, and denote by \(\mathcal {D}(C_X)\) the set of all topological clusterings of good drawings of G whose unweighted topological clustering is \(C_X\). Let, furthermore, \(Y_i\), g, I, \({{\varvec{p}}}\) and \({{\varvec{Q}}}\) be as above. Then the following IQP

(2)

computes the minimum value of \(2\cdot (\mathrm {cr}(D)+\mathrm {cl}(D)-r)\) over all \(D\in \mathcal {D}(C_X)\), where \(r=\mathrm {cr}(C_X|_X)\) is the number of crossings in the subdrawing of \(C_X\) induced by the vertex set X.

Proof

First, note that for any \(D\in \mathcal {D}(C_X)\) we have \(\mathrm {cr}(D|_X)=r\) by definition. For a particular weight assignment \({{\varvec{z}}}\), consider the corresponding topological clustering \(D=D(C_X,{{\varvec{z}}})\in \mathcal {D}(C_X)\). We write \(\mathrm {cr}(D)=r+r_1(D)+r_2(D)\) where \(r_1(D)\) counts the (weighted) crossings in D which involve one edge with both ends in X, and \(r_2(D)\) counts the crossings of which neither edge has both ends in X. From the definition of the crossing vector \({{\varvec{p}}}\) we immediately have \(r_1(D)={{\varvec{p}}}^T {{\varvec{z}}}\). From the definition of the crossing matrix \({{\varvec{Q}}}\) and that of \(\mathrm {cl}(\cdot )\) we also get \(r_2(D)+\mathrm {cl}(D)=\frac{1}{2}\cdot {{\varvec{z}}}^T {{\varvec{Q}}}{{\varvec{z}}}\). Altogether, \(\frac{1}{2}f({{\varvec{z}}})=r_1(D)+r_2(D)+\mathrm {cl}(D)=\mathrm {cr}(D)+\mathrm {cl}(D)-r\).    \(\square \)

We are now ready to prove the main result of this paper, which is as stated below.

Theorem 12

(refinement of Theorem 1). Consider a simple graph G given on the input as follows: there is a set X (a vertex cover of G), a simple graph \(G_X\) (which is the subgraph of G induced by X), and a function \(h:2^X\rightarrow \mathbb N_0\) such that, for \(Y\subseteq X\), h(Y) is the number of vertices of G outside of X whose neighbourhood in G is exactly Y. The size of this input G equals the size of \(G_X\) plus the length of the bit-representation of function h.

Then the problem to compute the crossing number of G and the corresponding topological clustering of an optimal drawing of G is fixed-parameter tractable with respect to the parameter \(k=|X|\).

Note that, when the vertex cover size \(k=|X|\) is fixed, the size of the input G described in Theorem 12 is logarithmic in the number of vertices of G. Although, in a typical use case, in which we do not get the input graph G in a parsed form as in Theorem 12, but rather as a list of vertices and edges, we can first compute, again in FPT [10], a vertex cover X of size \({\le }k\) and the corresponding function h. Then, from the output topological clustering of an optimal drawing of G, we can easily in polynomial time construct the corresponding drawing of G. Hence Theorem 12 implies Theorem 1.

Proof

Consider an optimal drawing \(D_0\) of G, i.e., one for which \(\mathrm {cr}(D_0)=\mathrm {cr}(G)\) holds. Then \(D_0\) may be assumed a good drawing by folklore arguments. By Lemma 6, there is a topological clustering \(D_X\) of \(D_0\) such that \(\mathrm {cr^n}(D_0)\ge \mathrm {cr}(D_X)\). Recall that \(D_X\) is equipped with the weight function c, and that \(\mathrm {cl}(D_X) =\) \(\sum _{t\in V(D_X)\setminus X} {c(t)\atopwithdelims ()2}\cdot Z\big (d(t)\big )\) where d(t) denote the degree of t. By Corollary 8, the total number of cluster crossings in \(D_0\) is at least \(\mathrm {cl}(D_X)\).

Now, let \(C_X\) be the abstract topological clustering underlying \(D_X\). Although we do not (yet) know \(D_X\), we can “find” \(C_X\) by a brute force enumeration of all abstract topological clusterings of G, which is still in FPT by Lemma 10. Precisely, for every possible \(C_X\) (where “possible” is checked simply by brute force with respect to the parameter k), we compose an IQP as above (2). Then, using Theorem 3, we solve it to get an assignment \({{\varvec{z}}}\) of weights to \(C_X\), leading to a clustering \(D_X'\), such that the objective value \(\mathrm {cl}(D_X')+\mathrm {cr}(D_X')\) is minimized over all \(D_X'\in \mathcal {D}(C_X)\) by Lemma 11. Let, furthermore, \(C_X^\circ \) be an abstract topological clustering of G achieving the overall minimum value of the IQP solutions – this leads to a clustering \(D^\circ _X\) with globally minimal \(\mathrm {cl}(D_X^\circ )+\mathrm {cr}(D_X^\circ )\) for given G.

Consequently, counting separately the cluster and non-cluster crossings in \(D_0\), and then considering the minimality of \(D^\circ _X\), we get

$$ \mathrm {cr}(D_0)\ge \mathrm {cl}(D_X)+\mathrm {cr^n}(D_0)\ge \mathrm {cl}(D_X)+\mathrm {cr}(D_X)\ge \mathrm {cl}(D_X^\circ )+\mathrm {cr}(D_X^\circ ) .$$

It is now enough to “lift” the clustering \(D_X^\circ \) into a corresponding drawing \(D_1\) of G with \(\mathrm {cl}(D_X^\circ )+\mathrm {cr}(D_X^\circ )\) crossings, which follows straightforwardly in the same way as in [8], see Fig. 3. Hence \(\mathrm {cl}(D_X^\circ )+\mathrm {cr}(D_X^\circ )\ge \mathrm {cr}(G)=\mathrm {cr}(D_0)\), and so \(\mathrm {cr}(D_1)=\mathrm {cr}(D_0)=\mathrm {cr}(G)\).

It remains to address runtime of our procedure. In the IQP (2) we have |I| bounded from above by the size of \(C_X\), which is at most singly exponential in k by Lemma 10. The same asymptotic upper bound \(k^{{{\mathcal O}}(k)}\) from the proof of Lemma 10 applies also to \(\mathrm {cr}(C_X)\), and this clearly bounds all the entries of the matrix \({{\varvec{Q}}}\) and the vector \({{\varvec{p}}}\). Let L be the length of the bit representation of h (from the input representation of G); then the length of the combined bit representation of the IQP (2) is at most \(f_1(k)\cdot L^{{{\mathcal O}}(1)}\) for some computable (singly exponential) function \(f_1\). Then from Theorem 3, (2) is solved by an algorithm in FPT time \(f_2(k)\cdot L^{{{\mathcal O}}(1)}\) for some computable function \(f_2\). This IQP step is repeated, by brute force and independently of L, at most \(f_3(k)\) times where \(f_3\) is a computable function (doubly exponential) coming from the bound on the number of abstract clusterings in Lemma 10.    \(\square \)

5 Conclusions

In our work we have stressed simplicity of the considered graphs. A natural question is about what happens if we consider multigraphs with a vertex cover of size k. There is, unfortunately, no easy answer to this question since deep problems arise in two different places of our arguments. First, since the multiplicity of an edge may be unbounded in k, the entries of the crossing vector \({{\varvec{p}}}\) and the crossing matrix \({{\varvec{Q}}}\) would no longer be bounded in k. Second, when defining topological clusters, it would no longer be enough to consider a bounded number of neighbourhoods in X and a bounded number of cyclic orders, but also a potentially unbounded number of different multiplicities of the edges in a cluster. Each of these problems would completely ruin the runtime of our procedure.

Therefore, we leave the problem of computational complexity of the exact crossing number of multigraphs parameterized by a vertex cover size as open, for future research. On the other hand, in the special case of multigraphs with a vertex cover of size k and edge multiplicities bounded by a computable function of k, it is not difficult to extend our approach to obtain again an FPT algorithm (which we skip here due to space restrictions).

At last, we would like to very briefly mention the problem of minimizing the crossing number of a small perturbation of a given map of a graph, e.g. [13], which shares some common ground with our arguments. Although the objectives of the two problems are not easily comparable, we suggest that our approach can provide an efficient solution of the latter problem on graphs of small vertex cover.