This is the documentation for the current state of the development branch of rustworkx. The documentation or APIs here can change prior to being released.


num_shortest_paths_unweighted(graph, source)[source]#

Get the number of unweighted shortest paths from a source node

  • graph (PyDiGraph) – The graph to find the number of shortest paths on

  • source (int) – The source node to find the shortest paths from


A mapping of target node indices to the number of shortest paths from source to that node. If there is no path from source to a node in the graph that node will not be preset in the output mapping.

Return type: