msmbuilder.MSMLib.tarjan

msmbuilder.MSMLib.tarjan(graph)[source]

Find the strongly connected components in a graph using Tarjan’s algorithm.

Parameters:

graph : dict

mapping from node names to lists of successor nodes.

Returns:

components : list

list of the strongly connected components

See also

ErgodicTrim

Notes

Code based on ActiveState code by Josiah Carlson (New BSD license). Most users will want to call the ErgodicTrim() function rather than directly calling Tarjan().