On 10/14/2013 02:03 PM, Tasos wrote: > Stupid question.. but Im probably missing something! > > Is it possible for the same Edge Weighted graph... > > graph_tool.search.dijkstra_search(g_DirG, dist_map=temp_dist, > source=g_DirG.vertex(i), weight=eprop_ang_weight) > graph_tool.topology.shortest_distance(g_DirG, dist_map=temp_dist, > source=g_DirG.vertex(i), weights=eprop_ang_weight) > > the shortest_distance run a lot faster than dijkstra... I assume sort-dist > is using dijkstra with some visitor to do the job. > How is that possible?
It is simple. The dijkstra_search() function calls every event function of the supplied visitor, which is a _Python_ object. The shortest_distance() function has everything implemented in C++, hence the performance difference. Cheers, Tiago -- Tiago de Paula Peixoto <[email protected]>
signature.asc
Description: OpenPGP digital signature
_______________________________________________ graph-tool mailing list [email protected] http://lists.skewed.de/mailman/listinfo/graph-tool
