flowbet: Calculate Flow Betweenness Scores of Network Positions

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/nli.R


flowbet takes one or more graphs (dat) and returns the flow betweenness scores of positions (selected by nodes) within the graphs indicated by g. Depending on the specified mode, flow betweenness on directed or undirected geodesics will be returned; this function is compatible with centralization, and will return the theoretical maximum absolute deviation (from maximum) conditional on size (which is used by centralization to normalize the observed centralization score).


flowbet(dat, g = 1, nodes = NULL, gmode = "digraph", diag = FALSE,
    tmaxdev = FALSE, cmode = "rawflow", rescale = FALSE, 
    ignore.eval = FALSE)



one or more input graphs.


integer indicating the index of the graph for which centralities are to be calculated (or a vector thereof). By default, g=1.


vector indicating which nodes are to be included in the calculation. By default, all nodes are included.


string indicating the type of graph being evaluated. digraph indicates that edges should be interpreted as directed (with flows summed over directed dyads); graph indicates that edges are undirected (with only undirected pairs considered). gmode is set to digraph by default.


boolean indicating whether or not the diagonal should be treated as valid data. Set this true if and only if the data can contain loops. diag is FALSE by default.


boolean indicating whether or not the theoretical maximum absolute deviation from the maximum nodal centrality should be returned. By default, tmaxdev==FALSE.


one of rawflow, normflow, or fracflow (see below).


if true, centrality scores are rescaled such that they sum to 1.


logical; ignore edge values when computing maximum flow (alternately, edge values will be assumed to carry capacity information)?


The (“raw,” or unnormalized) flow betweenness of a vertex, v in V(G), is defined by Freeman et al. (1991) as

C_F(v) = sum( f(i,j,G) - f(i,j,G\v), i,j: i!=j,i!=v,j!=v ),

where f(i,j,G) is the maximum flow from i to j within G (under the assumption of infinite vertex capacities, finite edge capacities, and non-simultaneity of pairwise flows). Intuitively, unnormalized flow betweenness is simply the total maximum flow (aggregated across all pairs of third parties) mediated by v.

The above flow betweenness measure is computed by flowbet when cmode=="rawflow". In some cases, it may be desirable to normalize the raw flow betweenness by the total maximum flow among third parties (including v); this leads to the following normalized flow betweenness measure:

C'_F(v) = sum( f(i,j,G) - f(i,j,G\v), i,j: i!=j,i!=v,j!=v ) / sum( f(i,j,G), i,j: i!=j,i!=v,j!=v ).

This variant can be selected by setting cmode=="normflow".

Finally, it may be noted that the above normalization (from Freeman et al. (1991)) is rather different from that used in the definition of shortest-path betweenness, which normalizes within (rather than across) third-party dyads. A third flow betweenness variant has been suggested by Koschutzki et al. (2005) based on a normalization of this type:

C''_F(v) = sum( (f(i,j,G) - f(i,j,G\v)) / f(i,j,G), i,j: i!=j,i!=v,j!=v ),

where 0/0 flow ratios are treated as 0 (as in shortest-path betweenness). Setting cmode=="fracflow" selects this variant.


A vector of centrality scores.


Carter T. Butts [email protected]


Freeman, L.C.; Borgatti, S.P.; and White, D.R. (1991). “Centrality in Valued Graphs: A Measure of Betweenness Based on Network Flow.” Social Networks, 13(2), 141-154.

Koschutzki, D.; Lehmann, K.A.; Peeters, L.; Richter, S.; Tenfelde-Podehl, D.; Zlotowski, O. (2005). “Centrality Indices.” In U. Brandes and T. Erlebach (eds.), Network Analysis: Methodological Foundations. Berlin: Springer.

See Also

betweenness, maxflow


g<-rgraph(10)                                     #Draw a random graph
flowbet(g)                                        #Raw flow betweenness
flowbet(g,cmode="normflow")                       #Normalized flow betweenness

g<-g*matrix(rpois(100,4),10,10)                   #Add capacity constraints
flowbet(g)                                        #Note the difference!

Example output

Loading required package: statnet.common
Loading required package: network
network: Classes for Relational Data
Version 1.13.0 created on 2015-08-31.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
                    Mark S. Handcock, University of California -- Los Angeles
                    David R. Hunter, Penn State University
                    Martina Morris, University of Washington
                    Skye Bender-deMoll, University of Washington
 For citation information, type citation("network").
 Type help("network-package") to get started.

sna: Tools for Social Network Analysis
Version 2.4 created on 2016-07-23.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
 For citation information, type citation("sna").
 Type help(package="sna") to get started.

 [1] 39 17 25 37 33 33 37 42 32  0
 [1] 0.16666667 0.06367041 0.09615385 0.15677966 0.13636364 0.13983051
 [7] 0.15546218 0.17948718 0.12698413 0.00000000
 [1] 219  29  60 170 114  96  92 144 136   0

sna documentation built on May 30, 2017, 12:18 a.m.

Related to flowbet in sna...