Complexity of Geometric k-Planarity for Fixed k

The rectilinear local crossing number, lcr(G), of a graph G is the smallest k so that G has a straight-line drawing with at most k crossings along each edge. We show that deciding whether lcr(G) ≤ k for a fixed k is complete for the existential theory of the reals, ∃R.


Introduction
One of the oldest crossing number variants is the local crossing number, introduced by Kainen [14] in 1973. The local crossing number, lcr(D), of a drawing D of a graph G is the largest number of crossings along any edge in D. The local crossing number, lcr(G) of G is the smallest lcr(D) of any drawing D of G. Even older than the local crossing number is the rectilinear crossing number, introduced by Harary and Hill [10] in the early sixties. For the rectilinear crossing number, cr, drawings are restricted to be straight-line (rectilinear, geometric), every edge is drawn as a straightline segment. Both crossing numbers have received a fair amount of attention over the years, and were rediscovered many times, see [22].
Combining the definitions of lcr and cr, we obtain lcr(G), the rectilinear local crossing number of G. More formally, lcr(G) is the smallest lcr(D) for any straight-line drawing D of G. A graph with lcr(G) ≤ k is called geometric k-planar. 1 Our main result is that testing lcr(G) ≤ k is complete for the existential theory of the reals, even for a fixed value of k. Theorem 1 Deciding whether lcr(G) ≤ 867 is ∃R-complete.
Remark 2 (Existential Theory of the Reals) The existential theory of the reals is the set of all true existential statements over the real numbers; ∃R is the complexity class that captures the complexity of deciding truth in this theory (for definitions and some background see [21,24]; for an in-depth introduction, see [18]). This class tends to be relevant whenever real coordinates are needed; in the current example, the power of the existential theory of the reals allows us to place the vertices of G and verify that the local crossing number is at most k. Showing that a problem is ∃R-complete means, among other things, that there are instances of the problem which require double exponential real precision.
It is known that NP ⊆ ∃R ⊆ PSPACE, the first containment being easy, the second highly non-trivial and due to Canny [6]. Both containments are likely proper.
It is known that testing lcr(G) ≤ 1 is NP-complete [23], and we will show below that testing lcr(G) ≤ k is NP-hard for every fixed k ≥ 2. We do not know at what point the problem switches from being in NP to being ∃R-complete. It is not even clear whether lcr(G) ≤ 2 can be decided in NP: can the vertices of a drawing realizing lcr(D) ≤ 2 always be placed in a polynomial-size grid?
In comparison, the local crossing number lcr is much better understood; it has long been known that testing 1-planarity, that is lcr(G) ≤ 1, is NP-complete [9]. The notion of 1-planarity has been studied extensively from many possible aspects, see [15] for a survey. Only recently was it shown that testing lcr(G) ≤ k remains NP-complete for any k [26].

Context
The study of drawings with small, fixed crossing number parameters is a quickly growing area in graph drawing known as "beyond planarity", see [8] for a recent survey, or the book [12].
The rectilinear local crossing number has attracted some attention recently.Ábrego and Fernández-Merchant determined lcr(K n ) for all n [2], and for complete bipartite graphs we have lcr(K 3,n ) = (n − 2)/4 , lcr(K 4,n ) = (n − 2)/2 [1]. These are among the very few non-trivial examples we have for crossing numbers on infinite families of graphs. The result for lcr(K n ) is particularly unusual and pleasing when we compare it to the situation of cr(K n ): while good progress has been made for small values of n, up to the low thirties, we do not even have a conjecture for the exact value of cr(K n ). Moving from cr to lcr removes some of the complications faced in studying crossings in K n .
In that sense, the study of lcr helps us take a small step towards understanding cr, and showing that testing lcr(G) ≤ k is ∃R-hard for fixed k takes us a bit closer to answering an intriguing open question we have asked before: How hard it is to tell whether cr(G) ≤ k for fixed values of k? Up to k = 3 the problem is easy, since cr(G) = cr(G) as along as cr(G) ≤ 3 by a result of Bienstock and Dean [4]. It follows that testing whether cr(G) ≤ k is in P, for k ≤ 3. Already the case k = 4 is wide open, as far as we know. It is not known whether this problem is NP-hard, or lies in NP. Question 3 (Find the Drawing) Suppose we are given a graph G and a list L ⊆ E(G) 2 of pairs of edges of G with the promise that there is a straight-line drawing of G in which exactly the pairs of edges in L cross. How hard is it to find such a drawing? That is, how hard is it to determine the coordinates of the vertices? What if |L|, the size of L, is fixed? This is a promise problem; deciding whether a graph with a list L has a straight-line drawing in which exactly the pairs of edges in L cross, is ∃R-complete (even if G is a matching, this is the segment intersection graph problem [17]).
Another approach towards the rectilinear crossing number could be through ecr(G), the rectilinear edge crossing number of G, the smallest number of edges involved in crossings in any straight-line drawing of G. 2 As far as we know, the complexity of ecr, or ecr, for that matter is open, see [22] for references.

