On Sun, May 10, 2009 at 10:18 AM, Rado <rki...@gmail.com> wrote:
>
> I was playing with some big(10^6) graphs and noticed SAGE cannot
> handle constructing them in good time. However, networkx does just
> fine. Before I dive into the code, is this a feature (i.e. sage graph
> object has richer data and methods available) or this is a bug?
>
> sage: D={}
> sage: for i in xrange(10^3):
>    D[i]=[i+1,i-1]
> ....:
> sage: timeit('g=Graph(D)')
> 5 loops, best of 3: 2.05 s per loop
> sage: import networkx
> sage: timeit('g=networkx.XGraph(D)')
> 25 loops, best of 3: 21.9 ms per loop
>
> Rado

That's definitely a bug.  By the way, amusingly, you can do this to
very quickly get the Sage graph you want:

sage: time g=Graph(networkx.XGraph(D))
CPU times: user 0.04 s, sys: 0.00 s, total: 0.04 s
Wall time: 0.04 s

William

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to