NetworkX

Previous topic

kosaraju_strongly_connected_components

Next topic

is_weakly_connected

condensation

condensation(G, scc)[source]

Returns the condensation of G.

The condensation of G is the graph with each of the strongly connected components contracted into a single node.

Parameters :

G : NetworkX DiGraph

A directed graph.

scc: list :

A list of strongly connected components. Use scc=nx.strongly_connected_components(G) to compute the components.

Returns :

C : NetworkX DiGraph

The condensation of G. The node labels are integers corresponding to the index of the component in the list of strongly connected components.

Notes

After contracting all strongly connected components to a single node, the resulting graph is a directed acyclic graph.