graphology
graphology copied to clipboard
feature request: clustering coefficient
Is there a way to calculate the clustering coefficient for the graph and the node? Or any plan to support this? thanks.
Hello @kennylbj, I will need more details/context for your request. What do you call clustering coefficient here? Are we speaking about this definition (which is not the only one): https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.cluster.clustering.html#networkx.algorithms.cluster.clustering ?
@Yomguithereal Yes, that's exactly what I requested, Same definition can be found in wikipeida.
Ok. Let me figure out if I need to enumerate actual triangles to compute the metric (in which case I must refactor my triangle enumerating routine using the Chiba-Nishizeki algorithm beforehand) or not. If I don't need that, it should be straightforward to implement (for unweighted graphs, at least).
Hello, Do we have any news on this issue? Or there is a way to calculate the clustering coefficient of a graph? Thanks!
No news sorry. Did not have time nor incentive to work on this lately.
Well, thats bad news :( Could you point me in a direction in how to calculate this? We need to include this calculation in our graph.
networkx has some code to do this here: https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.cluster.clustering.html#networkx.algorithms.cluster.clustering if you want the metric for nodes. You could replicate it using graphology but this is not a simple thing to do.
Then if you "just" need some metric related to the importance of a node, maybe another of the centrality metrics already implemented could also fit the bill? The clustering coefficient is quite niche and I have never seen it used in the wild, but again I am coming from visual network analysis and I don't know all scientific disciplines that might absolutely need the clustering coefficient for very good reasons beyond my knowledge.