Skip to content

Instantly share code, notes, and snippets.

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
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('')
source = 1569333
topology.shortest_distance(g, source=source, weights=g.ep["length"], max_dist=2000, pred_map=True)
s = StringIO.StringIO()
sortby = 'cumulative'
ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
print s.getvalue()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment