Crossings in Grid Drawings

We prove crossing number inequalities for geometric graphs whose vertex sets are taken from a d-dimensional grid of volume N and give applications of these inequalities to counting the number of non-crossing geometric graphs that can be drawn on such grids. In particular, we show that any geometric graph with m>= 8N edges and with vertices on a 3D integer grid of volume N, has \Omega((m^2/n)\log(m/n)) crossings. In d-dimensions, with d>= 4, this bound becomes \Omega(m^2/n). We provide matching upper bounds for all d. Finally, for d>= 4 the upper bound implies that the maximum number of crossing-free geometric graphs with vertices on some d-dimensional grid of volume N is n^\Theta(n). In 3 dimensions it remains open to improve the trivial bounds, namely, the 2^\Omega(n) lower bound and the n^O(n) upper bound.


Introduction
The study of crossings in drawings of graphs has a long history. Euler's Formula states that the maximum number of edges in an n vertex planar graph-one that can be drawn in the plane without crossings-is 3n − 6. Using Euler's Formula and careful counting, Ajtai et al. [2] showed that any plane drawing of a graph with n vertices and m ≥ 4n edges has at least cm 3 /n 2 crossing pairs of edges, for some constant c ≥ 1/100. The same authors used this to prove their main result: The maximum number of planar graphs that can be embedded on any fixed set of n points is 2 O(n) .
The lower bound, cm 3 /n 2 , on the number of crossings in a plane drawing has since become known as "the Crossing Lemma" or "the Crossing Number Inequality" and has subsequently found many other applications. Székely [29] showed that this inequality can be used to give very simple proofs of many results in incidence geometry, including a proof of the Szemerédi-Trotter Theorem on point-line incidences [30]. Székely's method has since been used for many combinatorial geometry problems; the most famous of these applications is probably the result of Dey [11] on the maximum number k-sets of a point set.
Ajtai et al.'s proof of the Crossing Lemma uses the probabilistic method in the sense of Chvátal [9]: The proof works by summing the number of crossings in two different ways. More recently, a "from the book" proof of the Crossing Lemma that uses a more literal application of the probabilistic method to obtain a better constant, c ≥ 1/64, was discovered by Chazelle, Sharir, and Welzl (See Aigner and Ziegler [1, Chapter 30, Theorem 4]). Pushing this argument even further, Pach et al. [22] currently hold the record for the largest constant, c ≥ 1/33.75.
The main result of Ajtai et al.-that the maximum number of crossing-free graphs that can be drawn on any point set of size n is 2 O(n) -has also been the starting point for many research problems. The original bound, which was O(10 13n ), has been improved repeatedly to the current record of O(187.53 n ) [25]. The result has also been tightened for special classes of crossing-free graphs including triangulations (O(30 n )) [24], spanning cycles (O(54.55 n )) [26], perfect matchings (O(10.05 n )) [27], spanning trees (O(141.07 n )) [18], and cycle free graphs (O(160.55 n )) [18,24]. A webpage containing an up-to-date compendium of these types of results is maintained by the third author [28].

