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