I want to use the assortativity degree as a ways of estimating the level of homogeneity / heterogeneity of real networks:
1 = homogeneous (all vertices having degree k, they all connect to vertices with degree k)
-1 = heterogeneous
It seems to work fine for the extreme case of heterogeneity:
> assortativity_degree(make_star(25, mode = "undirected"), directed=FALSE)
[1] -1
However, for the other extreme of homogeneity (e.g., regular networks) the function assortativity_degree() does not return a value of 1, but a NaN.
> assortativity_degree(make_lattice(c(1, 5, 5), circular=T), directed=FALSE)
[1] NaN
When I tried to do an "almost-regular" network by deleting one edge in the regular, instead of getting a close to 1 value I got a close to 0 value.
> assortativity_degree(make_lattice(c(1, 5, 5), circular = T) %>% delete_edges(1), directed=F)
[1] -0.06521739
Any clue why regular networks do not show values of 1?
Am I missing something about how assortativity is calculated?
Thanks a lot!
--