I'm having a medium-sized igraph-object (~150 actors) and want to calculate the betweenness count for each graph. I was wondering if there is an elegant way to do so?
For instance, we can export betweenness centrality or constraint by just writing:
c1 <- constraint(g1)
However, I am interested in an absolute count of how many structural holes a node occupies. So if node A connects B and C, while B and C are not connected, this should count as 1. If A also connects C and D, but C and D are connected, this should count as 0. And finally, if A connects B and D, but B and D are not connected, this should count as 1 - and so on and so forth.
Any help or a pointer in the right direction would be much appreciated. I searched for questions along the lines of bridging ties, betweenness count, and structural holes, but with no success.
Thanks
If I have understood you correctly, you want to count A - B - C iif A is not adjacent to C. On an undirected graph, betweenness(..., normalized = FALSE)
should give you the count you want:
library(igraph)
g <- graph_from_literal(
A - B, B - C, C - A, C - D
)
plot(g)
betweenness(g, directed = FALSE, normalized = FALSE)