NetworkX

Previous topic

strongly_connected_components_recursive

Next topic

condensation

kosaraju_strongly_connected_components

kosaraju_strongly_connected_components(G, source=None)[source]

Return nodes in strongly connected components of graph.

Parameters :

G : NetworkX Graph

An directed graph.

Returns :

comp : list of lists

A list of nodes for each component of G. The list is ordered from largest connected component to smallest.

See also

connected_components

Notes

Uses Kosaraju’s algorithm.