Ask Your Question
0

The function crossing_number runs too slowly?

asked 2 years ago

licheng gravatar image

updated 2 years ago

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?

Preview: (hide)

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 ( 2 years ago )

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 ( 2 years ago )

@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 ( 2 years ago )

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 ( 2 years ago )
1

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

tmonteil gravatar imagetmonteil ( 2 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 2 years ago

tmonteil gravatar image

updated 2 years ago

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

Preview: (hide)
link

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: 2 years ago

Seen: 256 times

Last updated: Aug 31 '22