I calculated average clustering coefficient using both Gephi and NetworkX. For the same graph NetworkX gave 0.2399 while Gephi gave 0.644.
The clustering coefficient for the graph is the average, C = 1 n ∑ v ∈ G c v , where is the number of nodes in G .
The clustering coefficient (Watts-Strogatz), when applied to a single node, is a measure of how complete the neighborhood of a node is. When applied to an entire network, it is the average clustering coefficient over all of the nodes in the network.
The clustering coefficients measure the average probability that two neighbors of a vertex are themselves neighbors (a measure of the density of triangles in a network).
The global clustering coefficient is the number of closed triplets (or 3 x triangles) over the total number of triplets (both open and closed): CC = 3 × number of triangles number of triplets = number of closed triplets number of triplets . 〈C〉 = E[C]=1/3 for the above graph.
just to mention that networkx's average_clustering has a parameter named count_zeros. average_clustering documentation
Its default value is True which means it will take zero-clustering node into account. You can set it to False and see if it returns the same value as Gephi.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With