All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CommunityDetectionAlgorithm.h
Go to the documentation of this file.
1 /*
2  * CommunityDetectionAlgorithm.h
3  *
4  * Created on: 30.10.2012
5  * Author: Christian Staudt (christian.staudt@kit.edu)
6  */
7 
8 #ifndef COMMUNITYDETECTIONALGORITHM_H_
9 #define COMMUNITYDETECTIONALGORITHM_H_
10 
11 #include "../structures/Partition.h"
12 #include "../base/Algorithm.h"
13 
14 namespace NetworKit {
15 
21 public:
28 
35  CommunityDetectionAlgorithm(const Graph& G, const Partition baseClustering);
36 
38  virtual ~CommunityDetectionAlgorithm() = default;
39 
43  virtual void run() = 0;
44 
49  virtual Partition getPartition();
50 
54  virtual std::string toString() const;
55 
56 protected:
57  const Graph& G;
59 };
60 
61 } /* namespace NetworKit */
62 #endif // COMMUNITYDETECTIONALGORITHM_H_
virtual Partition getPartition()
Returns the result of the run method or throws an error, if the algorithm hasn't run yet...
Definition: CommunityDetectionAlgorithm.cpp:22
Implements a partition of a set, i.e.
Definition: Partition.h:31
virtual ~CommunityDetectionAlgorithm()=default
Default destructor.
const Graph & G
Definition: CommunityDetectionAlgorithm.h:57
Partition result
Definition: CommunityDetectionAlgorithm.h:58
virtual void run()=0
Apply algorithm to graph.
virtual std::string toString() const
Definition: CommunityDetectionAlgorithm.cpp:29
CommunityDetectionAlgorithm(const Graph &G)
A community detection algorithm operates on a graph, so the constructor expects a graph...
Definition: CommunityDetectionAlgorithm.cpp:12
Definition: Algorithm.h:9
Abstract base class for community detection/graph clustering algorithms.
Definition: CommunityDetectionAlgorithm.h:20
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79