On Mar 2, 12:09 pm, Robert Miller <rlmills...@gmail.com> wrote: > My timings are showing different results than yours. > ... > What platform were you running your tests on?
Hey, Just got back from a day of fun in the snow. I can confirm your timing comparisons, when I run your code on my machine. Makes me wonder if I'm doing anything wrong in my code. The exact code I used to produce my originally posted timing results is below. My machine is a MacBook Pro running Sage 3.3 on OSX 10.4.11. I haven't tried your patch, but I'm looking forward to it. Mark --------------------- NetworkX ---------------------- -- The interpreter box at the top is set to Python -- import networkx as nx import time as time import urllib2 f = urllib2.urlopen('http://cs.anu.edu.au/~bdm/data/graph7.g6') graph_strings = f.readlines() f.close() graphs = [nx.parse_graph6(s.strip()) for s in graph_strings] t = time.clock() result = False for i in xrange(0, len(graphs)-1): for j in xrange(i+1, len(graphs)-1): if nx.isomorphvf2.GraphMatcher(graphs[i],graphs [j]).is_isomorphic(): result=True break if result: break result time.clock()-t CPU time: 27.39 s ----------------- Sage code -------------- import urllib2 f = urllib2.urlopen('http://cs.anu.edu.au/~bdm/data/graph7.g6') # Or graph7.g6 graph_strings = f.readlines() f.close() some_graphs = [Graph(graph_string) for graph_string in graph_strings] # Switch to the new c_graph implementation. better_graphs = [g.copy(implementation='c_graph', sparse=False) for g in some_graphs] n = len(some_graphs) %time result = false for i in xrange(0,n): for j in xrange(i+1, n): if better_graphs[i].is_isomorphic(better_graphs[j]): result = true break if result: break result CPU time: 38.12 s --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---