8

I calculated average clustering coefficient using both Gephi and NetworkX. For the same graph NetworkX gave 0.2399 while Gephi gave 0.644.

  1. Why is it different ?
  2. How do NetworkX and Gephi calculate average clustering coefficient ?
  3. In case of disconnected components specifically; how do NetworkX and Gephi calculate the coefficient ?
user4157124
  • 2,809
  • 13
  • 27
  • 42
sridhar
  • 329
  • 4
  • 16
  • [link] (https://github.com/gephi/gephi/issues/625) Is it because of considering the clustering coefficient to be 0 or 1 for nodes of degree less than 2 ?? – sridhar Jan 29 '17 at 22:32
  • 2
    Yes... networkx makes the clustering coefficient to be 0 for nodes with degree less than 2 and averages over all the nodes. While Gephi doesn't count the nodes at all that are having degree less than 2 and computes average clustering only for nodes with degree >= 2 – sridhar May 05 '17 at 17:32
  • 1
    I tried to remove the nodes with degree less than two and I still get different results from gephi and from networkx. The difference is smaller than the one without removing those nodes but still it is quite off. – Anoroah Jan 15 '18 at 15:01

1 Answers1

0

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.