Geometric Grid Graphs
Thus motivated by the importance of Ajtai et al.'s results, the goal of the present paper is to extend their results to graph drawings in higher dimensions. In particular, we extend their results to graphs drawn on grids. For any positive integers X 1 , . . . , X d , the d-dimensional X 1 × · · · × X d grid is a finite subset of the d-dimensional natural lattice, N d , given by The volume of the X 1 × · · · × X d grid is d i=1 X i , i.e,. the number of points in the grid. A (d-D) geometric (grid) graph, G, is a graph with vertex set V (G) ⊆ N d . Throughout this paper, for two vertices u and w in a geometric graph, G, we will use the notation uw to refer both to the open line segment with endpoints u and w and to the edge uw ∈ E(G), if present. The volume, vol(G), of G is the volume of the minimal X 1 × · · · × X d grid that contains V (G).
A geometric grid graph, G, is proper if, for every edge uw ∈ E(G), and every vertex x ∈ V (G), we have that x uw. That is, G is proper if no edge passes through a vertex. For the remainder of this paper, all geometric grid graphs we refer to are proper. From this point onwards, the phrase "geometric grid graph" should be interpreted as "proper geometric grid graph." Two edges uw and xy in a geometric grid graph cross if they have a point in common. When this happens, we say that uw and xy form a crossing. We define cr(G) as the number of crossings in G. 1 We say that G is crossing-free if cr(G) = 0. Finally, we define That is, cr d (N , m) is the minimum number of crossings in any d-D geometric grid graph with m edges and volume no more than N .
We are also interested in the maximum number, ncs d (N ), of crossing-free d-D geometric grid graphs that can be drawn on any particular grid of volume at most N . That is, Results on plane drawings of graphs have immediate implications for cr 2 (N , m) and ncs 2 (N ): Bose et al. [5] show that the maximum number of edges in a crossing-free d-D geometric grid graph of volume N is at most (2 d −1)N −Θ(N (d−1)/d ). This result is analogous to Euler's Formula in the sense that it shows that such graphs have a linear number of edges. It also implies, for example, that cr d (N , (2 d − 1)N ) ≥ 1. Since Euler's Formula is the main property of planar graphs used by Ajtai et al. to prove their results, it seems reasonable that bounds similar to those of Ajtai et al. should hold for d-D geometric grid graphs.
The key difference, however, is that unlike Euler's formula, the bound of Bose et al. depends on the volume, N , of the grid and not on the number, n, of vertices in the graph. For d ≥ 3 it is not possible to obtain non-trivial bounds on crossings that depend only on the number of edges and vertices. For example, there exists a crossing-free 3-D geometric grid graph of volume N that has n = N 1/3 vertices and m = n 2 edges [10].

New Results
In the current paper, we study cr d (N , m) and ncs d (N ) for d ≥ 3 and prove the results shown in Table 1. In Table 1, and throughout this paper, we assume that d is a constant that is independent of N and m, so that the O, o, Ω, ω, and Θ notations hide factors that depend only on d.
Our results show that the situation in three and higher dimensions is significantly different than in two dimensions. For all d ≥ 4, and m ≥ 2 d N , cr d (N , m) ∈ Θ(m 2 /N ) and even cr 3 (N , m) is only Θ((m 2 /N ) log(m/N )). There are therefore geometric grid graphs with Ω(N 2 ) edges that have only O(N 3 ) crossings (O(N 3 log N ) crossings in 3-d). In contrast, in 2 dimensions, any graph with n vertices and Ω(n 2 ) edges has Ω(n 4 ) crossings.
For d ≥ 4, the bounds on cr d (N , m) are strong enough to show that ncs d (N ) ∈ 2 Θ(N log N ) . Thus, the number, 2 Θ(N log N ) , of crossing-free graphs whose vertex set comes from a specific d-dimensional grid having N points is much larger than the number, 2 Θ(N ) , of crossing-free graphs that can be drawn on any planar point set of size N .

