- Timestamp:
- Sep 30, 2010, 5:33:45 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/weka/clusterers/forMetisMQI/GraphAlgorithms.java
r18 r20 81 81 */ 82 82 static public Set<Set<Node>> metisMqi(UndirectedGraph g, int numberOfCluster, int sizeFinerGraph) { 83 System.out.println("V ERTEX: " + g.getVertexCount());84 System.out.println("E DGE: " + g.getEdgeCount());83 System.out.println("Vertex count: " + g.getVertexCount()); 84 System.out.println("Edges count: " + g.getEdgeCount()); 85 85 Iterator<Node> iNodes = g.getVertices().iterator(); 86 86 int degreeCounter = 0; … … 95 95 // Util.viewGraph(g); 96 96 for (int i = 0; i < numberOfCluster; i++) { 97 Bisection partition = metis(g,sizeFinerGraph); 98 System.out.println("Partizione iniziale (Metis)"); 99 // System.out.println("Edge-cut: " + partition.edgeCut() / 2); 97 // Bisection partition = metis(g,sizeFinerGraph); 98 Bisection partition = new Bisection(g); 99 System.out.print("Partizione iniziale: "); 100 System.out.print("V1: " + partition.getSubgraph().getVertexCount()); 101 System.out.print(" V2: " + partition.getComplement().getVertexCount()); 102 System.out.println(" EC: " + partition.edgeCut() * 0.5); 100 103 System.out.println("Conductance: " + 101 104 ((double)partition.edgeCut() / 2) / Math.min(partition.getSubgraph().totalDegree(),partition.getComplement().totalDegree())); … … 107 110 Bisection mqiBisection = new Bisection(new Subgraph(g,cluster)); 108 111 System.out.println("Partizione raffinata (MQI)"); 109 // System.out.println("Edge-cut: " + mqiBisection.edgeCut() / 2);110 112 double newConductance = ((double)mqiBisection.edgeCut() / 2) / Math.min(mqiBisection.getSubgraph().totalDegree(),mqiBisection.getComplement().totalDegree()); 111 113 System.out.println("Conductance: " + newConductance); … … 117 119 } 118 120 121 System.out.println(); 119 122 Iterator<Node> clustersNode = cluster.iterator(); 120 123 while(clustersNode.hasNext()){
Note: See TracChangeset
for help on using the changeset viewer.