igraph-help
[Top][All Lists]

## [igraph] Relation between network's clustering coefficient and density

 From: capitano . nemo Subject: [igraph] Relation between network's clustering coefficient and density Date: Wed, 18 Nov 2015 19:46:35 +0000 User-agent: Roundcube Webmail

From a undirected friendship network with N nodes I have extracted N neighboring graphs of order 1 with make_ego_graph(). For each resulting graph I calculated density and transitivity. My question is, shuld the two statistics be perfectly correlated in social networks? Is it trivial to present both statistics?
```
```
I run a simulation with erdos.renyi.game() and in fact got almost perfect correlation:
```
graph_clustering_coeff <- numeric()
graph_density <- numeric()

for(i in seq(0,1,by=.01)) {
print(i)
g <- erdos.renyi.game(100, i)
graph_clustering_coeff <- c(graph_clustering_coeff, transitivity(g))
graph_density <- c(graph_density, graph.density(g))
}

cor.test(graph_clustering_coeff, graph_density)

# Pearson's product-moment
#       correlation
#
# data:  graph_clustering_coeff and graph_density
# t = 600.36, df = 98, p-value <
# 2.2e-16
# alternative hypothesis: true correlation is not equal to 0
# 95 percent confidence interval:
#  0.9997976 0.9999087
# sample estimates:
#       cor
# 0.9998641

plot(graph_clustering_coeff, graph_density)

Thanks!

Francesco

```