Crossing Number for Graphs With Bounded Pathwidth

The crossing number is the smallest number of pairwise edge-crossings when drawing a graph into the plane. There are only very few graph classes for which the exact crossing number is known or for which there at least exist constant approximation ratios. Furthermore, up to now, general crossing number computations have never been successfully tackled using bounded width of graph decompositions, like treewidth or pathwidth. In this paper, we for the first time show that crossing number is tractable (even in linear time) for maximal graphs of bounded pathwidth~3. The technique also shows that the crossing number and the rectilinear (a.k.a. straight-line) crossing number are identical for this graph class, and that we require only an $O(n)\times O(n)$-grid to achieve such a drawing. Our techniques can further be extended to devise a 2-approximation for general graphs with pathwidth 3, and a $4w^3$-approximation for maximal graphs of pathwidth $w$. This is a constant approximation for bounded pathwidth graphs.


Introduction
The crossing number cr(G) is the smallest number of pairwise edge-crossings over all possible drawings of a graph G into the plane. Despite decades of lively research, see e.g. [26,27], even most seemingly simple questions, such as the crossing number of complete or complete bipartite graphs, are still open, cf. [24]. There are only very few graph classes, e.g., Petersen graphs P (3, n) or Cartesian products of small graphs with paths or trees, see [4,21,25], for which the crossing number is known or can be efficiently computed.
Considering approximations, we know that computing cr(G) is APX-hard [5], i.e., there does not exist a PTAS (unless P = NP). The best known approximation ratio for general graphs with bounded maximum degree isÕ(n 0.9 ) [10]. We only know constant approximation

Preliminaries
We always consider a simple undirected graph G with n vertices as our input. A drawing of G is a mapping ϕ of vertices and edges to points and simple curves in the plane, respectively. The curve ϕ(e) of an edge e = (u, v) does not pass through any point ϕ(w), w ∈ V (G), but has its ends at ϕ(u) and ϕ (v). When asking for a crossing minimum drawing of G, we can restrict ourselves to good drawings, which means that adjacent edges do not cross, non-adjacent edges cross at most once, and no three edges cross at the same point of the drawing. For other drawings, straightforward redrawing arguments, see e.g. [26], show that the crossing number can never increase when establishing these properties. A clique is a complete graph and a biclique is a complete bipartite graph. While the exact crossing number is unknown for general cliques and bicliques, there are upper bound constructions, conjectured to attain the optimal value. In particular the old construction due to Zarankiewicz, attaining n1 2 n1−1 2 n2 2 n2−1 2 crossings for K n1,n2 , is known to give the optimum for n 1 ≤ 6 [20].
following observation is trivial (because any vertex of the anchor-triplet of C belongs to all bags of C) but crucial for our analysis.
Observation 1. Let G be a maximal pathwidth-3 graph and let C be a cluster. Then the graph induced by V (C) consists of the triangle induced by T (C) and (edge-disjoint) a biclique K 3,n(C)−3 with one partition being T (C).
We define the emerging vertex of C i , denoted by x + i , as the vertex introduced by the last bag of C i . Note that x + i belongs to the anchor-triplet of the next cluster C i+1 if i < κ. We define the lost vertex of C i , denoted by x − i , as the vertex that was forgotten by the second bag of C i . Note that x − i belongs to the anchor-triplet of the previous cluster C i−1 if i > 1, but not to the anchor-triplet of C i . Observe that For notational simplicity, we define x + 0 := v 2 . Any vertex x that belongs to C i but is not in T (C i ) ∪ {x + i , x − i } is called a singleton of C i . Vertex x belongs to a "middle" bag of C i and only appears in this bag; it belongs to no cluster other than C i . See Fig. 1 for an example.

Exact Algorithm for Maximal Pathwidth-Graphs
Let G be a maximal pathwidth-3 graph and fix an alternating path decomposition of width 3. By maximality, all bags form cliques, and in particular, each anchor-triplet induces a triangle in the graph, called anchor triangle consisting of anchor edges. The general idea to draw G is to iterate through the clusters C 1 , . . . , C κ . When considering cluster C i , its first bag will already be drawn and the anchor triangle will form the outer face of the current drawing. About half of the vertices introduced by C i will be drawn inside the anchor triangle while the other half will be drawn outside, mimicking Zarankiewicz' construction locally. The number of crossings that these vertices add will be exactly the minimum number of crossings needed to draw the biclique K 3,n(Ci)−3 of cluster C i , hence leading to an optimal drawing.
We start with drawing bag X 1 = {v 1 , v 2 , v 3 , v 4 } as a planar drawing of K 4 with the vertices T (C 1 ) = X 2 = {v 2 , v 3 , v 4 } on the outer face. Now we iterate over all clusters C i , 1 ≤ i ≤ κ, drawing their bags with the following invariants: The drawing is good and straight-line. Before drawing C i , the outer face contains the three vertices T (C i ). For any j ≤ i, the anchor edges of C j are drawn without crossings. Let be the number of singleton vertices in C i (possibly = 0). We need to place the singletons and the emerging vertex x + i . We will add 1 := ( + 1)/2 ≤ vertices into an 13:5 Adding 2 vertices outside.

