is_minimal_separator

is_minimal_separator#

graph_tool.flow.is_minimal_separator(g, S)[git][source]#

Test whether a set of vertices is a minimal separator of the graph.

Parameters:
gGraph

Graph to be used. If it is directed, it is treated as undirected.

Siterable of Vertex or VertexPropertyMap

The vertex set, or a Boolean vertex property map that marks it.

Returns:
is_minimalbool

True if \(S\) is a minimal separator.

See also

is_separator

Test for vertex separators

all_minimal_separators

All minimal vertex separators

all_minimum_vertex_separators

All minimum vertex separators

Notes

A separator (see is_separator()) is minimal if none of its proper subsets is a separator. This is the case if and only if \(S\) lies within a single connected component \(K\) of the graph, and \(K - S\) has at least two components, all of which are adjacent to every vertex of \(S\), since if a component missed a vertex \(x \in S\), then \(S - x\) would still separate it from the others. This is stricter than being a minimal \(s\)-\(t\) separator for some pair of vertices (see all_minimal_separators()), which requires only two such components. The test takes time \(O(V + E)\).

Examples

>>> g = gt.Graph([(0, 1), (1, 2), (2, 3), (3, 4), (4, 1)], directed=False)
>>> print(gt.is_minimal_separator(g, [1]), gt.is_minimal_separator(g, [1, 3]))
True False