Beispiel #1
0
  public void countMinCuts(int n) throws IOException {
    MinCut minCut = new MinCut();
    minCut.readAdjList();

    for (int i = 1; i <= n; i++) {
      minCut.createCopy();
      minCut.contract();
      int thisCut = minCut.countEdges();
      if (min > thisCut) {
        min = thisCut;
      }
      System.out.println("The " + i + "th try: " + thisCut + " Min cut: " + min);
    }
  }
Beispiel #2
0
 public static void main(String[] args) throws IOException {
   // TODO Auto-generated method stub
   MinCut minCut = new MinCut();
   minCut.countMinCuts(10);
 }