Changeset 22 for src/main/java/weka/clusterers/forMetisMQI/MQI.java
- Timestamp:
- Oct 5, 2010, 5:14:37 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/weka/clusterers/forMetisMQI/MQI.java
r21 r22 82 82 static private DirectedGraph<Node, Edge> prepareDirectedGraph( 83 83 Bisection bisection, Node source, Node sink, boolean forConductance) { 84 Subgraph A= bisection.getLargerSubgraph();85 Subgraph B= bisection.getSmallerSubgraph();84 Subgraph B = bisection.getLargerSubgraph(); 85 Subgraph A = bisection.getSmallerSubgraph(); 86 86 int a = 0; 87 87 if (!forConductance) 88 88 a = A.getVertexCount(); 89 89 else { 90 a = Math.min(B.totalDegree(),A.totalDegree()); 90 // a = Math.min(B.totalDegree(),A.totalDegree()); 91 a = A.totalDegree(); 91 92 } 92 93 int c = bisection.edgeCut() / 2; … … 140 141 Node u = nodes.next(); 141 142 if(forConductance) 142 //FIXME: CONTROLLAMI143 143 g.addEdge(new Edge(Integer.toString(id), 1, c * bisection.getGraph().degree(u)), u, sink); 144 144 else … … 161 161 boolean finished = false; 162 162 Bisection bisection = partition; 163 Set<Node> cluster = new HashSet<Node>(partition.get LargerSubgraph()163 Set<Node> cluster = new HashSet<Node>(partition.getSmallerSubgraph() 164 164 .createInducedSubgraph().getVertices()); 165 // System.out.println("IMPROVING SUBGRAPH: " + cluster); 165 166 int maxFlowThreshold = Integer.MAX_VALUE; 166 167 while (!finished) { … … 192 193 * bisection.edgeCut() / 2; 193 194 else { 194 maxFlowThreshold = Math.min(bisection.getLargerSubgraph().totalDegree(), bisection.getSmallerSubgraph().totalDegree()); 195 // maxFlowThreshold = Math.min(bisection.getLargerSubgraph().totalDegree(), bisection.getSmallerSubgraph().totalDegree()); 196 maxFlowThreshold = bisection.getSmallerSubgraph().totalDegree(); 195 197 maxFlowThreshold = maxFlowThreshold 196 198 * (bisection.edgeCut() / 2); 197 199 } 198 200 alg.evaluate(); 199 Util.viewFlowGraph(directedGraph, edgeFlowMap);201 // Util.viewFlowGraph(directedGraph, edgeFlowMap); 200 202 System.out.println("MAX FLOW: " + alg.getMaxFlow() + " THRESHOLD: " 201 203 + maxFlowThreshold); … … 207 209 bisection = new Bisection(new Subgraph( 208 210 bisection.getGraph(), cluster)); 211 // System.out.println("REFINED BISECTION: " + bisection.toString()); 209 212 } else 210 213 finished = true;
Note: See TracChangeset
for help on using the changeset viewer.