Strength or weighted vertex degree
Summing up the edge weights of the adjacent edges for each vertex.
strength(graph, vids = V(graph), mode = c("all", "out", "in", "total"), loops = TRUE, weights = NULL)
- The input graph.
- The vertices for which the strength will be calculated.
- Character string,
outfor out-degree, infor in-degree or allfor the sum of the two. For undirected graphs this argument is ignored.
- Logical; whether the loop edges are also counted.
- Weight vector. If the graph has a
weightedge attribute, then this is used by default. If the graph does not have a
weightedge attribute and this argument is
NULL, then a warning is given and
- A numeric vector giving the strength of the vertices.
Alain Barrat, Marc Barthelemy, Romualdo Pastor-Satorras, Alessandro Vespignani: The architecture of complex weighted networks, Proc. Natl. Acad. Sci. USA 101, 3747 (2004)
degree for the unweighted version.
g <- make_star(10) E(g)$weight <- seq(ecount(g)) strength(g) strength(g, mode="out") strength(g, mode="in") # No weights, a warning is given g <- make_ring(10) strength(g)