Bounded Rectilinear Local Crossing Number I
In Section 2.1 we create a gadget for the proof of Theorem 1; using this gadget, it is relatively easy to show that testing lcr(G) ≤ k is NP-hard, which we do in Section 2.2. We return to the proof of the main theorem in Section 3.

The Gadget N k
Our goal is to build a gadget N k which, in a straight-line drawing with local crossing number at most k ≥ 2, forces a chosen edge to be free of crossings. We start with a simple observation.
Lemma 1 Any straight-line drawing D of a K 2,(2k+1) with local crossing number at most k contains a crossing-free drawing of K 2, , for any k, ≥ 1.
Proof: Let A be the two vertices of degree (2k + 1) and B be the (2k + 1) vertices of degree 2 in K 2,(2k+1) . For any two distinct u, v ∈ B, the drawing D induces a C 4 on A ∪ {u, v}. Construct a graph H on vertex set B by adding an edge uv to H if the induced C 4 on A ∪ {u, v} has a self-crossing. For any u there can be at most 2k such vertices v, since D has local crossing number at most k (and u is incident to two edges in K 2,(2k+1) ). It follows that H has degree at most 2k, and therefore contains an independent set B ⊆ B of size at least (2k + 1) /(2k + 1) = . The K k, induced by A and B is free of crossings. 2 We can now build the gadget N k .
Lemma 2 For any k ≥ 2 we can build a graph N k with an edge uv so that N k has a drawing D realizing lcr(D) ≤ k with u and v on the outer face of D; such a D can be drawn inside any convex 4-gon that has uv as a diagonal. Moreover, in any drawing D of G realizing lcr(D) ≤ k, edge uv is involved in k crossings.
For the construction we extend a gadget that was introduced by Bienstock and Dean [4] to show that there are graphs with crossing number 4 and arbitrarily large rectilinear crossing number, also see [11].
Proof: Consider the gadget N k pictured in Figure 1; each heavy black edge is replaced with 52k 2 disjoint paths of length 2 (a K 2,52k 2 ).
Fix a straight-line drawing D of N k with lcr(D) ≤ k. We first claim that we can assume that each black edge is drawn as a crossing-free path of length 2. We know that each black edge corresponds to the drawing of a K 2,52k 2 . By Lemma 1, this drawing contains a K 2,14k+3 which is free of self-crossings ((2k + 1)(14k + 3) < 52k 2 ). This K 2,14k+3 partitions the plane into 14k + 3 regions between their endpoints xy. One of these regions contains the vertex u in its interior (unless u is x or y; in that case, we work with v; since there is no black edge between u and v this can always be done). Since each vertex in N k − {x, y} has distance at most 7 from u in follows that all vertices lie in regions which are at most 7k crossings away from that region, which implies that there is a region which contains no vertices and no edges (of D) in its interior. We can then draw the black as a path of length 2 in that region, crossing-free.
We can therefore assume that the black frame is drawn free of crossings (with each black edge a path of length 2). It follows that the cycle C on ua 2 b 2 c 2 vc 3 b 3 c 3 u is free of crossings, so the path c 2 d 1 c 3 must lie in the inner or outer face of C. If c 2 d 1 c 3 lies in the outer face of C, then the cycle ua 1 b 1 c 1 vc 4 b 4 c 4 u must lie in the inner face of C, which forces the four chords uc 2 , uc 3 , vb 2 , and vb 3 to lie in the outer face of C; that is not possible, since the crossing of uc 2 and vb 2 would be incident to the infinite face, which is not possible, since both edges are incident to edge uv.
The drawing is therefore essentially as shown in Figure 1. It follows that the paths c 2 d 1 c 3 and a 2 d i a 3 , 2 ≤ i ≤ k, cross uv, forcing k crossings with uv.
On the other hand, a drawing D as in the statement can clearly be realized as long as k ≥ 2 (this is not true for k = 1, since va 2 and va 3 are both involved in two crossings); we can move a 1 , c 1 and a 4 , c 4 close to uv so that all of N k is contained in the 4-gon ub 4 vb 1 , and we can then move b 1 and b 4 arbitrarily close to uv. 2

