Created
June 7, 2016 09:19
-
-
Save Fkawala/f7a3366a0d702163d7499ce29efec78e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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