\HeaderA{brandes.betweenness.centrality}{Compute betweenness centrality for an undirected graph}{brandes.betweenness.centrality}
\keyword{models}{brandes.betweenness.centrality}
\begin{Description}\relax
Compute betweenness centrality for an undirected graph
\end{Description}
\begin{Usage}
\begin{verbatim}
brandes.betweenness.centrality(g)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{g}] an instance of the \code{graph} class with \code{edgemode}
\dQuote{undirected}
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{Brandes.betweenness.centrality} computes the betweenness centrality of 
each vertex or each edge in the graph, using an algorithm by U. Brandes.

Betweenness centrality of a vertex \code{v} is calculated as follows:
\code{N\_st(v)} = no. of shortest paths from \code{s} to \code{t} that pass through \code{v},
\code{N\_st} = no. of shortest paths from \code{s} to \code{t},
betweenness centrality of \code{v} = \code{sum(N\_st(v)/N\_st)} for all vertices \code{s} != \code{v} != \code{t}.

Betweenness centrality of an edge is calculated similarly.

The relative betweenness centrality for a vertex is to scale the betweenness
centrality of the given vertex by \code{2/(n**2 - 3n + 2)} where \code{n} is 
the no. of vertices in the graph.

Central point dominance measures the maximum betweenness of any vertex 
in the graph.

See documentation on brandes betweenness centrality in Boost Graph Library 
for more details.
\end{Details}
\begin{Value}
A list of
\begin{ldescription}
\item[\code{betweenness.centrality.vertices}] betweenness centrality of each vertex
\item[\code{betweenness.centrality.edges}] betweenness centrality of each edge
\item[\code{relative.betweenness.centrality.vertices}] relative betweenness centrality of each vertex
\item[\code{dominance}] maximum betweenness of any point in the graph
\end{ldescription}
\end{Value}
\begin{Author}\relax
Li Long <li.long@isb-sib.ch>
\end{Author}
\begin{References}\relax
Boost Graph Library by Siek et al.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{betweenness.centrality.clustering}{betweenness.centrality.clustering}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
coex <- fromGXL(file(system.file("XML/conn.gxl",package="RBGL"), open="r"))
coex <- ugraph(coex)
brandes.betweenness.centrality(coex)
\end{ExampleCode}
\end{Examples}

