NetworkX

Previous topic

networkx.algorithms.components.strongly_connected.number_strongly_connected_components

Next topic

networkx.algorithms.components.strongly_connected.strongly_connected_component_subgraphs

networkx.algorithms.components.strongly_connected.strongly_connected_components

networkx.algorithms.components.strongly_connected.strongly_connected_components(G)

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 Tarjan’s algorithm with Nuutila’s modifications. Nonrecursive version of algorithm.

References

[R68]Depth-first search and linear graph algorithms, R. Tarjan SIAM Journal of Computing 1(2):146-160, (1972).
[R69]On finding the strongly connected components in a directed graph. E. Nuutila and E. Soisalon-Soinen Information Processing Letters 49(1): 9-14, (1994)..