Related Work
The study of crossing-free 3-D geometric grid graphs is an active area in the field of graph drawing. A d-D grid drawing of a graph, G, is a one-to-one mapping ϕ : V (G) → N d . Any drawing, ϕ, yields a geometric grid graph, ϕ(G), with vertex set V (ϕ(G)) = {ϕ(u) : u ∈ V } and edge set E(ϕ(G)) = {ϕ(u)ϕ(w) : uw ∈ E(G)}. The drawing ϕ is crossing-free if the geometric grid graph ϕ(G) is crossing-free and the volume of ϕ is the volume of ϕ(G).
The work most closely related to the current work, in that it presents an extremal result relating crossings, volume, and number of edges, is that of Bose et al. [5], who show that the maximum number of edges in a crossing-free d-D geometric grid graph, G, with We state this here as lemma since we make use of it several times.
Lemma 1 immediately yields the upper-bound ncs d (N ) ∈ 2 O(N log N ) (see the beginning of Section 4). It also yields the lower-bound cr d (m) ≥ m−(2 d −1)N since, if a geometric grid graph G has m ≥ 2 d−1 N we can remove an edge an edge from G that eliminates at least one crossing. Since this can be repeated until G has m ≤ 2 d−1 N edges, this implies that G has at least m − (2 d − 1)N crossings.
Finally, we note that Bukh and Hubard [7] have defined a form of crossing number for 3-dimensional geometric graphs that are not necessarily grid graphs. In their definition, a 4-tuple of vertex-disjoint edges form a space crossing if there is a line that intersects every edge in the 4-tuple. The space crossing number, cr 4 (G), of a 3-d geometric graph, G, is the number of space crossings formed by G's edges. They show that a 3-d geometric graph G with n vertices and m ≥ 4 41 n edges has a space crossing number cr 4 (G) ∈ Ω(m 6 /(n 4 log 2 n)). An easy lifting argument shows that this bound on the space crossing number almost implies the Crossing Lemma; specifically, it shows that the number of crossings in a graph with m vertices and n edges drawn in the plane is Ω(m 3 /(n 2 log n)).

3-Dimensional Geometric Grid Graphs
In this section, we present upper and lower bounds on cr 3 (N , m). Here, and in the remainder of the paper we use the notation u i , i ∈ {1, . . . , d}, to denote the ith coordinate of the d-dimensional point u. Thus for a point u ∈ R 3 , u 1 , u 2 , and u 3 are u's x-, y-, and z-coordinates, respectively.

