vertex_expansion#
- graph_tool.structure.vertex_expansion(g, S)[git][source]#
Return the vertex expansion of a set of vertices.
- Parameters:
- g
Graph Graph to be used.
- Siterable of
intorVertexPropertyMap Set of vertices, as a sequence of vertices or a Boolean vertex property map.
- g
- Returns:
- x
float The vertex expansion.
- x
See also
boundary_expansionBoundary size normalized by the size of the set
edge_expansionEdge counterpart
vertex_boundaryVertex boundary of a set of vertices
Notes
The vertex expansion is \(|N(S)|/|S|\), where \(N(S)\) is the set of (out-)neighbors of the vertices in \(S\) (which may include vertices of \(S\)). The time is \(O(V + E)\).
Examples
>>> g = gt.collection.data["karate"] >>> print(gt.vertex_expansion(g, [0, 1, 2])) 7.333333333333...