First simulate a baseline:
require(igraph) alters = 50 ties = 10 set.seed(12345) edgelist = rbind(0, 1:alters) edgelist = cbind(edgelist, replicate(ties, sample(alters, 2))) g = graph(edgelist, directed=F) dev.new(width=5, height=5) plot(g, layout=layout.kamada.kawai)

Then write a simple function to calculate the effective size. (Functions acting on g are well described in the igraph and in various examples over the network.)
EffectiveSize <- function(g, ego=0) { n = neighbors(g, ego) t = length(E(g)[to(n) & !to(ego)]) n = length(n) n - 2 * t / n }
> EffectiveSize(g) [1] 49.6
source share