single_source_shortest_path_length
- sklearn.utils.graph.single_source_shortest_path_length(graph, source, *, cutoff=None)
Return the length of the shortest path from source to all reachable nodes.
- Parameters:
- graph : {array-like, sparse matrix} of shape (n_nodes, n_nodes)
Adjacency matrix of the graph. Sparse matrix of format LIL is preferred.