Counting the number of crossings in geometric graphs

https://doi.org/10.1016/j.ipl.2020.106028Get rights and content

Highlights

  • An algorithm for computing the number of pairs of edges that cross in a geometric graph.

  • Much faster than using the current state of the art algorithms for counting segment intersection.

  • Easy to implement.

Abstract

A geometric graph is a graph whose vertices are points in general position in the plane and its edges are straight line segments joining these points. In this paper we give an O(n2logn) time algorithm to compute the number of pairs of edges that cross in a geometric graph on n vertices. For layered graphs and convex geometric graphs the algorithm takes O(n2) time.

Introduction

A geometric graph is a graph whose vertices are points in general position in the plane; and its edges are straight line segments joining these points. A pair of edges of a geometric graph cross if they intersect in their interior; the number of crossings of a geometric graph is the number of pairs of its edges that cross. Let G:=(V,E) be a geometric graph on n vertices; and let H be a graph. If G and H are isomorphic as graphs then we say that G is a rectilinear drawing of H. The rectilinear crossing number of H is the minimum number of crossings that appear in all of its rectilinear drawings. We abuse notation and use cr(H) and cr(G) to denote the rectilinear crossing number of H and the number of crossings of G, respectively.

Computing the rectilinear crossing number of the complete graph Kn on n vertices is an important and well known problem in Combinatorial Geometry. The current best bounds on cr(Kn) are0.379972(n4)<cr(Kn)<0.380473(n4)+Θ(n3). The lower bound is due to Ábrego, Fernández-Merchant, Leaños and Salazar [1]. The upper bound is due to Fabila-Monroy and López [6]. In an upcoming paper, Aichholzer, Duque, Fabila-Monroy, García-Quintero and Hidalgo-Toscano [2] have further improved the upper bound tocr(Kn)<0.3804491(n4)+Θ(n3). For more information on crossing numbers (rectilinear or other variants) we recommend the survey by Schaefer [8].

A notable property of the improvements of [6], [2] on the upper bound of cr(Kn) is that they rely on finding rectilinear drawings of Kn with few crossings, for some specific values of n; this is done via heuristics that take a rectilinear drawing of Kn and move its vertices in various ways with the aim of decreasing the number of crossings. In this approach it is instrumental that the computation of the number of crossings is done as fast as possible. In this paper we present an algorithm to compute cr(G) in O(n2logn) time. We hope that our algorithm will pave the way for finding new upper bounds on the rectilinear crossing number of various classes of graphs.

The current best algorithm for counting the number of intersections among a set of m line segments in the plane runs in O(m4/3log1/3m) time; it was given by Chazelle [4]. This provides an O(|E|4/3log1/3|E|) time algorithm for computing cr(G); this running time can be as high as Θ(n8/3log1/3n) when G has a quadratic number of edges. The running time can be improved for some classes of geometric graphs: when G is a complete geometric graph, Rote, Woeginger, Zhu, and Wang [7] give an O(n2) time algorithm for computing cr(G); and Waddle and Malhotra [9] give an O(|E|log|E|) algorithm for computing cr(G) when G is a bilayered graph. For layered graphs and convex geometric graphs a slight modification of our algorithm runs in O(n2) time.

Section snippets

The algorithm

In what follows let G:=(V,E) be a geometric graph on n vertices. We make some general position assumptions: no two vertices of G have the same x-coordinate nor the same y-coordinate; and no two edges of G are parallel. In [6], the authors give an O(n2) time algorithm for computing cr(G) when G is a complete geometric graph; the authors define “patterns” on the set of vertices of G; these patterns can be computed in O(n2) time and cr(G) depends on the number of these patterns. We follow a

Faster algorithms for special classes of graphs

Of the four steps of our algorithm, only Step 3 takes superquadratic time. Moreover, the numbers |uE| and |uE| are only used as a starting point for computing A(u,v) and B(u,v) in Lemma 5. If we can compute in O(n) time, for each vertex u of G, the number of edges of G that cross two open rays with apex u and in parallel but opposite directions then we can compute cr(G) in O(n2) time. We pose the following conjecture.

Conjecture 1

For every geometric graph G on n vertices, cr(G) can be computed in O(n2

Declaration of Competing Interest

I hereby declare that neither I, nor my coauthors, have a conflict of interests regarding the reviewing and publication of the manuscript “Counting the Number of Crossings in Geometric Graphs” by Frank Duque, César Hernández-Vélez, Carlo Hidalgo-Toscano and myself.

Acknowledgements

This work was initiated at the 2nd Reunion of Optimization, Mathematics, and Algorithms (ROMA 2018), held in Mexico city, 2018. We thank the anonymous reviewer whose comments substantially improved the presentation of this paper.

References (9)

There are more references available in the full text version of this article.

Cited by (0)

Image 1
This project has received funding from the European Union's Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No. 734922.

1

Partially supported by FORDECYT 265667 (Mexico).

2

Partially supported by Conacyt of Mexico grant 253261.

View full text