networkit.globals

class networkit.globals.ClusteringCoefficient

Bases: object

static approxAvgLocal(Graph G, count trials)
static approxGlobal(Graph G, count trials)
static avgLocal(Graph G, bool turbo=False)

DEPRECATED: Use centrality.LocalClusteringCoefficient and take average.

This calculates the average local clustering coefficient of graph G. The graph may not contain self-loops.

G : Graph
The graph.
\[c(G) := \frac{1}{n} \sum_{u \in V} c(u)\]

where

\[c(u) := \frac{2 \cdot |E(N(u))| }{\deg(u) \cdot ( \deg(u) - 1)}\]
static exactGlobal(Graph G)

This calculates the global clustering coefficient.

static sequentialAvgLocal(Graph G)

This calculates the average local clustering coefficient of graph G using inherently sequential triangle counting. Parameters ———- G : Graph

The graph.
\[c(G) := \frac{1}{n} \sum_{u \in V} c(u)\]

where

\[c(u) := \frac{2 \cdot |E(N(u))| }{\deg(u) \cdot ( \deg(u) - 1)}\]
networkit.globals.clustering(G, error=0.01)

Returns approximate average local clustering coefficient The maximum error can be given as a parameter and determines the number of samples taken.

for details see:
Schank, Wagner: Approximating Clustering Coefficient and Transitivity