Sorry, I forgot the paste the whole stuff:

path = []
for item in pairs:
   vpath, epath = gt.shortest_path(weighted_graph,
                                   weighted_graph.vertex(item[0]),
                                   weighted_graph.vertex(item[1]),
                                   weights=weights,
                                   negative_weights=True)
   temp_path = [int(v) for v in vpath]
   path.append(temp_path)

Alıntı [email protected]:

Hi,

Thanks for the response Tiago!

I also wonder if the performance differences between those two graphs are expected to be much different, i.e., it takes 9 minutes to obtain shortest path between 400,000 pairs in the normal graph, and it takes 52 hours for the weighted one.

Here is how I'm doing it:

path = []
for item in pairs:
   vpath, epath = gt.shortest_path(weighted_graph,
                                   weighted_graph.vertex(item[0]),
                                   weighted_graph.vertex(item[1]),
                                   weights=weights,
                                   negative_weights=True)




_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to