is_separator#
- graph_tool.flow.is_separator(g, S)[git][source]#
Test whether a set of vertices is a 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_separator
bool Trueif \(S\) is a separator.
- is_separator
See also
is_minimal_separatorTest for minimal vertex separators
all_minimal_separatorsAll minimal vertex separators
Notes
The set \(S\) is a separator if there are two vertices not in \(S\) that are connected in the graph, but not after the vertices of \(S\) are removed (so that a graph that is already disconnected is not separated by the empty set). 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_separator(g, [1]), gt.is_separator(g, [2])) True False