The function crossing_number runs too slowly?

In graph theory, the crossing number cr(G) of a graph G is the lowest number of edge crossings of a plane drawing of the graph G. In general, determining the crossing number of a graph is hard. However, for graphs with a small number of vertices and a small number of edges, some efficient procedures exist to compute them.

The exact and non-heuristic programs that I know of are the following:

• sagemath
• web crossing number (http://crossings.uos.de/) #Recent login is not available, the website may be under maintenance, or maybe not to provide services in the future.
• OGDF (that is a self-contained C++ library for graph algorithms, in particular for (but not restricted to) automatic graph drawing.)

I see an example of mathoverflow from 10 years ago, which is to compute the cross number of the Grötzsch graph.

Jamie J. Taylor says in the answer that OGDF can be used. But we don't see the corresponding code. I know that Sagemath has the crossing_number, Unfortunately, it may be too slow.

G = graphs.GrotzschGraph()
G.crossing_number()


It took me about 12 hours, and I haven't gotten a result yet. Perhaps there is some way to improve it?

edit retag close merge delete

2

Indeed, we only have a slow brute force implementation. Help implementing a faster algorithm is more than welcome.

( 2022-08-31 10:44:58 +0200 )edit

Thanks! Maybe it's because the program was interrupted on my computer. I recomputed it, and it took me about three hours and sagemath gives me the correct result "5". As for any improvement, it should be something we love.

( 2022-08-31 12:39:20 +0200 )edit

@David Coudert A drawing D is optimal if it realizes cr(D) = cr(G). Another interesting question is, can the crossing_number or other function give an optimal drawing of G.

( 2022-08-31 14:24:28 +0200 )edit

What precisely is the question here? Comments about possible ways to improve Sage are welcome, but I don't see a question.

( 2022-08-31 18:14:49 +0200 )edit
1

I guess the question is how to improve the situation (see the last sentence).

( 2022-08-31 22:36:12 +0200 )edit

Sort by » oldest newest most voted

If OGDF is fast enough for your needs, since it is free software (GPL), it might be worth interfacing it with Sage. You can have a look at https://doc.sagemath.org/html/en/them...

EDIT: there even seems to be Python bindings : https://github.com/n-coder/ogdf-python

more