- Timestamp:
- Sep 23, 2010, 10:32:44 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/weka/clusterers/forMetisMQI/GraphAlgorithms.java
r16 r17 2 2 3 3 import java.util.HashSet; 4 import java.util.Iterator; 4 5 import java.util.Set; 5 6 import java.util.Stack; … … 57 58 static public Set<Set<Node>> metisMqi(UndirectedGraph g, int numberOfCluster, int sizeFinerGraph) { 58 59 Set<Set<Node>> clusters = new HashSet<Set<Node>>(); 59 Util.viewGraph(g); 60 UndirectedGraph gclone = g.clone(); 61 // Util.viewGraph(g); 60 62 for (int i = 0; i < numberOfCluster; i++) { 61 63 Bisection partition = metis(g,sizeFinerGraph); 62 64 Set<Node> cluster = MQI.mqi(partition); 63 clusters.add(cluster); 65 Iterator<Node> clustersNode = cluster.iterator(); 66 while(clustersNode.hasNext()){ 67 g.removeVertex(clustersNode.next()); 68 } 69 70 71 if(cluster.size()>10) { 72 clusters.add(cluster); 73 } 64 74 System.out.println("CLUSTER "+ i + ": " + cluster); 65 75 } 66 Util.viewClusters(g , clusters);76 Util.viewClusters(gclone, clusters); 67 77 return clusters; 68 78 }
Note: See TracChangeset
for help on using the changeset viewer.