Here's a usage example:
Consider the graph appearing at
The weights matrix is
W = [Inf,7,9,Inf,Inf,14;7,Inf,10,15,Inf,Inf;9,10,Inf,11,Inf,2;Inf,15,11,Inf,6,Inf;Inf,Inf,Inf,6,Inf,9;14,Inf,2,Inf,9,Inf;];
If we want to find the minimal cut such that vertices 1 and 5 are on the same side of the graph:
[MinCutGroupsList, MinCutWeight] = MinCut([1 5], W)
2 3 4 0 0 0
1 5 6 0 0 0
MinCutWeight = 24
- Vertices 2,3,4 are on one side of the cut
- Vertices 1,5,6 are on the other side.
- The sum of weights along the cut is 24.
A few farther notes:
- Zero entries for a missing edges also works.
- The weights matrix must be symmetric. Directed edges are not supported.