average_vertex_connectivity#
- graph_tool.flow.average_vertex_connectivity(g, approx=False)[git][source]#
Compute the average number of internally vertex-disjoint paths between the pairs of vertices.
- Parameters:
- g
Graph Graph to be used.
- approx
bool(optional, default:False) If
True, the fast lower bound described inall_pairs_vertex_connectivity()is used.
- g
- Returns:
- kappa
float The average connectivity.
- kappa
See also
vertex_connectivityVertex connectivity
all_pairs_vertex_connectivityVertex connectivity of all pairs
Notes
The average connectivity [beineke-average-2002] is
\[\bar\kappa = \frac{1}{V(V-1)}\sum_{s\neq t}\kappa(s,t),\]where \(\kappa(s,t)\) is the maximum number of internally vertex-disjoint paths from \(s\) to \(t\) (see
all_pairs_vertex_connectivity()), and the sum runs over the ordered pairs. Unlike the vertex connectivity (seevertex_connectivity()), it is not determined by the weakest pair. The values are computed as inall_pairs_vertex_connectivity(), in parallel, and without storing them, in time \(O(\bar\kappa V^2 E)\).Parallel edges and self-loops are ignored.
Parallel implementation.
If enabled during compilation, this algorithm will run in parallel using OpenMP. See the parallel algorithms section for information about how to control several aspects of parallelization.
References
[beineke-average-2002]Lowell W. Beineke, Ortrud R. Oellermann and Ronald E. Pippert, “The average connectivity of a graph”, Discrete Mathematics 252, 31-45 (2002), DOI: 10.1016/S0012-365X(01)00180-7 [sci-hub, @tor]
Examples
>>> g = gt.collection.data["karate"] >>> print(gt.average_vertex_connectivity(g)) 2.2174688...