Index: src/main/java/weka/clusterers/forMetisMQI/GraphAlgorithms.java
===================================================================
--- src/main/java/weka/clusterers/forMetisMQI/GraphAlgorithms.java	(revision 20)
+++ src/main/java/weka/clusterers/forMetisMQI/GraphAlgorithms.java	(revision 21)
@@ -95,6 +95,6 @@
 //		Util.viewGraph(g);
 		for (int i = 0; i < numberOfCluster; i++) {
-//			Bisection partition = metis(g,sizeFinerGraph);
-			Bisection partition = new Bisection(g);
+			Bisection partition = metis(g,sizeFinerGraph);
+//			Bisection partition = new Bisection(g);
 			System.out.print("Partizione iniziale: ");
 			System.out.print("V1: " + partition.getSubgraph().getVertexCount());
Index: src/main/java/weka/clusterers/forMetisMQI/MQI.java
===================================================================
--- src/main/java/weka/clusterers/forMetisMQI/MQI.java	(revision 20)
+++ src/main/java/weka/clusterers/forMetisMQI/MQI.java	(revision 21)
@@ -16,8 +16,8 @@
 import weka.clusterers.forMetisMQI.graph.Node;
 import weka.clusterers.forMetisMQI.graph.Subgraph;
-import weka.clusterers.forMetisMQI.util.Util;
 import edu.uci.ics.jung.algorithms.flows.EdmondsKarpMaxFlow;
 import edu.uci.ics.jung.graph.DirectedGraph;
 import edu.uci.ics.jung.graph.DirectedSparseGraph;
+import weka.clusterers.forMetisMQI.util.Util;
 
 public class MQI {
@@ -88,8 +88,5 @@
 			a = A.getVertexCount();
 		else {
-			Iterator<Node> aIterator = A.iterator();
-			while(aIterator.hasNext()) {
-				a += bisection.getGraph().degree(aIterator.next());
-			}
+			a = Math.min(B.totalDegree(),A.totalDegree());
 		}
 		int c = bisection.edgeCut() / 2;
@@ -195,13 +192,10 @@
 						* bisection.edgeCut() / 2;
 			else {
-				Iterator<Node> aIterator = bisection.getLargerSubgraph().iterator();
-				maxFlowThreshold = 0;
-				while(aIterator.hasNext())
-					maxFlowThreshold += partition.getGraph().degree(aIterator.next());
+				maxFlowThreshold = Math.min(bisection.getLargerSubgraph().totalDegree(), bisection.getSmallerSubgraph().totalDegree());
 				maxFlowThreshold = maxFlowThreshold
 						* (bisection.edgeCut() / 2);
 			}
 			alg.evaluate();
-//			Util.viewFlowGraph(directedGraph, edgeFlowMap);
+			Util.viewFlowGraph(directedGraph, edgeFlowMap);
 			System.out.println("MAX FLOW: " + alg.getMaxFlow() + " THRESHOLD: "
 					+ maxFlowThreshold);
