Qiskit / rustworkx

A high performance Python graph library implemented in Rust.
https://www.rustworkx.org
Apache License 2.0
1.03k stars 145 forks source link

Pass list of sources and targets to dijkstra_shortest_paths #1118

Open thomasaarholt opened 6 months ago

thomasaarholt commented 6 months ago

What is the expected enhancement?

I have a large graph. Performing path_dict = all_pairs_dijkstra_shortest_paths takes about 1 second, and produces a huge nested dict of 1.6 million source-target combinations.

Of the nodes in the graph, I am only interested in the shortest path between the combination of about 100 source nodes and 100 target nodes (resulting in 500 * 500 paths) of them.

Doing lookup in the path_dict is quite slow when looping over so many locations. I tried using dijkstra_shortest_paths as well, but each lookup is also quite slow, since I have to specify only one target and source at a time.

I would therefore very much appreciate a way to specify more than one target and source to dijkstra_shortest_paths, so as to speed this bit up.