\HeaderA{graph.strength}{Strength or weighted vertex degree}{graph.strength}
\keyword{graphs}{graph.strength}
\begin{Description}\relax
Summing up the edge weights of the adjacent edges for each
vertex.
\end{Description}
\begin{Usage}
\begin{verbatim}
graph.strength (graph, vids = V(graph), mode = c("all", "out", "in", "total"),
      loops = TRUE, weights = NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{graph}] The input graph.
\item[\code{vids}] The vertices for which the strength will be calculated.
\item[\code{mode}] Character string, \dQuote{out} for out-degree, \dQuote{in} for
in-degree or \dQuote{all} for the sum of the two. For undirected
graphs this argument is ignored.
\item[\code{loops}] Logical; whether the loop edges are also counted.
\item[\code{weights}] Weight vector. If the graph has a \code{weight} edge
attribute, then this is used by default. If the graph does not have
a \code{weight} edge attribute and this argument is \code{NULL},
then a warning is given and \code{\LinkA{degree}{degree}} is called.
\end{ldescription}
\end{Arguments}
\begin{Value}
A numeric vector giving the strength of the vertices.
\end{Value}
\begin{Author}\relax
Gabor Csardi \email{csardi@rmki.kfki.hu}
\end{Author}
\begin{References}\relax
Alain Barrat, Marc Barthelemy, Romualdo Pastor-Satorras, Alessandro
Vespignani: The architecture of complex weighted networks,
Proc. Natl. Acad. Sci. USA 101, 3747 (2004)
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{degree}{degree}} for the unweighted version.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
g <- graph.star(10)
E(g)$weight <- seq(ecount(g))
graph.strength(g)
graph.strength(g, mode="out")
graph.strength(g, mode="in")

# No weights, a warning is given
g <- graph.ring(10)
graph.strength(g)
\end{ExampleCode}
\end{Examples}