Figure 2
Drawing maximal pathwidth-3 graphs. For ease of legibility we draw some edges in (c) slightly curved. Dotted lines mark boundaries of the regions defined in the text.
Placement on the inside. By the invariant the outer face consists of the edges connecting T (C i ) = {x + i−1 , p, q} for some p, q. W.l.o.g. assume that x + i−1 , p, and q occur in clockwise order walking along the outer face. By maximality, and because x + i−1 has just been introduced, x + i−1 has degree 3 in the current graph, and its neighbors are p, q, x − i . Let R be the open region obtained by the intersection of three open "wedges" W 1 , W 2 , W 3 defined as follows: Wedge W 1 emanates from , respectively) with a sufficiently small angle such that it crosses only edges incident to x + i−1 . Any point inside R can be connected to all of p, q, x + i−1 with straight lines and a single crossing (with edge (x + i−1 , x − i )). Consider a straight line s through R but not through any of p, q, x + i−1 . Place 1 vertices (for 1 singletons of C i ) along s within R, and connect each of them to all of p, q, x + i−1 . All generated crossings are with edge (x + i−1 , x − i ) or among the added edges. The drawing is straight-line and good (no three edges cross in a point), and the number of added crossings is 1 + 1 2 = 1 2 1 ( 1 + 1). Placement on the outside. The outer face of the drawing is still formed by the edges connecting T (C i ), since all vertices from the paragraph above were added inside R and thus in the interior of T (C i ). We know that the vertex x − i+1 in T (C i ) will be lost in the next cluster C i+1 (if there is any); it will play a prominent role now. Since we may or may not have Any point inside W can be connected via straight lines to all of p , q , x − i+1 without any crossings. Consider a straight line s through W, not through any of x − i+1 , p , q , and crossing (p , q ). Now place 2 vertices along s within W, and connect all of them to all of x − i+1 , p , q via straight lines. All generated crossings are among the added edges. The drawing is still straight-line and good, and the number of added crossings is 2 2 . The outer face of the resulting drawing is again a triangle with two corners being p and q and the third corner being a vertex that was added on s . We assign this latter vertex the role of the emerging vertex x + i ; the other inserted vertices are the necessary singletons. With this, the invariant holds since T This finishes the description of the drawing algorithm. We claim that the final drawing has the minimum possible number of crossings: We first give an upper bound on the number I S A A C 2 0 1 7 13:6 Crossing Number for Graphs with Bounded Pathwidth of crossings that we achieve, and then show that any drawing requires this number.

