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

Modularity is a quality index for community detection. More...

#include <Modularity.h>

Public Member Functions

 Modularity ()
 Default constructor. More...
 
virtual double getQuality (const Partition &zeta, const Graph &G)
 Returns the Modularity of the given clustering with respect to the graph G. More...
 
void setTotalEdgeWeight (double totalEdgeWeight)
 

Protected Attributes

double gTotalEdgeWeight
 

Detailed Description

Modularity is a quality index for community detection.

It assigns a quality value in [-0.5, 1.0] to a partition of a graph which is higher for more modular networks and partitions which better capture the modular structure.

Modularity is defined as:

$$mod(\zeta) := \frac{\sum_{C \in \zeta} \sum_{ e \in E(C) } \omega(e)}{\sum_{e \in E} \omega(e)}
- \frac{ \sum_{C \in \zeta}( \sum_{v \in C} \omega(v) )^2 }{4( \sum_{e \in E} \omega(e) )^2 }$$

Constructor & Destructor Documentation

NetworKit::Modularity::Modularity ( )

Default constructor.

Member Function Documentation

double NetworKit::Modularity::getQuality ( const Partition zeta,
const Graph G 
)
virtual

Returns the Modularity of the given clustering with respect to the graph G.

Parameters
zetaThe clustering.
GThe graph.
Returns
The modularity.

< cluster -> sum of the weights of incident edges for all nodes

Implements NetworKit::QualityMeasure.

void NetworKit::Modularity::setTotalEdgeWeight ( double  totalEdgeWeight)
Parameters
totalEdgeWeightSum of all edge weights in G. If specified, it does not have to be computed.

Member Data Documentation

double NetworKit::Modularity::gTotalEdgeWeight
protected

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