def profile_d():
d_vs_t = [[], []]
print 'Timing graphpca(G, d) on Erdos-Renyi Graph nx.fast_gnp_random_graph(1000, 0.02)'
print '\t'.join(('d', 't (ms)'))
g = nx.fast_gnp_random_graph(1000, 0.02)
for d in range(1, 950, 30):
tic = timeit.default_timer()
graphpca.reduce_graph(g, d)
toc = timeit.default_timer()
print '\t'.join((str(d), str((toc - tic) * 1000)))
d_vs_t[0].append(d)
d_vs_t[1].append(toc - tic)
return d_vs_t
评论列表
文章目录