Class CommunityDetectionAlgorithm

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class CommunityDetectionAlgorithm : public NetworKit::Algorithm

Abstract base class for community detection/graph clustering algorithms.

Subclassed by NetworKit::CutClustering, NetworKit::LPDegreeOrdered, NetworKit::LouvainMapEquation, NetworKit::PLM, NetworKit::PLP, NetworKit::ParallelAgglomerativeClusterer, NetworKit::ParallelLeiden

Public Functions

CommunityDetectionAlgorithm(const Graph &G)

A community detection algorithm operates on a graph, so the constructor expects a graph.

Parameters:

G[in] input graph

CommunityDetectionAlgorithm(const Graph &G, Partition baseClustering)

A community detection algorithm operates on a graph, so the constructor expects a graph.

Parameters:
  • G[in] input graph

  • baseClustering[in] optional; the algorithm will start from the given clustering.

~CommunityDetectionAlgorithm() override = default

Default destructor

virtual void run() override = 0

Apply algorithm to graph

virtual const Partition &getPartition() const

Returns the result of the run method or throws an error, if the algorithm hasn’t run yet.

Returns:

partition of the node set

Protected Attributes

const Graph *G
Partition result