Skip to content

Instantly share code, notes, and snippets.

@Fkawala
Created June 7, 2016 09:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
import graph_tool as gt
import graph_tool.topology as topology
import cProfile, pstats, StringIO
pr = cProfile.Profile()
g = gt.load_graph('graph.gt.gz')
source = 1569333
pr.enable()
topology.shortest_distance(g, source=source, weights=g.ep["length"], max_dist=2000, pred_map=True)
pr.disable()
s = StringIO.StringIO()
sortby = 'cumulative'
ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
ps.print_stats()
print s.getvalue()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment