Michael, check your email. Robert, I wish I could say I was doing research, but the truth is I was trying (successfully) to solve http://projecteuler.net/index.php?section=problems&id=215 or maybe http://projecteuler.net/index.php?section=problems&id=244. Both can be attacked by graph theory means.
Btw, I find project euler problems great "real world" benchmarks for SAGE, since we know all those problems are solvable within 1 min. in C. The competitive nature of the site makes people really optimise their code and all solutions are available in the forums. Thanks for the c_graph info, I will use it next time I need to deal with big graphs. Rado On May 18, 1:32 pm, Robert Miller <rlmills...@gmail.com> wrote: > Rado, > > First of all, thank you for your improvement! > > > I was playing with some big(10^6) graphs and noticed SAGE cannot > > handle constructing them in good time. > > I am wondering, what in particular you are using Sage graphs for? > Graphs in Sage are currently in a transition period. Some things are > incredibly fast (using no Python at all), and others are still very > slow. In particular, you might be able to use the faster "c_graph" > implementation of Sage graphs: > > sage: D={} > sage: for i in xrange(1,10^3): > D[i]=[i+1,i-1] > ....: > sage: g=Graph(D) > sage: def test(g): > for i in xrange(g.order()): > for j in xrange(g.order()): > _ = g.has_edge(i,j) > ....: > sage: time test(g) > CPU times: user 3.23 s, sys: 0.01 s, total: 3.24 s > Wall time: 3.25 s > sage: g=Graph(D,implementation='c_graph') > sage: time test(g) > CPU times: user 1.57 s, sys: 0.00 s, total: 1.57 s > Wall time: 1.58 s > > Note that the test would run vastly faster if the test function were > written in Cython. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---