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:
- g
Graph Graph to be used. If it is directed, it is treated as undirected.
- Siterable of
VertexorVertexPropertyMap The vertex set, or a Boolean vertex property map that marks it.
- g
- Returns:
- is_minimal
bool Trueif \(S\) is a minimal separator.
- is_minimal
See also
is_separatorTest for vertex separators
all_minimal_separatorsAll minimal vertex separators
all_minimum_vertex_separatorsAll 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 (seeall_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