Lemma 2. The above algorithm produces at most
Proof. The algorithm started with a planar drawing of K 4 . We argued above that the i-th iteration (drawing C i , which contains singletons) added crossings, where 1 = ( + 1)/2 and 2 = ( + 1)/2 . Finally, observe that = n( Lemma 3. Any good drawing of G requires at least Proof. From Observation 1 we know that each cluster C i contains a biclique B(C i ) := K 3,n(Ci)−3 . By Zarankiewicz' formula, K 3,m needs m/2 (m − 1)/2 crossings in any drawing. Thus, within each cluster we only introduce the optimal number of crossings.
However, we must argue that it is impossible for one crossing to belong to two or more clusters in an optimal drawing. This holds because nearly all of V (C i ) does not belong to other clusters. More precisely, assume some other cluster C j shares vertices with C i ; we may assume j < i. Then all common vertices must appear in the first bag However, only three edges of those induced by X are in B(C i ), and all three of them are incident to x − i . Since adjacent edges do not cross in a good drawing, no crossing can be shared between B(C i ) and B(C j ). Proof. Optimality follows from Lemmas 2 and 3. The second part of the claim follows from the first and third invariant in the above algorithmic description. It remains to argue linear running time. Computing a path decomposition of width 3 (if it exists) can be done in linear time [2,3]. This path decomposition can be turned into an alternating path decomposition in linear time as well. On it we compute cr(G) as the sum in Lemma 2 in linear time.
Assume we are interested in the drawing achieving this solution. The drawing algorithm uses O(n) operations, but this does not immediately imply linear time, since coordinates may become very small. We also cannot list all crossings, as there can be Θ(n 2 ) many. If, however, we are careful about how to place anchor-triplets, then singletons can be inserted while keeping all vertices at grid-points of an O(n) × O(n)-grid, and thus we require only linear time to compute and output the drawing. Details are given in the full version of the paper [1, Appendix B]. We summarize: Theorem 5. Every maximal pathwidth-3 graph on n vertices has a crossing-minimum drawing that is good, straight-line, and lies on a 28n × 29n-grid. It can be found in O(n) time.

Approximation Algorithm for Pathwidth-3 Graphs
We now give an algorithm that draws graphs of pathwidth 3 (not necessarily maximal) such that the number of crossings is within a factor of 2 of the optimum. Roughly speaking, if the graph is 3-connected (technically, we will define a slightly weaker assumption 3-traceable), then the algorithm for maximal pathwidth-3 graphs is applied, and the number of crossings is within a factor of 2. If the graph is not 3-traceable, then it can be split and the arising subdrawings can be "glued" together without increasing the approximation ratio.

3-traceable graphs
We first analyze graphs that satisfy a condition that is weaker than 3-connectivity. Define a non-anchor vertex to be a vertex that occurs in exactly one bag. Those are exactly v 1 , v n , and all the singletons defined earlier.
Definition 6 (3-traceable graph). A graph G with an alternating path decomposition P of width 3 is 3-traceable if every non-anchor vertex has degree at least 3, and for all 1 Assume we are given a 3-traceable graph G with an alternating path decomposition P of width 3. We can first maximize G (obtaining G ) by adding all edges that have both ends in one bag, but are not in G yet. We then apply the algorithm described in Section 3 to G , and finally delete the temporarily added edges again. We will show: Lemma 7. Let G be a 3-traceable graph. Then the algorithm of Theorem 4 gives a drawing of G with at most 2cr(G) crossings.
We first give a sketch of the proof. The main challenge is that a cluster C now does not necessarily contain a biclique K 3,n(C)−3 . However, we can argue that G contains a subdivision of K 3,n(C)−3 that uses mostly vertices of C, but "borrows" a non-anchor vertex each (to play the role of x − i and x + i ) from the nearest preceding and succeeding cluster that has such vertices. This subdivided K 3,n(C)−3 requires cr(K 3,n(C)−3 ) crossings. The main work is then in arguing that these subdivided bicliques cannot overlap much, or more precisely, that any crossing can belong to at most 2 of them. Lemma 7 then follows by applying the upper bound given in Lemma 2.
There are three types of edges in G. Type I are edges that are incident to non-anchor vertices. Type II are edges that have the form ( Finally, Type III are the remaining edges (they connect vertices of some anchor-triplet T (C i ), 1 ≤ i ≤ κ).
consists of two paths of length 0 (the common vertices of the triplets) and the third path being this edge. We obtain arbitrary Π i,j by extending Π i,i+1 via Π i+1,j . Since G is 3-traceable, the non-anchor vertices have degree 3 and are adjacent to the vertices of the anchor-triplet of their unique cluster; those lie on distinct paths of Π.
This shows that G has K 3,n as a minor, where n is the number of non-anchor vertices. Unfortunately this is not sufficient for crossing number arguments as contracting edges may increase the crossing number. Instead, we will use the above structure to extract a subdivision of K 3,n(C)−3 for each cluster C in such a way that these bicliques do not overlap "much."

13:8 Crossing Number for Graphs with Bounded Pathwidth
The structure of a 3-traceable graph. Dotted triangles mark anchor-triples with at least one adjacent singleton. In bold, we show one cluster biclique: the anchor vertices depicted as circles form one partition side. The left-and rightmost bold singleton is "borrowed" from the preceding and succeeding singleton-containing cluster, respectively. Definition 9. Let C i , 1 ≤ i ≤ κ, be a cluster with at least one singleton. The cluster biclique of C i , denoted B(C i ), is a subdivision of K 3,n(Ci)−3 obtained as follows, cf. Fig. 3: (a) The 3-side is formed by the three vertices of T (C i ). (b) Every singleton w that belongs to C i (there are n(C i ) − 5 of them) is one of the vertices on the side that will have n(C i ) − 3 vertices. We know that deg(w) = 3 by 3-traceability, and it is adjacent to all of T (C i ) as required for the biclique.
has a non-anchor vertex; among its non-anchor vertices, let w − (w + ) be the youngest (oldest, respectively). If i = 1, we simply set w − := v 1 ; if i = κ, we set w + := v n . By Observation 8, we can establish three disjoint paths from w − and w + to T (C i ). Hence, add w − and w + to the "big" side of B(C i ). Observe that in either case, w − and w + are distinct from the the singletons of C i and their paths to T (C i ).
Lemma 10. Let e 1 , e 2 be two edges of G without common endpoint. There are at most two cluster bicliques that contain both e 1 and e 2 .
Proof. We are done if at least one of e 1 and e 2 is of Type III, because then it belongs to no cluster biclique at all. Assume that one of e 1 and e 2 is of Type II, say e 1 = ( Edge e 1 may be used only for the cluster bicliques B(C j − ) and B(C j + ) where j − < i (j + ≥ i) is the maximal (minimal) index such that cluster C j − (C j + , respectively) has singletons. The fact that e 1 belongs to at most two cluster bicliques proves the claim.
Finally, assume that both e 1 and e 2 are of Type I, i.e., incident to distinct non-anchor vertices, say y 1 ∈ C i and y 2 ∈ C i . Let C ⊆ C be the ordered subsequence of clusters that have at least one non-anchor vertex. A non-anchor vertex x can belong to at most three cluster bicliques, refer to Definition 9: the one of its "own" cluster C ∈ C , and those of the directly preceding and succeeding cluster in C . Assume that y 1 and y 2 are in three cluster bicliques. If i = i , y 1 and y 2 are singletons of different age in C i , and the two clusters directly preceding and succeeding C i would have chosen distinct singletons of C i , a contradiction. If i = i , any overlap of three-element subsequences of C with distinct middle clusters has size at most 2, a contradiction.
Proof of Lemma 7. We know from Lemma 2 that the algorithm of Theorem 4 gives a drawing with at most C∈C 1 2 (n(C) − 3) 1 2 (n(C) − 4) crossings. We need to consider only clusters C that have at least one singleton; for any other cluster we have n(C) = 5 and therefore its summand is 0. For any cluster C that has a singleton, we have B(C), a subdivision of K 3,n(C)−3 , which requires at least 1 2 (n(C) − 3) 1 2 (n(C) − 4) crossings in any good drawing D of G. Any crossing in D is created by two edges without common endpoints, and by Lemma 10, any such pair belongs to at most two cluster bicliques. Hence any drawing of G has at least 1 2 C∈C 1 2 (n(C) − 3) 1 2 (n(C) − 4) crossings, yielding the 2-approximation.

General pathwidth-3 graphs
A pair of vertices {u, v} of a 2-connected graph G is called a separation pair if G − {u, v} is not connected. Assume that the pathwidth-3 graph G is 2-connected but not 3-traceable. We will show that we can split the graph at separation pairs within anchor-triplets, draw the cut-components recursively, and merge them without introducing additional crossings. We start with a more general auxiliary statement whose proof is in [1, Appendix C].
Lemma 11. Let G be a 2-connected graph with a separation pair {u, v}. Consider a partition of G into two edge-disjoint connected subgraphs H 1 , We will draw cut-components inside triangles bounded by their three oldest vertices.
Lemma 12. Let G be a 2-connected graph with an alternating path decomposition P of width 3. Then there exists an algorithm to create a straight-line drawing of G with at most 2cr(G) crossings. All anchor-edges are drawn without crossings, and the three oldest vertices {v 1 , v 2 , v 3 } form the corners of the triangular convex hull of the drawing.
Proof. We prove the result by induction on the structure and size of the graph.
Base case: G is 3-traceable or a K 4 . If G = K 4 , the claim is obvious. Otherwise, we apply Lemma 7. However, the algorithm of Theorem 4 used therein grows the drawing "outwards", while we would now like the oldest vertices to form the outer triangle. Thus we apply the algorithm for the reverse path decomposition; this makes (by suitably placing the last vertex) T (C 1 ) = {v 1 , v 2 , v 3 } the outer face and draws it as a triangle. Induction Step: G is neither 3-traceable nor a K 4 . For every non-anchor vertex w = v 1 of degree 2, let p w , q w be its adjacent anchor vertices. We can temporarily remove w from G, ensure that the reduced graph contains edge (p w , q w ), draw the reduced graph, andsince (p w , q w ) will be drawn crossing free by the induction hypothesis-reinsert each w with (p w , w), (w, q w ) crossing-free close to the drawing of (p w , q w ). Similarly, we can remove v 1 if it has degree 2: We can choose an age-order of the reduced graph G such that the neighbors of v 1 are among the three oldest vertices of G and hence draw G such that the neighbors of v 1 are on the outer-triangle; then v 1 can be reinserted on the outside to form the desired outer triangle. If the graph became 3-traceable by these operations, we are done (base case). Otherwise, we can now assume that all non-anchor vertices have degree 3. Since There exists a unique bag X j , the common bag of C i−1 and C i , that contains both x + i−1 and x − i . Let p, q be the two other vertices in this bag, and observe that T Let G be the graph induced by all vertices that appear in bags P := [X 1 , X j−2 ], and let G r be the graph induced by all vertices that appear in bags P r := [X j+2 , X ξ ]. Any edge of G appears in G or G r , since {x − i , x + i−1 } is the only vertex-pair that existed in bags of P, but neither of P nor P r . Clearly, {p, q} is a separation pair with G ∩ G r = {p, q}.
Define G + = G ∪ {(p, q)} and G + r = G r ∪ {(p, q)}. By the addition of edge (p, q) (if it did not already exist), both graphs are 2-connected. Apply induction to G + r (with path I S A A C 2 0 1 7 13:10 Crossing Number for Graphs with Bounded Pathwidth decomposition P r ) and G + (with the path decomposition P ). Since p, q belong to the first bag of P r , we can ensure that they are among the three oldest vertices of G + r . We obtain two drawings D + 1 , D + 2 in both of which (p, q) is not crossed. We can insert (affinely transformed) D + 2 , which has (p, q) on its bounding triangle, along (p, q) in D + 1 without additional crossings. Finally, we remove edge (p, q) from the resulting drawing if (p, q) ∈ E(G).
We are now ready to establish the theorem for general pathwidth-3 graphs.
Theorem 13. Let G be any pathwidth-3 graph. We have cr(G) ≤ 2cr(G), and a linear time algorithm to create a good straight-line drawing of G with at most 2cr(G) crossings.

Proof. (Sketch)
If G is 2-connected, then the result holds by Lemma 12. It is well known that cr(G) is additive over the 2-connected components of G. When gluing at cut-vertices, the cut-vertex must be on the outer face of the drawing to be inserted into the other. We can achieve this while maintaining a straight-line drawing by choosing appropriate path decompositions; see [1, Appendix D]. The running time follows as in Theorem 4.

Approximation Algorithm for Graphs of Higher Pathwidth
We now study the crossing number of graphs that have pathwidth w ≥ 4, and are maximal within this class. We give an algorithm to draw such graphs, and show that the number of crossings in the resulting drawing is within a factor of 4w 3 of the crossing number. As opposed to Section 3, the drawings we create here are not straight-line drawings.
As before we assume that we have an alternating path decomposition P = {X i } 1≤i≤ξ of width w. We again use the age-order {v 1 , . . . , v n } of the vertices of G. Define G i to be the graph induced by vertices v 1 , . . . , v i , and use deg Gi (v) to denote the number of neighbors that v has within graph G i . For any 1 ≤ i ≤ n, let the predecessors of vertex v i be those neighbors that are older. We will only use this concept for i ≥ w + 1, which implies that v i has exactly w predecessors by maximality of G. We enumerate them as {p i 1 , . . . , p i w } in age-order, with p i 1 the oldest. Drawing algorithm. We create a drawing of G by starting with G w+1 (the graph induced by v 1 , . . . , v w+1 ) and then iteratively adding vertex v i . We maintain the following invariants for the drawing of G i (see also Figure 4): Vertex v j is drawn at (j, 0) for all 1 ≤ j ≤ i. The drawing is contained in the half-space {(x, y) : x ≤ i}. All vertices w in the bag introducing v i are bottom-visible, i.e., the vertical ray downward from w does not intersect any edge. We start by placing v 1 , . . . , v w+1 at their specified coordinates, and draw the edges between them as half-circles above the x-axis. This satisfies the above invariants and gives rise to w+1 4 crossings since crossings are in 1-to-1-correspondence with subsets of 4 vertices. Assume G i−1 is drawn and consider v i , for i ≥ w + 2. Place v i as specified, i.e., to the right of all previous vertices and edges. Let p i 1 , . . . , p i w be the predecessors of v i , all of which are bottom-visible by the invariant. We draw the edges to them using two different methods (and then redraw previous edges as a third step for each i). See also Figure 4.
The edge to p i 1 (the oldest predecessor) is routed counterclockwise around the drawing of G i−1 until it is below but slightly to the left of p i 1 , from where it connects to p i 1 . We need no crossings, and all predecessors remain bottom-visible. All other w − 1 edges incident to v i are routed together as a bundle from v i leftward below the drawing of G i−1 . This allows v i to be bottom-visible. Whenever the bundle is slightly to the right of some p i k , w ≥ k ≥ 2, one of the bundle's lines (the lowest one) connects to p i k . The remaining bundle lines go counterclockwise around p i k , in its direct vicinity, until they are to the left of p i k and below G i−1 . The bundle hence crosses every edge incident to p i k in G i−1 , but no other edges, and p i k remains bottom-visible. This drawing scheme continues until the last bundle line connects to p i 2 . Finally, we redraw the edges (p i k−1 , p i k ) for 3 ≤ k ≤ w; they exist by maximality. Both ends of any such edge are bottom-visible, so we can redraw it without crossing below the entire drawing, including the newly drawn edges from v i . We remove the previous drawings of these edges and retain bottom-visibility of the vertices in the current bag.
In the full paper [1, Appendix E] we analyze the number of crossings and obtain: Theorem 14. Let G be a maximal graph of pathwidth w ≥ 4. The described algorithm runs in linear time and finds a drawing of G with at most 2(w−1)(w−2)(2w−4)cr(G) ≤ 4w 3 cr(G) crossings. In particular, for any constant pathwidth w, we have an O(1)-approximation of the crossing number. The drawing is poly-line on a 4n × wn grid.

Conclusions and Open Questions
We have shown that the path decomposition of a graph can be used to efficiently compute or bound the crossing number of a graph. This is the first successful use of such graph decomposition for crossing numbers (besides the use of a tree decomposition in the special case that cr(G) is bounded by a constant [15,19]). Several interesting questions remain: Can we attain stronger approximation results for general pathwidth-3 graphs? The proven ratio of 2 may simply be due to a too weak lower bound, and we, in fact, do currently not know an instance where the algorithm does not obtain the optimum. Can we approximate cr(G) for arbitrary (not maximal) pathwidth-w-graphs? In [1] we only showed weak NP-completeness for the weighted crossing number version on pathwidth-restricted graphs. Can this be strengthened to unweighted graphs? Finally, there is of course the question whether we can use the stronger tool of tree decompositions, instead of path decompositions, to achieve crossing number results.
x 0 y 0 y 2 In this section, we prove the following: Theorem 15. The weighted and weighted rectilinear crossing number problems are weakly NP-hard already for (maximal) pathwidth-4 graphs that have non-weighted crossing number 1.
Our reduction is from Partition, defined as follows. Given n positive integers a 1 , . . . , a n with n i=1 = 2S, does there exist a J ⊂ {1, . . . , n} such that i∈J a i = S. Given a Partition instance I, define graph G as described in the proof sketch as a 2n+2-cycle Q and n chords e i = (x i , y i ) with weight a i for i = 1, . . . , n. We must show that I is a yes-instance if and only if G has a straight-line drawing D with wcr(D) ≤ S 2 − c, where c = 1 2 n i=1 a 2 i depends only on I. Assume first that there exists some J ⊂ {1, . . . , n} with i∈J a i = S. Figure 5 shows how to create a straight-line drawing of G: Place vertices x 1 , . . . , x n on the left legs of an X-shape, and vertices y 1 , . . . , y n on the right legs of the X, using the upper/lower leg depending on whether i ∈ J. With the help of x 0 and y 0 , the cycle can then be completed without crossing.
Consider a pair i, j with i ∈ J and j ∈ J. Then e i is drawn between the two upper legs of the X (hence inside Q) and while e j is drawn between the two lower legs of the X (hence outside Q), which means that they cannot cross. Also no edge of Q has a crossing. In consequence, the number of crossings is at most For the other direction, assume that we have a straight-line drawing D of G with wcr(D) ≤ S 2 − c. Since c > 0, no edge of Q can have a crossing. Define J to be the indices of all those edges e i that are drawn inside Q. Any two such edges must cross each other, since the order of their endpoints is interleaved on Q. Likewise, any two edges e i , e j with i, j ∈ Q must cross each other. In consequence, we have But we assumed wcr(D) ≤ S 2 − c, which implies d 2 = 0 = d and hence i∈J a i = S as desired.

B Proof of Theorem 5
We explain how to place points for the algorithm in Section 3 so that the resulting drawing has linear coordinates. This involves a paradigm-shift in explaining how the drawing is created. In Section 3, we added vertices from the point of view of adding cluster C i . This added half of the singletons near (x − i , x + i−1 ), and the other half near (x − i+1 , x + i ). We now change this around, and describe the algorithm in terms of all those singletons (coming from both C i and C i−1 ) that need to be added near one edge (x − i , x + i−1 ). Let there be s i such singletons (in terms of the notation of Section 3, we have s i = 2 (C i−1 ) − 1 + 1 (C i )).
We first explain how to place all anchor vertices and v 1 , v n . We first split the vertices except v 1 into three groups. We put v 2 in group G T ("top"), v 3 in G L ("(lower) left"), and v 4 in G R ("(lower) right"). For any edge (x − i , x + i−1 ), i ≥ 2, its incident vertices are in the same group. We now place the considered vertices as follows (see also Fig. 7) 1 : v 1 is placed at the origin. v 2 is placed at (0, 10n), i.e., on the vertical upward ray from v 1 . v 3 is placed at (−10n, −10n), i.e., on the diagonal downward-left ray from v 1 . v 4 is placed at (10n, −10n), i.e., on the diagonal downward-right ray from v 1 . Now, iteratively for i = 2, . . . , κ, consider edge (x − i , x + i−1 ). Vertex x − i has already been placed, while we do not have a placement for x + i−1 yet. If x − i ∈ G T , then place x + i−1 on the vertical ray upward from v 1 , and s i + 5 units higher than One immediately verifies that this placement gives a planar drawing of the graph induced by the so-far considered vertices: Any edge either lies on a ray or connects two different rays, and as we go along in age-order, the current anchor triangle always forms the outer-face and the next vertex is placed outside of it. We briefly analyze the size of this drawing:  Proof. Consider the topmost vertex above v 1 . In the worst case, all the vertices are placed above v 1 . Thus, the largest y-coordinate is at most 10n + (κ − 1)5 + (n − κ) < 15n, where n − κ is the upper bound on the number of all singletons. Similarly, any vertex on the other two rays has horizontal and vertical distance less than 10n + 4n from v 1 , and the claim follows.
Claim 17. Any edge (u, v) from the left-down ray to the right-down ray has slope in (− 1 5 , 1 5 ). Proof. We know that x(u) = y(u) = −10n − k for some 0 ≤ k < 4n, and y(v) = −x(v) = −10n − for some 0 ≤ < 4n. Assume ≤ k, i.e., the slope is non-negative (the other case is symmetric). The slope of the edge is hence Claim 18. Any edge (u, v) from the left-down ray to the vertical-up ray has slope in ( 10 7 , 2.9). Proof. We know that x(u) = y(u) = −10n − k for some 0 ≤ k < 4n, x(v) = 0, and y(v) = 10n + for some 0 ≤ < 5n. The slope of the edge is hence We must now add the points for singletons. Observe that any such vertex is placed "near" an edge (x − i , x + i−1 ) for some index i ≥ 2, and is then connected either to all of T (C i−1 ), or to all of T (C i ). We must hence argue that near any edge (x − i , x + i−1 ), we can find s i grid points, each of which allows straight lines to all of T (C i ) ∪ T (C i−1 ) while intersecting only edge (x − i , x + i−1 ). We distinguish cases depending on to which of the groups G T , G L , G R the two vertices x − i , x + i−1 belong. Case 1: x − i , x + i−1 ∈ G T : Let p, q be the two vertices in T (C i ) ∩ T (C i−1 ). They are not in G T , and on different rays, say p ∈ G L and q ∈ G R . From a point x, we can see the four vertices {p, q, x + i−1 , x − i } in the required way if x is within the triangle {p, x + i−1 , x − i } and above the extension of the edge (q, x − i ) into that triangle. Let P be the set of points that are one unit left of the drawing of (x − i , x + i−1 ), ends included. We have |P | = s i + 6 by our construction. Edge (p, x + i−1 ) has slope less than 2.9, so at most 3 points of P are above (p, x + i−1 ). Edge (p, x − i ) has positive slope, so all points of P are above (p, x − i ). Edge (q, x − i ) has slope more than −2.9 (by a symmetric argument), so at most 3 points of P are below the extension of (q, x − i ). This leaves at least s i points. We use the top points for the singletons of C i (i.e., connecting to x + i−1 ) and the bottom points for the singletons of C i−1 (i.e., connecting to x − i ). The total number of crossings created matches the number achieved in Section 3.
Case 2: is drawn with slope 1. Let p, q be the two vertices in T (C i ) ∩ T (C i−1 ), say p ∈ G T , and q ∈ G R .
Let P be the set of grid points that are one unit left of the drawing of (x − i , x + i−1 ) excluding the lowest such grid point. We have |P | = s i + 4 by construction. Edge (x + i−1 , p) has slope more than 10 7 , while the line from x + i−1 to the fourth point from the left of P has slope 4 3 < 10 7 , so at most 3 points of P are left of edge (x + i−1 , p). Edge (x − i , p) has slope > 1, so all points of P are left of (p, x − i ). Edge (q, x − i ) has slope less than 1 5 , while the line from x − i to the second point from the right of P has slope 1 2 , so only 1 point of P is above the extension of (q, x − i ). This leaves at least s i points in P that are inside the face and can see q while only crossing (x − i , x + i−1 ). We use the bottom points for single-cluster vertices of C i (i.e., connecting to x + i−1 ) and the top points for single-cluster vertices of C i−1 (i.e., connecting to x − i ). The total number of crossings created again matches the number achieved in Section 3.
All singletons are placed in an inner face of the drawing. The size of the drawing is thus determined by the coordinates of the vertices placed on the rays in the first step of the algorithm. This proves Theorem 5.

C Proof of Lemma 11
Let D be a drawing achieving cr(G), and let D i be the subdrawing of D corresponding to H i . Each of the latter gives rise to a planarly embedded graph L i of H i , where crossings in D i are substituted by degree-4 vertices. We call edges in L i subedges. We call a u-v-path in L i an i-path, and for each i = 1, 2, we choose an i-path P i . Let D + i ⊃ D i be a drawing of without (u, v) if it already existed) following the route of P 3−i ; we have cr(H + i ) ≤ cr(D + i ). Clearly, any crossing in any D + i has a counterpart in D. Inversely, any crossing in D can show up in at most one of D + 1 ,D + 2 , except for crossings between edges of P 1 and P 2 -so-called path-crossings. We show that for each crossing that we count in both D + 1 and D + 2 , there is at least one other crossing in D that is in neither D + 1 , D + 2 . We can assume that any choice of P 1 , P 2 gives path-crossings, as otherwise we would be done. Furthermore, for i = 1, 2, we can assume there are no two subedge-disjoint i-paths; otherwise, we can pick the one with fewer paths-crossings with P 3−i as P i and be done. Similarly, we can account for crossings on a subpath P i = (w → w ) ⊆ P i if there is another subedge-disjoint subpath connecting w to w in L i . Let F i ⊂ P i , i = 1, 2, be the subedges that are in every i-path. We only have to account for crossings between F 1 and F 2 .
Assume there is a path-crossing (e 1 , e 2 ), e i ∈ F i , even though we choose a crossing minimal insertion route for P 1 in L 2 . Therefore the ends of e 1 lie in different faces of the planar graph L 2 . In consequence e 2 lies on a cycle Q ∈ L 2 separating the ends of e 1 from each other. Let P 2 and P 2 be the subpaths after deleting e 2 from P 2 . The subgraph S = P 2 ∪ (Q \ {e 2 }) ∪ P 2 connects u to v in L 2 even though e 2 ∈ S-a contradiction to e 2 ∈ F 2 .

D Details for Theorem 13
It remains to argue how 2-connected components can be merged while maintaining straightline drawings. For this, we show that one vertex can be forced to appear at the outer-face.
Lemma 19. Let G be a graph with a path decomposition P of width 3, and let p be a vertex in bag X 1 . Then there exists a straight-line drawing of G with at most 2cr(G) crossings that has p on the convex hull.
Proof. Convert P into an alternating path decomposition; this can be done while keeping p in the first bag. We prove the claim by induction on the number of 2-connected components; in the base case (no cut-vertex) the claim holds by Lemma 12. If G has a cut-vertex v, then let G 1 , . . . , G k be the cut-components of v, named such that G 1 contains p. Recursively obtain a drawing D 1 of G 1 that has p on the convex hull, using the induced path decomposition.
Case 2: i ≤ k. All bags between X i and X k−1 contain all vertices χ. Consider a cluster C that uses the crossing, and let X h be the oldest bag of C. Since x 4 must belong to C, we have h ≥ i. We have two subcases: Assume first that h ≥ k. Then the size-w bag X k belongs to C. As argued above bag X k belongs to at most |X k | − 2 clusters, so there are at most |X k | − 2 = w − 2 cluster using the crossing with h ≥ k. Now assume that h < k, which by h ≥ i means that X h contains all of χ. Recall that the anchor-triangle T (C) is defined to be the three oldest vertices in X h . Since χ ⊆ X h and |T (C) ∩ χ| = 2, it follows that neither x 3 nor x 4 can be in T (C). Therefore at least one anchor-vertex of C is older than x 4 , which means that C starts to the left of X i . Also, the anchor-triangle of cluster C uses one of the w − 1 vertices in X i − {x 3 , x 4 }. We hence have at most w − 3 clusters C that fall into this case. Putting the two bounds together, we have at most 2w − 5 cliques that use a crossing.
We can show that this bound is tight. Figure 8 shows an example of a path decomposition of width w = 5 for which the vertex set χ = {4, 5, 8, 9} belongs to 5 = 2w − 5 clusters, all of which have exactly two vertices of χ in their anchor triangle. crossings. In any drawing of G, crossings are counted in at most µ bicliques, and also in G w+1 .