networkit.globals

class networkit.globals.ClusteringCoefficient

Bases: object

Class, which provides static functions for computing additional information for clustering coefficients. A ClusteringCoefficient object itself doesn’t have to be created.

static approxAvgLocal(G, trials)

Approximates the average local clustering coefficient.

Parameters:
  • G (networkit.Graph) – The input graph.

  • trials (int) – Number of runs. Higher values result in higher quality and larger running times.

static approxGlobal(G, trials)

Approximates the global clustering coefficient.

Parameters:
  • G (networkit.Graph) – The input graph.

  • trials (int) – Number of runs. Higher values result in higher quality and larger running times.

static exactGlobal(G)

Calculates the global clustering coefficient.

Parameters:

G (networkit.Graph) – The input graph.

static sequentialAvgLocal(G)

This calculates the average local clustering coefficient of graph G using inherently sequential triangle counting.

Notes

c(G):=1nuVc(u)

where

c(u):=2|E(N(u))|deg(u)(deg(u)1)
Parameters:

G (networkit.Graph) – The input graph.

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

Parameters:
  • G (networkit.Graph) – The input graph.

  • error (float) – Maximum allowed error. Default: 0.01