All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
NetworKit::CommunityDetectionAlgorithm Class Referenceabstract

Abstract base class for community detection/graph clustering algorithms. More...

#include <CommunityDetectionAlgorithm.h>

Public Member Functions

 CommunityDetectionAlgorithm (const Graph &G)
 A community detection algorithm operates on a graph, so the constructor expects a graph. More...
 
 CommunityDetectionAlgorithm (const Graph &G, const Partition baseClustering)
 A community detection algorithm operates on a graph, so the constructor expects a graph. More...
 
virtual ~CommunityDetectionAlgorithm ()=default
 Default destructor. More...
 
virtual void run ()=0
 Apply algorithm to graph. More...
 
virtual Partition getPartition ()
 Returns the result of the run method or throws an error, if the algorithm hasn't run yet. More...
 
virtual std::string toString () const
 
- Public Member Functions inherited from NetworKit::Algorithm
 Algorithm ()
 Constructor to the algorithm base class. More...
 
virtual ~Algorithm ()=default
 Virtual default destructor. More...
 
bool hasFinished () const
 Indicates whether an algorithm has completed computation or not. More...
 
void assureFinished () const
 Assure that the algorithm has been run, throws a std::runtime_error otherwise. More...
 
virtual bool isParallel () const
 

Protected Attributes

const GraphG
 
Partition result
 
- Protected Attributes inherited from NetworKit::Algorithm
bool hasRun
 A boolean variable indicating whether an algorithm has finished its computation or not. More...
 

Detailed Description

Abstract base class for community detection/graph clustering algorithms.

Constructor & Destructor Documentation

NetworKit::CommunityDetectionAlgorithm::CommunityDetectionAlgorithm ( const Graph G)

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

Parameters
[in]Ginput graph
NetworKit::CommunityDetectionAlgorithm::CommunityDetectionAlgorithm ( const Graph G,
const Partition  baseClustering 
)

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

Parameters
[in]Ginput graph
[in]baseClusteringoptional; the algorithm will start from the given clustering.
virtual NetworKit::CommunityDetectionAlgorithm::~CommunityDetectionAlgorithm ( )
virtualdefault

Default destructor.

Member Function Documentation

Partition NetworKit::CommunityDetectionAlgorithm::getPartition ( )
virtual

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

Returns
partition of the node set
virtual void NetworKit::CommunityDetectionAlgorithm::run ( )
pure virtual
std::string NetworKit::CommunityDetectionAlgorithm::toString ( ) const
virtual
Returns
string representation of algorithm and parameters.

Reimplemented from NetworKit::Algorithm.

Reimplemented in NetworKit::PLP, NetworKit::LPDegreeOrdered, NetworKit::PLM, NetworKit::CutClustering, and NetworKit::ParallelAgglomerativeClusterer.

Member Data Documentation

const Graph& NetworKit::CommunityDetectionAlgorithm::G
protected
Partition NetworKit::CommunityDetectionAlgorithm::result
protected

The documentation for this class was generated from the following files: