Package-level declarations
Functions
Link copied to clipboard
fun <T> stronglyConnectedComponents(nodes: Iterable<T>, successors: (T) -> Iterable<T>): List<List<T>>
Strongly connected components of a directed graph (Tarjan's algorithm, iterative), in topological order: every edge between two components goes from an earlier one to a later one. Nodes keep their input order within a component, and successors outside nodes are ignored.