The Lower Bound
Proof. Let G be any geometric grid graph with V (G) ⊆ N(X, Y , Z), with XY Z ≤ N , and |E(G)| = m. (That is, G is a 3-D geometric grid graph with m edges and volume at most N .) We may assume, without loss of generality, that no edge of G contains any point of the X × Y × Z grid in its interior; any such edge can be replaced with a shorter edge without introducing any additional crossings and without changing m or N . This assumption is subtle, but important, and is equivalent to assuming that, for every edge uw of G, gcd(u 1 − w 1 , u 2 − w 2 , u 3 − w 3 ) = 1.  Figure 1: A 2-dimensional piece of the essential 6-grid. Removing the 1-grid, 2-grid, and 3-grid from the 6-grid leaves the essential 6-grid.
For any integer, p ≥ 1, define the X × Y × Z p-grid as the set of points which we denote by N(pX, pY , pZ)/p. Observe that the size of the p-grid is at most N p 3 .
In order to avoid double-counting later on, we need to define a sequence of point sets that are disjoint. To achieve this, we define the essential p-grid as follows: If p is a prime number, then the essential p-grid is the p-grid minus the 1-grid. Otherwise (p is composite), let p 1 , . . . , p k be the primes in the prime factorization of p. We begin with the points of the p-grid and then remove all points that are contained in the p i -grid, for each i ∈ {1, . . . , k}. What remains is the essential p-grid. (See Figure 1 for a 2-dimensional illustration.) Observe that the essential p-grid and the essential q-grid have no points in common for any p q.
Next, observe that each edge uw of G contains the p-grid points and the essential p-grid points The fact that Q p uw contains only essential p-grid points follows from the assumption that gcd(u 1 − w 1 , u 2 − w 2 , u 3 − w 3 ) = 1. More specifically, the points in Q p uw are clearly on the p-grid, so the only concern is that some of these points are on the q-grid for some q < p. To see why this is not possible, observe that, if some point in Q p uw were on the q-grid, for some q < p, this would imply that , and c such that gcd(i, p) = 1 and gcd(x, y, z) = 1. Rewriting this gives (x, y, z) = (pa/(iq), pb/(iq), pc/(iq)) . ( Each value on the right hand side has a factor of p in the numerator, so they must also have a factor of p in the denominator, iq. Otherwise, gcd(pa/(iq), pb/(iq), pc/(iq)) > 1 = gcd(x, y, z). But this is not possible since gcd(i, p) = 1 and q < p, so gcd(iq, p) ≤ q < p.
The size of the set Q p uw is a well-studied quantity and is given by the Euler totient function ϕ(p) = p q|p (1 − 1/q) [17,Section 5.5]. Therefore, the total number of incidences between points of the essential p-grid and edges of G is at least m · ϕ(p). In understanding the calculations that follow, it is helpful to pretend that ϕ(p) ≥ cp for some constant 0 < c < 1, though this is not strictly correct since, for some p, ϕ(p) ∈ O(p/ log log p).
Let x 1 , . . . , x denote the essential p-grid points that are incident on at least one edge and let R i , i ∈ {1, . . . , }, denote the number of edges incident to x i . Observe, then, that there are R i 2 crossing pairs of edges that cross at x i . From the preceding discussion, we have i=1 R i ≥ m · ϕ(p). Therefore, the total contribution of crossings that occur on the essential p-grid to cr 3 The first inequality is an application of Jensen's Inequality to the function Summing over p we obtain: = Ω(m 2 /N ) log(m/N ) .
On the other hand, ϕ(i) < i, so We can now justify the step from (3) to (4) as follows: (5) and (6)

The Upper Bound
In this section, we prove the following result:  Proof of Lemma 2. The drawing of K k 2 ,k 2 is the obvious one; each point of the k × k × 2 grid with z-coordinate 1 is connected by an edge to every point with z-coordinate 2. We denote the resulting geometric graph by G k 2 .
We start by considering some edge uw with u 3 = 1 (so w 3 = 2) and counting the number of edges that intersect uw. Let π 1 , π 2 , . . . be the planes that contain uw and at least one additional vertex. Observe that each plane π j contains, and is uniquely determined by, a line in the plane {z ∈ R 3 : z 3 = 1} that contains u and some vertex, x, and such that ux does not contain any other point of Z 3 i.e., gcd(u 1 − x 1 , u 2 − x 2 ) = 1 (see Figure 2). Define the skip of π j as skip(π j ) = max{|u 1 Observe that, if skip(π j ) = r, then π j contains at most 2k/r vertices of G other than u and w and therefore contains at most (k/r) 2 edges that cross uw. Furthermore, the number of planes π j such that skip(π j ) = r is at most 4r since each such plane is defined by two antipodal lattice points on the boundary of a square of side length 2r centered at u; see Figure 3. Therefore, the total number of edges that cross uw is at most Since this is true for each of the k 4 edges, uw, we conclude that the total number of crossings in G k 2 is at most 2k 6 ln k + O(k 6 ) ∈ O(k 6 log k), as required.

Higher Dimensions
Next, we prove matching upper and lower bounds on cr d (N , m) for d ≥ 4. u Figure 3: Each plane π j with skip(π j ) = r is defined by two antipodal lattice points on the boundary of a square of side length 2r that is centered at u.

The Lower Bound
Proof. Let G be any geometric grid graph with m edges whose vertex set is contained in the X 1 × · · · × X d grid of volume at most N . Note that, for each edge uw ∈ E(G), the midpoint (u + w)/2 of uw is contained in the X 1 × · · · × X d essential 2-grid: This 2-grid contains K ≤ (2 d − 1)N points. Let R i be the number of edges of G whose midpoint is the ith point of this 2-grid. Then the number of crossings in G is Proof. Let = k d−1 for some integer k. As in the proof of Theorem 2, it suffices to show that one can draw the complete bipartite graph K , on the k × · · · × k × 2 grid so that it has

The Upper Bound
The remainder of this proof has the same structure as the proof of Lemma 2. The drawing of K , we use is the graph G with V (G) = N(k, . . . , k, 2) and Consider some edge uw of G with u d = 1 and w d = 2. Our strategy is to upper bound the number of edges that cross uw. Any edge xy that crosses uw is contained in some plane, π, that contains uw and xy. Without loss of generality, assume x d = 1. Let x be some point of the integer lattice Z d that is on the line containing ux and such that ux The plane π that contains uw and xy can be expressed as Restricted to the subspace S u = {z ∈ R d : z d = 1}, π becomes a line Similarly, restricted to the subspace S w = {z ∈ R d : z d = 2}, π becomes the parallel line: Observe that, since there is no point on the segment ux , the only points of the integer lattice Z d contained in L u are obtained when the parameter s is an integer: and, similarly, If we define r = max{|x i − u i | : i ∈ {1, . . . , d − 1}}, then we see that the number of vertices of G, other than u and w, intersected by each of L u and L w is at most k/r (since G's vertices are contained in a box whose longest side has length k). In this case, we define the skip of the plane π to be r.
Now, consider all the planes that contain uw and some other vertex of G. We wish to determine the number of such planes with skip r. Each such plane is defined by two antipodal grid points on the boundary of a (d − 1)-hypercube of side length 2r, centered at u, that is contained in the (d − 1)-dimensional subspace {z ∈ R d : z d = 1}. This hypercube has 2(d − 1) facets and each facet contains (2r + 1) d−2 grid points. Therefore, the total number of planes with skip r is at most Each plane with skip r contains at most (k/r) 2 edges that cross uw. Therefore, the number, X uw , of edges that cross uw is at most Since there are 2 edges, the total number of crossings is therefore O( 3 ), as required.

The Number of Non-Crossing Graphs
In this section, we show that, for dimensions d ≥ 4, ncs d (N ) ∈ 2 Θ (N log N ) , i.e., the maximum number of crossing-free graphs that can be drawn on any grid of volume N is 2 Θ (N log N ) .
The upper bound follows easily from Lemma 1 which states that any crossing-free d-D geometric grid graph of volume N has at most (2 d − 1)N edges. Therefore, any such graph corresponds to one of the ways of choosing at most (2 d − 1)N edges from among the at most N 2 possible edges. Therefore, the number of such graphs is at most The preceding argument is standard and is used, for example, by Bárat et al. [3,Lemma 4] for upper-bounding the maximum number of crossing-free plane graphs with m edges that can be drawn on any particular set of n points in the plane.
Next we show that the number of crossing-free geometric graphs that can be drawn on the N 1/(d−1) × · · · × N 1/(d−1) × 2 grid is at least 2 Ω (N log N ) .
Proof. Let G N denote the complete bipartite geometric graph described in the proof of Theorem 4 with the value = N /2 (assuming, only for simplicity, that (N /2) 1/(d−1) is an integer). For a geometric graph, G, let ncs(G) denote the number of crossing-free subgraphs of G and define f (m) = min{ncs(G) : G is a subgraph of G N having m edges} .
Our goal is to lower-bound f (N 2 ). In order to do this, we establish a recurrence inequality and base cases.  − cN ) subgraphs of G that include e. Therefore, for m ≥ cN . Repeatedly expanding the first term gives: for m ≥ 2cN .
For an integer t, we can iterate (8) t times to obtain for m ≥ 2ctN . Taking m = N 2 , (9) becomes for t ≤ N /(2c). Taking t = N /(2c) then yields the desired result: We remark that the proof of Theorem 5 also works to lower-bound the number of crossing-free matchings in G N . When one selects an edge uw to be part of the matching one has to discard the at most cN edges of G N that intersect uw as well as the 2N − 1 edges that have u or w as an endpoint. Thus, one discards at most (c + 2)N edges and the remainder of the proof goes through unmodified. From Corollary 1, we can derive a lower-bound on the number of crossing-free spanning trees of the k × · · · × k × 2 grid: Thus, for each of the 2 Ω(N log N ) matchings, M, there exists a spanning tree T M that contains M. Any spanning tree with N vertices contains no more than 2 N −1 matchings and therefore, there are at least 2 Ω(N log N ) /2 N −1 ∈ 2 Ω(N log N ) crossing-free spanning trees with vertex set N(k, . . . , k, 2).
We finish this section by observing that our lower bounds are not just for "flat" grids like the k × · · · × k × 2 grid. They hold also for the "square" k × · · · × k grid. Proof. Observe that the k × · · · × k grid is made up of k layers, each of which is a k × · · · × k × 1 grid. Between any consecutive pair of these layers there are, by Corollary 1, 2 Ω(k d−1 log k) crossing-free matchings that contain only edges that span both layers. Since there are k − 1 consecutive pairs of layers, there are therefore crossing-frees graphs whose vertex set is the k × · · · × k grid.
Note that the graphs we obtain in the preceding manner contain no cycles. Therefore, to obtain a lower-bound of 2 Ω(N log N ) on the number of spanning trees we can augment any of these graphs into a crossing-free spanning tree as is done in the proof of Corollary 2.
To obtain a lower-bound on the number of matchings we can simply count the matchings that only include edges from layer i to layer i + 1 with i ≡ 1 (mod 2). There are such matchings.

Summary and Remarks
We have given matching upper and lower bounds on the minimum number of crossings in d-D geometric grid graphs with m edges and volume at most N . The upper-bound cr d (N , m) ∈ O(m 2 /N ), for d ≥ 4, allows the application of a recursive counting technique to show the lower-bound ncs d (N ) ∈ 2 Ω(N log N ) ; this is similar to way in which Ajtai et al. used the lower-bound cr(n, m) ∈ Ω(m 3 /n 2 ) to show that that the maximum number of planar graphs that can be drawn on any point set of size n is 2 O(n) . This 2 Ω(N log N ) lower-bound also holds if we restrict the graphs to be spanning trees or matchings, but we know very little about spanning cycles: Open Problem 1. Determine the maximum number of crossing-free spanning cycles whose vertex set is a grid of volume N .
In what appears to be a remarkably unfortunate coincidence, the tight bound cr 3 (N , m) ∈ Θ((m 2 /N ) log(m/N )) does not allow for the application of a recursive counting technique to determine any non-trivial bound on ncs 3 (N ). If the upper-bound were slightly stronger, say then this would be sufficient to prove that ncs 3 (N ) ∈ 2 Ω(N log ε N ) . In contrast, if the lowerbound were slightly stronger, say cr 3 (N , m) ∈ Ω((m 2 /N ) log 1+ε (m/N )) , then this would be sufficient to prove that ncs 3 (N ) ∈ 2 O(N log 1−ε N ) .
Open Problem 2 was communicated to the first author by David R. Wood. His motivation for asking this question comes from a question of Pach et al. [23], who ask "Does every graph with n vertices and maximum degree three have a crossing-free 3-D grid drawing of volume O(n)?" This question remains unresolved, even when the maximum degree three condition is relaxed to maximum degree O(1). there are more labelled n-vertex graphs of maximum degree three than there are labelled 3-D geometric grid graphs of volume cn for any constant c. This type of counting argument has been used successfully to answer similar questions about geometric thickness [3], distinct distances [8], slope number [21], book thickness [20], and queue number [20,31].

If Open
Another approach to resolving the question of Pach et al. is to consider that there are maximum degree 3 graphs that have some properties that would seem to rule out a linear volume embedding. An obvious candidate property is that of being an expander: There exist graphs, G, with maximum degree O(1) and such that, for any subset S ⊆ V (G), |S| ≤ n/2 the number of vertices of V (G) \ S adjacent to at least one vertex in S is at least |S|, for some constant > 0.
Expanders have no separator of size o(n) and are therefore non-planar [19]. However, very recently Bourgain and Yehudayoff [6] have shown that there exist bounded degree graphs that are expanders and that have constant queue number. Through a result of Dujmović et al. [13,Theorem 8], this implies that there are constant degree expanders that can be drawn on a 3-dimensional grid with volume O(n). Thus, the property of expansion is not sufficient to rule out linear volume 3-D grid drawings. We are still no closer to solving Pach et al.'s 14 year old problem: Open Problem 3 (Pach et al. 1999). Does every graph with n vertices and maximum degree three have a crossing-free 3-D grid drawing of volume O(n)?