NP-Hardness of Geometric k-Planarity
As a warm-up for Theorem 1 we show NP-hardness of testing lcr(G) ≤ k.
Theorem 4 Testing whether lcr(G) ≤ k is NP-hard for any fixed k ≥ 2.
We mentioned that testing lcr(G) ≤ k is NP-complete [26], but it seems hard to build on that result to establish Theorem 4; instead we start with the NP-hardness of 1-planarity testing. This has been shown several times [3,9,5,16]; we need the strongest version.
Remark 6 For our proof 3-edge connectivity would be sufficient, and 3-edge connectivity can be obtained from any of the 1-planarity proofs directly: From a graph G construct G by replacing every edge of G with a diamond graph (a K 4 − e), with vertices of G identified with the degree-2 vertices of the diamond. Then G is 1-planar if and only if G is 1-planar, and G is 3-edge connected, as long as G is connected. Verifying that G being 1-planar implies G being 1-planar requires roughly ten different cases, so instead of lengthening the proof, we will work with the stronger Theorem 5 instead.
Proof of Theorem 4: We reduce from testing whether lcr(G) ≤ 1 is NP-complete. By Theorem 5 we can assume that we are given a 3-connected graph G.
Let G be the result of subdividing each edge of G twice, and let E 0 be the set of edges of G which are incident to original vertices of G, and let E 1 contain the remaining edges of G . If G has a straight-line drawing D with lcr(D) ≤ 1 and edges in E 0 are crossing-free, then lcr(G) ≤ 1 (we can simply suppress the added vertices). The reverse is also true (as we argued in [23, Theorem 3.3]): If G has a drawing with at most one crossing per edge, we can replace each crossing with a dummy vertex, and then apply Fary's theorem to get a plane straight-line drawing of the resulting graph. Each dummy vertex is incident to four edges; then there is a small disk-shaped neighborhood of the dummy vertex which only contains the dummy vertex and the ends of the four edges. Erase the disk, create four vertices along the boundary and connect them by line-segments, to get a straight-line drawing of G in which the edges of E 0 are free of crossings.
Using N k we can enforce that the edges in E 0 are free of crossings. We need to build an additional gadget to ensure that the edges in E 1 = E(G ) − E 0 cross at most one other edge in E 1 . Let uv ∈ E 1 be an edge for which we want to enforce that uv has at most crossing with an E 1 -edge in a straight-line drawing with local crossing number at most k. By construction, there is a w ∈ V (G) so that vw ∈ E 0 . We create two wheels W and W with outer cycles w 1 , . . . , w k+3 and w 1 , . . . , w k+3 on k + 3 vertices each. We identify w 1 = w = w 1 and w 2 = v = w 2 , and add edges w i w k+4−i , 3 ≤ i ≤ k + 1, as well as edge w 2 w k+1 . Identify each wheel edge with an N k -gadget. Call the resulting gadget the O k -gadget for uv. See Figure 2 for the intended straight-line drawing of the O k -gadget (note that the entire gadget can be made to lie arbitrarily close to vw).
Consider a straight-line drawing D of the O k -gadget with lcr(D) ≤ k. In D, all wheel edges are free of crossings. Each wheel is 3-connected, so has a unique embedding in the plane (up to an isomorphism); and neither wheel can lie in a triangular face of the other wheel without the added edges causing crossings with wheel edges. We can therefore assume that W and W lie on either side of vw as shown in Figure 2. The endpoints of all added edges alternate pairwise along the boundary of W and W , so every pair of added edges cross, implying that each such edge is involved in k − 1 crossings.
. . Figure 2: The gadget O k with edge uv involved in k − 1 crossings; heavy black edges belong to N k -gadgets.
As part of a drawing of G , we claim each of the w i w k+4−i -edges must cross uv. Suppose some w i w k+4−i -edge does not cross uv; it must then cross every path from u to w, except uvw. Since G is 3-connected, it is 3-edge connected, so, by Menger's theorem, contains three edge-disjoint paths from u to w, implying there are at least two such paths other than uvw. This forces at least two additional crossings for w i w k+4−i , which already had k − 1 crossings, making this impossible. We conclude that uv has k − 1 crossings with the added edges, implying it can have at most one more crossing.
Let G be the result of equipping G with N k -gadgets for edges in E 0 and O k -gadgets for edges in E 1 . By the argument we made above, in a straight-line drawing of G every E 0 -edge is free of crossings, and every edge in E 1 has at most one crossing with another edge in E 1 . After removing the gadget edges, and contracting edges in E 0 this gives us a drawing of G with at most one crossing per edge. 2

