volume#

volume(G, S, weight=None)[source]#

Returns the volume of a set of nodes.

The volume of a set S is the sum of the (out-)degrees of nodes in S (taking into account parallel edges in multigraphs). [1]

Parameters:
GNetworkX graph
Scollection

A collection of nodes in G.

weightobject

Edge attribute key to use as weight. If not specified, edges have weight one.

Returns:
number

The volume of the set of nodes represented by S in the graph G.

References


Additional backends implement this function

graphblas : OpenMP-enabled sparse linear algebra backend.