closeness(graph, vids=V(graph), mode = c("out", "in", "all", "total"),
weights = NULL, normalized = FALSE)
closeness.estimate(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.
closeness.estimate
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 <- graph.ring(10)
g2 <- graph.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