Bounded Rectilinear Local Crossing Number II
We already built the gadget N k , one of the main ingredients of the proof of the main theorem, in Section 2.1. Before we tackle the proof, we discuss pseudo-segment arrangements in Section 3.1, and study a puzzling issue we face in Section 3.2. Finally, Section 3.3 contains the proof of the main theorem.

Arrangements of Pseudo-Segments
For the ∃R-hardness proof we will work with arrangements of pseudo-segments; an arrangement of pseudo-segments is a collection of simple curves so that every pair of curves crosses at most once. We say an arrangement is stretchable, if it is isomorphic to an arrangement of straight-line segments; that is, if there is an isomorphism of the plane which turns every pseudo-segment into a straight-line segment. An arrangement is simple if no more than two pseudo-segments cross in each point. The stretchability of simple arrangements of pseudo-segments is ∃R-complete, since it is a special case of the stretchability problem for pseudolines, which was shown ∃R-complete by Mnëv [19]; also see Shor [25], Richter-Gebert [20], and Matoušek [18]. It was only recently shown, however, that the problem remains ∃R-complete if every pseudo-segment is involved in at most a finite number of crossings, and that is the version we will need for the main theorem.
Theorem 7 (Schaefer [24]) Stretchability of simple pseudo-segment arrangements is ∃R-complete, even if every pseudo-segment is involved in at most 72 crossings.

