Index: branches/localSpectral/src/jung/Main.java
===================================================================
--- branches/localSpectral/src/jung/Main.java	(revision 27)
+++ branches/localSpectral/src/jung/Main.java	(revision 32)
@@ -1,13 +1,12 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
 
 package jung;
 
+import clustering.Edge;
 import clustering.LocalSpectral;
 import clustering.VertexScore;
+import clustering.VertexString;
 import data.GraphBuilder;
 import edu.uci.ics.jung.algorithms.scoring.PageRank;
+import edu.uci.ics.jung.graph.AbstractGraph;
 import edu.uci.ics.jung.graph.Graph;
 import edu.uci.ics.jung.graph.SparseGraph;
@@ -23,13 +22,20 @@
     public static void main(String[] args) {
        GraphBuilder builder = new GraphBuilder();
-       builder.buildGraphFromARFF("/home/luke/Desktop/reteSemplice.txt", 6000);
-       Graph<String, Integer> graph = builder.getGraph();
-       Viewer viewGraph = new Viewer(graph);
-       viewGraph.viewGraph(null);
-       LocalSpectral<String,Integer> clusterer = new LocalSpectral(graph);
+       builder.buildGraphFromARFF("/home/luke/Desktop/reteUtentiMikeHidden.arff", 1000);
+       //builder.buildGraphFromARFF("/home/luke/Desktop/reteSemplice.txt", 10000);
+       Graph<String, Edge<String>> graph = builder.getGraph();
+
+       LocalSpectral<String,Edge<String>> clusterer = new LocalSpectral(graph);
        List<VertexScore<String>> global_ranking = clusterer.getGlobalRank();
+
        System.out.println("GLOBAL RANKING");
        for(VertexScore<String> v : global_ranking)
-           System.out.println("VERTEX: "+v + " RANK "+v.getScore());
+           System.out.println(v.toString());
+       
+       Viewer viewGraph = new Viewer(graph);
+       viewGraph.viewGraphRank(global_ranking,null);
+       //viewGraph.viewGraph(null);
+
+       
        for(VertexScore<String> v : global_ranking){
            Long stoptime = 5000L; 
@@ -38,6 +44,23 @@
             } catch (InterruptedException e) {}
            List<String> cut = clusterer.clusterPageRankPriors(v.getVertex(),6);
-           viewGraph.viewGraph(cut);
+           Graph<String,Edge<String>> cut_graph = new SparseGraph<String, Edge<String>>();
+           for(String vertex : cut){
+               Collection<Edge<String>> out_edges = graph.getOutEdges(vertex);
+               for(Edge<String> edge : out_edges){
+                   String out_node = edge.getVertex2();
+                   if (cut.contains(out_node)){
+                       cut_graph.addEdge(edge, edge.getVertex1(),edge.getVertex2());
+                   }
+               }
+           }
+           viewGraph.setGraph(cut_graph);
+           viewGraph.viewGraph(null);
+           try {
+                Thread.sleep(stoptime);
+           } catch (InterruptedException e) {}
+           viewGraph.setGraph(graph);
+           viewGraph.viewGraphRank(global_ranking, null);
        }
+        
 
     }
