Ask Your Question
0

The function crossing_number runs too slowly?

asked 2022-08-31 03:28:51 +0200

licheng gravatar image

updated 2022-08-31 03:49:25 +0200

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 flag offensive close merge delete

Comments

2

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

David Coudert gravatar imageDavid Coudert ( 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.

licheng gravatar imagelicheng ( 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.

licheng gravatar imagelicheng ( 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.

John Palmieri gravatar imageJohn Palmieri ( 2022-08-31 18:14:49 +0200 )edit
1

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

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

1 Answer

Sort by » oldest newest most voted
1

answered 2022-08-31 22:34:46 +0200

tmonteil gravatar image

updated 2022-08-31 23:21:09 +0200

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-08-31 03:28:51 +0200

Seen: 147 times

Last updated: Aug 31 '22