Ahahaaha. Well, I wrote what I thought would be a "good if hard to read
implementation", and it turns out to be... slower O_O

I still do not really understand why, except that copying the graph takes
time, too. For some reason.

The code is slower in interesting case, and faster in stupid cases :

sage: from sage.graphs.base.static_sparse_graph import girth


sage: g = graphs.CubeGraph(12)


sage: %time g.girth()
CPU times: user 1.03 s, sys: 0.00 s, total: 1.03 s
Wall time: 1.04 s
4
sage: %time girth(g)
CPU times: user 2.70 s, sys: 0.00 s, total: 2.70 s
Wall time: 2.70 s
4
sage: g = graphs.CycleGraph(1000)
sage: %time g.girth()
CPU times: user 5.31 s, sys: 0.00 s, total: 5.31 s
Wall time: 5.32 s
1000
sage: %time girth(g)
CPU times: user 0.06 s, sys: 0.00 s, total: 0.06 s
Wall time: 0.06 s
1000

I do not really know what to make of it :-D

Nathann

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Attachment: cython_girth.patch
Description: Binary data

Reply via email to