|
Calling Sequence
|
|
MinCut(G, s, t)
|
|
Parameters
|
|
G
|
-
|
graph
|
s, t
|
-
|
vertices of the graph
|
|
|
|
|
Options
|
|
|
The flow matrix from computing the MaxFlow from s to t, this allows MinCut to skip calling MaxFlow, and to just calculate the cut using the pre-computed flows.
|
|
The values to be returned from the calculation. Valid values are size, cutset, partition, or a list of any combination of those. The default is cutset.
|
|
|
Description
|
|
•
|
The MinCut command finds a minimal cut of G that separates s and t, that is, a removal of edges so that t is no longer reachable from s. The cut is minimal in the sense that the sum of the weights of the edges removed is as low as possible.
|
•
|
In the case that t is not reachable from s in G, no work is done and the cut-set is considered to be .
|
•
|
Otherwise, the minimal cut is computed using MaxFlow per the Max-Flow Min-Cut Theorem which says that the total weight of the minimal cut is the same as the value of the maximal flow between two vertices.
|
•
|
If G is not a weighted graph then every edge is treated as having a weight of 1, and thus the minimal cut is minimal in the sense of the number of edges cut.
|
•
|
For undirected graphs, the cut always disconnects the graph, but for directed graphs, IsConnected may still return true. However, even in directed graphs, IsReachable will always show that t can no longer be reached from s after the cut is made.
|
•
|
Note that the size of the minimal cut is unique, but there may be many possible choices of cut-sets that achieve the minimum size.
|
•
|
By default, the output is a cut-set as a set of edges. By using the output option, the size of the cut-set, or the induced partition on the vertices can be returned instead. The induced partition is two sets of vertices, the first is the set of all vertices reachable from s, and the second is the set of vertices from which t is reachable; they are always disjoint.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
>
|
|
>
|
|
MinCut can also be used on a precomputed flow
>
|
|
| (8) |
>
|
|
>
|
|
| (9) |
>
|
|
| (10) |
| (12) |
>
|
|
>
|
|
>
|
|
Notice that after removing the cut-set, the graph is still connected as an undirected graph.
>
|
|
|
|
Compatibility
|
|
•
|
The GraphTheory[MinCut] command was introduced in Maple 2024.
|
|
|
|