Class WeaklyConnectedComponents

Inheritance Relationships

Base Type

Class Documentation

class WeaklyConnectedComponents : public NetworKit::ComponentDecomposition

Determines the weakly connected components of a directed graph.

Public Functions

WeaklyConnectedComponents(const Graph &G)

Create WeaklyConnectedComponents class for Graph G.

Parameters:

G – The graph.

~WeaklyConnectedComponents() override
virtual void run() override

The generic run method which calls runImpl() and takes care of setting hasRun to the appropriate value.

Public Static Functions

static Graph extractLargestWeaklyConnectedComponent(const Graph &G, bool compactGraph = false)

Constructs a new graph that contains only the nodes inside the largest weakly connected component.

Parameters:
  • G – The input graph.

  • compactGraph – If true, the node ids of the output graph will be compacted (i.e. re-numbered from 0 to n-1). If false, the node ids will not be changed.

Returns:

The largest weakly connected component of the input graph G.