132 for (
node v : G.nodes) {
133 ciSum += computeCIndex(G, v);
135 return ciSum / (G.numberOfNodes());
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
Includes declaration of graph class.
Representation of clustered graphs.
Interface for algorithms that compute a clustering for a given graph.
virtual double averageCIndex()
compute the average clustering index for the given graph
ClustererModule(const Graph &G)
ClustererModule()
Default constructor, initializes a clustering module.
void setGraph(const Graph &G)
Sets the graph to be clustered.
const Graph & getGraph() const
Returns the graph to be clustered.
virtual double averageCIndex(const Graph &G)
virtual double computeCIndex(node v)=0
compute a clustering index for each vertex
virtual void computeClustering(SList< SimpleCluster * > &sl)=0
compute some kind of clustering on the graph m_pGraph
virtual double computeCIndex(const Graph &G, node v)=0
compute a clustering index for each vertex
virtual void createClusterGraph(ClusterGraph &C)=0
translate computed clustering into cluster hierarchy in cluster graph C
Data type for general directed graphs (adjacency list representation).
Class for the representation of nodes.
Singly linked lists (maintaining the length of the list).
SimpleCluster * getParent()
SList< SimpleCluster * > & children()
SList< SimpleCluster * > m_children
void pushBackChild(SimpleCluster *s)
void pushBackVertex(node v)
SimpleCluster(SimpleCluster *parent=nullptr)
void setParent(SimpleCluster *parent)
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
bool isConnected(const Graph &G)
Returns true iff G is connected.
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
Declaration of simple graph algorithms.