Search⌘ K
AI Features

The Clustering Coefficient

Explore the concept of the clustering coefficient in complex networks. Understand how to measure node clustering globally and locally using methods like transitivity and local clustering coefficient with Python's NetworkX library. Learn the differences between these metrics and their applications in network analysis.

The clustering coefficient is a metric that doesn’t try to measure the centrality of a node. Instead, it aims to estimate the degree to which nodes of the network tend to cluster together.

The global clustering coefficient: Transitivity

The global clustering coefficient tries to summarize the degree of aggregation of the network with a single number. One of its names is the transitivity of the network.

Its main idea is to measure the number of triplets of the network. A triplet is a set of three nodes that are connected by either two or three edges.

When these nodes are connected by two edges, we call it an open triplet, such as the following:

Open triplet
Open triplet

When three edges connect the three nodes, we call it a closed triplet, such as shown below:

Closed triplet
Closed triplet

The transitivity is then calculated by dividing the number of closed triplets by the number of all triplets ( closed and open):

This means that the transitivity measures how much of the triplets of the network are closed.

We can also calculate it as the number of triangles in the network over the number of all triplets in the network:

To interpret this, we must realize that a triangle ...