Mark,

My timings are showing different results than yours.

(I'm running these tests on my idle MacBook, OS X 10.5.6, 2.4 GHz Core
2 Duo)

----------------------------------------------------------------------
| Sage Version 3.3, Release Date: 2009-02-21                         |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------

sage: def go(graphs):
....:     result = False
....:     for i in xrange(len(graphs)):
....:         for j in xrange(i+1,len(graphs)):
....:             if graphs[i].is_isomorphic(graphs[j]):
....:                 result = True
....:                 break
....:         if result: break
....:     return result

sage: G = list(graphs(6))
sage: G = [g.copy(implementation='c_graph') for g in G]
sage: %time go(G)
CPU times: user 0.64 s, sys: 0.00 s, total: 0.65 s
Wall time: 0.66 s
False

sage: G = list(graphs(7))
sage: G = [g.copy(implementation='c_graph') for g in G]
sage: %time go(G)
CPU times: user 30.70 s, sys: 0.11 s, total: 30.81 s
Wall time: 31.11 s
False

sage: import networkx
sage: def go(graphs):
....:     result = False
....:     for i in xrange(len(graphs)):
....:         for j in xrange(i+1,len(graphs)):
....:             GM = networkx.isomorphvf2.GraphMatcher(graphs
[i],graphs[j])
....:             if GM.is_isomorphic():
....:                 result = True; break
....:         if result: break
....:     return result

sage: G = list(graphs(6))
sage: G = [g.networkx_graph() for g in G]
sage: %time go(G)
CPU times: user 0.63 s, sys: 0.00 s, total: 0.63 s
Wall time: 0.63 s
False

sage: G = list(graphs(7))
sage: G = [g.networkx_graph() for g in G]
sage: %time go(G)
CPU times: user 29.81 s, sys: 0.10 s, total: 29.91 s
Wall time: 30.12 s
False

Essentially the same time. NetworkX is faster but by a ratio of 1.048
for graphs on 6 vertices and of 1.033 for graphs on 7 vertices.

What platform were you running your tests on?
--~--~---------~--~----~------------~-------~--~----~
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