fn() weaklyConnectedComponents
Compute weakly connected components of a directed graph.

Defined in <seqan/graph_algorithms.h>
Signature TSize weaklyConnectedComponents(g, components);

Parameters

g A DirectedGraph to use for the input.
components A property map. Each vertex is mapped to a component id. If two vertices share the same id they are in the same component.

Return Values

TSize The number of weakly connected components (Metafunction: Size of the type of g).

Detailed Description

The running time is O(n a(n, n)) where a is the inverse Ackermann function and thus almost linear. The union find data structure is used since the graph implementations do not allow the efficient iteration of in-edges.