Calculate global or local clustering coefficient from triangles, connected triplets, node degree, neighbor links, or a degree sequence.

Clustering Coefficient Calculator

Choose the input format you have.

Global
Local node
Degree list

Clustering Coefficient Formula

Local clustering coefficient for a node with degree k and e links among its neighbors:

C_i = 2e / (k * (k - 1))

Global clustering coefficient (transitivity) for the whole network:

C = 3 * (number of triangles) / (number of connected triplets)

Connected triplets from a degree sequence:

Triplets = Σ k_i * (k_i - 1) / 2
  • k — degree of the node (number of neighbors)
  • e — actual edges between that node’s neighbors
  • k(k − 1)/2 — maximum possible edges among k neighbors
  • Triangle — three nodes all connected to each other
  • Connected triplet — any node with two distinct neighbors (open or closed)

Each triangle contains three closed triplets, which is why the global formula multiplies triangles by three. The local formula requires k ≥ 2, since a node with one or zero neighbors has no possible neighbor pairs. Both coefficients return values between 0 and 1.

Reference Values

Typical clustering coefficient ranges by network type:

Network Type Typical C
Random graph (Erdős–Rényi)≈ p (edge probability)
Social networks0.10 – 0.60
Collaboration networks0.30 – 0.80
Web / hyperlink graphs0.10 – 0.30
Biological (protein interaction)0.05 – 0.20
Lattice / regular graph0.50 – 0.75

How to read your result:

Value Interpretation
C = 0No neighbors are connected to each other
0 < C < 0.3Sparse local connections
0.3 ≤ C < 0.6Moderate grouping, common in social graphs
C ≥ 0.6Strong cliquishness, near-complete subgroups
C = 1Every neighbor pair is connected (clique)

Worked Examples

Example 1 — Local coefficient. A node has 4 neighbors and 3 of them are linked to each other.

  • Possible neighbor links = 4 × 3 / 2 = 6
  • C_i = 3 / 6 = 0.5000

Example 2 — Global coefficient. A graph has 12 triangles and 90 connected triplets.

  • Closed triplets = 3 × 12 = 36
  • C = 36 / 90 = 0.4000

Example 3 — From a degree sequence. Degrees [2, 3, 3, 1, 1] with 1 triangle.

  • Triplets = 1 + 3 + 3 + 0 + 0 = 7
  • C = 3 / 7 ≈ 0.4286

FAQ

What is the difference between local and global clustering? Local C measures one node’s neighborhood. Global C (transitivity) summarizes the whole network in a single number.

Why does my node need degree ≥ 2? A node with one neighbor has no neighbor pairs, so the denominator k(k − 1)/2 is zero and the coefficient is undefined.

Triangles or closed triplets — which should I enter? Either works. The calculator multiplies triangles by 3 internally to get closed triplets. Use whichever count you already have.

Can the coefficient exceed 1? No. If you get a value above 1, your closed-triplet or triangle count is inconsistent with your triplet count.