Qiskit / rustworkx

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

"single_source_all_shortest_paths" or "all_pairs_all_shortest_paths" function call #1184

Open ziyuezzy opened 5 months ago

ziyuezzy commented 5 months ago

What is the expected enhancement?

As requested by issue #933 , and closed by #1017 , function "all_shortest_paths" in the current version of rustworkx returns all possible shortest paths between two nodes in a graph. However, in some cases we want to start one dijkstra shortest-path search from a source node to all possible destination nodes. Referring to networkx API, this function "single_source_all_shortest_paths" implements what I am talking about.

Additionally, once there is "single_source_all_shortest_paths" , simply iterating through all source nodes will lead to "all_pairs_all_shortest_paths". The networkx-equivalent of this function is "all_pairs_all_shortest_paths" ,

Thanks! Z.