boundary_expansion#
- graph_tool.structure.boundary_expansion(g, S)[git][source]#
Return the boundary 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 boundary expansion.
- x
See also
vertex_expansionSize of the neighborhood normalized by the size of the set
vertex_boundaryVertex boundary of a set of vertices
Notes
The boundary expansion is \(|\partial S|/|S|\), where \(\partial S\) is the vertex boundary of \(S\), i.e. the (out-)neighbors of the vertices in \(S\) that are not in \(S\) (see
vertex_boundary()). The time is \(O(V + E)\).Examples
>>> g = gt.collection.data["karate"] >>> print(gt.boundary_expansion(g, [0, 1, 2])) 6.333333333333...