`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)
```

dat

one or more input graphs.

g

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

=1.

nodes

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

gmode

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.

diag

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.

tmaxdev

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

==`FALSE`

.

cmode

one of `rawflow`

, `normflow`

, or `fracflow`

(see below).

rescale

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

ignore.eval

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

A vector of centrality scores.

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_{i,j : i \neq j, i \neq v, j \neq v} \left(f(i,j,G) - f(i,j,G\setminus v)\right),$$ 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) = \frac{\sum_{i,j : i \neq j, i \neq v, j \neq v} \left(f(i,j,G) - f(i,j,G\setminus v)\right)}{\sum_{i,j : i \neq j, i \neq v, j \neq v} f(i,j,G)}.$$
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_{i,j : i \neq j, i \neq v, j \neq v} \frac{ \left(f(i,j,G) - f(i,j,G\setminus v)\right)}{f(i,j,G)}$$
where 0/0 flow ratios are treated as 0 (as in shortest-path betweenness). Setting `cmode=="fracflow"`

selects this variant.

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.

```
# NOT RUN {
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!
# }
```

Run the code above in your browser using DataLab