closeness(graph, vids = V(graph), mode = c("out", "in", "all", "total"),
weights = NULL, normalized = FALSE)estimate_closeness(graph, vids = V(graph), mode = c("out", "in", "all",
"total"), cutoff, weights = NULL, normalized = FALSE)
weight
edge attribute, then this is
used by default.v
.$$\frac{1}{\sum_{i\ne v} d_vi}$$
If there is no (directed) path between vertex $v$ and $i$ then the total number of vertices is used in the formula instead of the path length.
estimate_closeness
only considers paths of length cutoff
or
smaller, this can be run for larger graphs, as the running time is not
quadratic (if cutoff
is small). If cutoff
is zero or negative
then the function calculates the exact closeness scores.
betweenness
, degree
g <- make_ring(10)
g2 <- make_star(10)
closeness(g)
closeness(g2, mode="in")
closeness(g2, mode="out")
closeness(g2, mode="all")
Run the code above in your browser using DataLab