Note

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.

rustworkx.num_shortest_paths_unweighted#

num_shortest_paths_unweighted(graph, source)[source]#

Get the number of unweighted shortest paths from a source node

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

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

Returns:

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:

NodesCountMapping