Class ConnectedComponents

Inheritance Relationships

Base Type

Class Documentation

class ConnectedComponents : public NetworKit::ComponentDecomposition

Public Functions

ConnectedComponents(const Graph &G)
~ConnectedComponents() 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 extractLargestConnectedComponent(const Graph &G, bool compactGraph = false)

Constructs a new graph that contains only the nodes inside the largest 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 connected component of the input graph G.