A Puzzle
Pseudo-segments are harder to control than pseudolines; here is one issue we will encounter in the proof: Consider the part of a pseudo-segment arrangement shown in the left of Figure 4. When drawing the arrangement, we make an unspoken assumption, namely that an intersection between two curves, in particular an angled one as seen in the figure, is a crossing. But what if it is not, and the two curves just touch at that point? Of course, we can exclude that possibility, but what happens if we do not? Then the left drawing in Figure 4 is ambiguous; apart from the intended interpretation (three crossings), we could also be looking at three touching points, as shown on the right. In this case, while there is still a pseudo-segment connecting a to a, the other pseudosegments will no longer connect the same endpoints. Here then is the puzzle: Is it possible to construct an arrangement of pseudo-segments which is ambiguous; that is, it can be interpreted in at least two different ways depending on how intersections are read, but the pairs of endpoints connected by the pseudo-segments remain the same? The possibility of the answer to this puzzle being yes throws a wrench into our intended construction for the ∃R-hardness proof. Fortunately, there is a simple device which allows us to side-step the issue, at the cost of increasing the number of crossings. Suppose we have available to us a special type of pseudo-segment which we can assume is drawn as intended (all its intersections are crossings), call them fixed. To an existing arrangement of pseudo-segments, we can add two fixed pseudo-segments close to each crossing, each of them crossing two existing pseudo-segments, so that the resulting arrangement has a unique interpretation as long as the fixed pseudo-segments are drawn as intended.
This is easy to see; consider again the left drawing in Figure 4. Consider the intersection between the two pseudo-segments which are not a. This intersection can, in principle, be resolved as ×, , or )(. Since the pseudo-segment a is fixed, and it cannot cross any other pseudo-segment twice, we cannot have . Similarly, adding a second pseudo-segment vertically intersection the two curves close to the intersection, excludes the possibility of resolving the intersection as )(. This only leaves ×, a crossing. This construction triples the number of crossings along each original pseudo-segment. Figure 5 shows the result of equipping all crossings of the pseudo-segment arrangement in Figure 3 with two fixed pseudo-segments.

Proof of Theorem 1
We reduce from simple pseudo-segment stretchability, so we are given a simple arrangement A of pseudo-segments. By Theorem 7 we can assume that each pseudo-segment is involved in at most 72 crossings; the arrangement is also (topologically) connected by the proof of Theorem 7; we can also assume that there are no pseudo-segments involved in a single crossings (they can always be removed and added back without affecting stretchability). We extend the arrangement with a set of fixed pseudo-segments, as described in Section 3.2 so that the resulting arrangement B is now unambiguous, as long as the fixed pseudo-segments are resolved the way they are intended. Each original pseudo-segment has at most 72 * 3 = 216 crossings in B. The fixed pseudo-segments are involved in two crossings each.
Let G be the dual graph of the arrangement B; that is, we place a vertex of G into each face of B, and draw an edge between two vertices, if their faces share a boundary (the two vertices need not be distinct). The result will be a plane multigraph, with loops for each end of a pseudo-segment, and, possibly, multiple edges.
We use G as a guide in equipping the pseudo-segment arrangement with a framework that encodes the topology of the arrangement; we build the framework in several steps.
First, we replace each edge of G by three parallel edges; each end of a pseudo-segment lies inside a loop at some (facial) vertex v; we turn the pseudo-segment into an edge, and attach it to v inside the loop. We then replace each vertex v with a wheel large enough so that the outer vertices of the wheel attach to the same ends of edges as v in the same order (read clockwise around the vertex and the wheel), and so that each outer vertex of the wheel is incident to exactly one such end. At this point, there are no more loops and parallel edges. Call the resulting (simple) graph F ⊗ (with ⊗ suggesting the wheels). Figure 6 shows an example of F ⊗ , except that we suppressed the fixed pseudo-segments to reduce the complexity of the drawing, so the figure shows F ⊗ for A rather than B.
Each outer vertex v of a wheel will later be assigned a number 0 ≤ c(v) ≤ k − 1. If c(v) ≥ 1, we modify the wheel as follows: Subdivide the edges to the left and right of v so as to create 2c(v) + 2 new vertices, s 1 , . . . , s v+1 , t 1 to the left of v, and t 2 , . . . , t v+1 to the right of v (in that clockwise order); add edge s i t i , for 1 ≤ i ≤ c(v) + 1, as well as spokes connecting the new vertices to the center of the wheel. We can route the s i t i edges close to the boundary of the wheel at v, so that they only cross each other, and, for i ≥ 2, the non-wheel edge incident to v, see Figure 7. Call the resulting graph F * (with * suggesting the pairwise crossing s i t i -edges).
We are nearly done. Subdivide each wheel edge 72n 2 B times, where n B is the number of pseudosegments in B, and add an N 867 -gadget to each subdivided wheel edge. Call this final graph F and the drawing we described D F .
To complete the construction, we need to define the parameters c(v). A pseudo-segment with c crossings in the arrangement B corresponds to an edge uv in D F with c(u) + c(v) + c + 3(c + 1) = c(u) + c(v) + 4c + 3 crossings. Since c ≤ 216, we can let c(u) = 867 − 4c and c(v) = 0, so that c(u) + c(v) + 4c + 3 = 867. An edge uv in F corresponding to an edge in G is involved in c(u) + c(v) + 1 crossings. We choose c(u) = 866 and c(v) = 0, so again we have that the edge is involved in c(u) + c(v) + 1 = 867 crossings. All other edges of F , which are either s i t i -edges, or belong to an N 867 -gadget, also satisfy the 867 bound, so that lcr(D F ) ≤ 867.
Consider the case that the pseudo-segment arrangement A is stretchable. Then so is B, and we can extend a straight-line drawing of B to a drawing of F ⊗ in which all wheel-edges are crossingfree (but not necessarily straight-line). In turn, we can extend this drawing to a drawing of F * in which the new s i t i -edges are straight-line, and the wheel edges remain crossing-free (but not straight-line). At this point, each wheel is a plane graph lying in a face bounded by (pieces) of Figure 6: A drawing of F ⊗ for A from Figure 3 (not, as it should be, B). Wheels are drawn as thick black lines, pseudo=segments as thin black lines, with the framework lines in gray. The outer wheel is shown without spokes and center.
straight-line segments, vertices, and intersection points; by Theorem 1 from [7], each wheel has a straight-line embedding after each of its edges is subdivided at most 72n 2 B times, where n B is the number of pseudo-segments in B. (So the boundary of the face has at most n B 2 +2n B ≤ n 2 B points, for n B ≥ 3.) Since the wheel edges remained crossing-free, we can now add N 867 -gadgets to each (subdivided) wheel edge, to obtain a straight-line drawing D of F which satisfies lcr(D) = 867.
For the other direction, assume we have a straight-line drawing D of F with lcr(D) ≤ 867. Then all N 867 -gadgets work, and all edges belonging to a (subdivided) wheel are free of crossings. Therefore, each wheel separates the plane into several triangular regions and a region bounded by the outer rim. No part of the graph can lie in a triangular region (since that would make it impossible to connect to the remaining vertices of the wheel), so the region bounded by the outer rim of the wheel can be assumed to only contain the spokes of the wheel. Note that one of the wheels may have its center vertex in its outer face, but only one wheel can do so.
Since a subdivision of a 3-connected graph has a unique embedding up to surface isomorphism, each wheel can, essentially, be embedded in one of two ways, depending on whether the wheel is embedded as intended, or has flipped (reversed orientation). We next show that the s i t i -edges work as intended. Let uv be an edge in F corresponding to an original edge in G. Then either c(u) = 866 or c(v) = 866, let us assume the later. We added vertices s 1 , . . . , s c(v)+1 , t 1 to the left, and t 2 , . . . , t c(v)+1 to the right of v. Since these edges are attached to the outer rim of a crossing-free wheel each pair must cross, so every s i t i -edge is involved in 866 crossings with the other s i t i -edges. We claim that each s i t i -edge with i ≥ 2 crosses uv: If one of them did not, it would have to cross the two edges in F which were parallel to uv in G, leading to 866 + 2 > 867 crossings per edge, which is not possible. We conclude that each s i t i -edge, for i ≥ 2 crosses uv, so uv is involved in 866 crossings (the s i t i edges are each involved in 867 crossings, except for s 1 t 1 which has 866 crossings). It follows that uv can have at most one more crossing (which will be with a pseudo-segment edge).
We next argue that all wheels are oriented the same way, as intended; suppose not, then there must be two adjacent vertices u and v in G so that the corresponding wheels have opposing orientation. The three parallel edges connecting u and v turn into three edges connecting the outer rims of two wheels. If the two wheels are not oriented the same way, then two of the edges must cross 3 This brings the total number of crossings for both of those edges to 867, which means they have no further crossings, forcing the third edge to take a different path to its endpoint. Since each facial boundary of B has length at least 3, the graph G is 3-edge connected. so the third edge must cross at least two edge-disjoint paths, which it cannot, since it already has 866 crossings. Hence, all wheels are oriented the same way, and the wheels with the connecting edges corresponding to G edges are laid out like G.
Consider an edge uv in F corresponding to a pseudo-segment. We can assume that c(u) = 0, and c(v) > 0. We claim that uv is involved in c(v) crossings with its corresponding s i t i -edges. Let s i t i , for i ≥ 2 be such an edge belonging to v. Then s i and t i lie on the boundary of the same wheel. Since v is an end of a pseudo-segment, there is a loop at v in G corresponding to that end, and that loop was replaced with three edges in F ⊗ . Among those three edges, let e be the closest to v on the boundary of the wheel, see Figure 7. Then s i and t i lie in the face bounded by the wheel and e, and are separated in that face by uv. If s i t i does not cross uv, it must cross e (the wheel-edges being crossing-free), and it would have to do so twice, to leave and to reenter the face. That is not possible in a straight-line drawing. We conclude that every s i t i , for i ≥ 2, crosses uv, leading to c(v) crossings along uv.
Suppose now uv is an edge of F corresponding to a fixed pseudo-segment. A fixed pseudosegment is involved in c = 2 crossings in B, so in this case c(u) = 0 and c(v) = 867 − 4 * 2 − 3 = 856. We just argued that uv is involved in c(v) crossings with s i t i edges already. This leaves at most 11 other crossings. This corresponds to crossing three facial boundaries (3 * 3) and two other pseudo-segments; any other routing would require crossing at least four facial boundaries, which