Removed distance of edges

Hi all,

For all edges e=(source, target) in a graph, I want to know the shortest distance of the two nodes if the edge connecting them was removed. Is this the fastest way to do it?

dist_remove = []
for e in list(g.edges()):
    dist_remove.append(gt.shortest_distance(g, source=e.source(),

You might want to use filtering instead, which would even allow you to run the loop in parallel.