Index: branches/localSpectral/nbproject/private/private.properties
===================================================================
--- branches/localSpectral/nbproject/private/private.properties	(revision 29)
+++ branches/localSpectral/nbproject/private/private.properties	(revision 32)
@@ -1,2 +1,6 @@
 compile.on.save=true
+do.depend=false
+do.jar=true
+javac.debug=true
+javadoc.preview=true
 user.properties.file=/home/luke/.netbeans/6.9/build.properties
Index: branches/localSpectral/nbproject/project.properties
===================================================================
--- branches/localSpectral/nbproject/project.properties	(revision 29)
+++ branches/localSpectral/nbproject/project.properties	(revision 32)
@@ -1,8 +1,8 @@
 annotation.processing.enabled=true
 annotation.processing.enabled.in.editor=false
-annotation.processing.processor.options=
-annotation.processing.processors.list=
 annotation.processing.run.all.processors=true
 annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=Jung
+application.vendor=luke
 build.classes.dir=${build.dir}/classes
 build.classes.excludes=**/*.java,**/*.form
@@ -25,4 +25,5 @@
 dist.jar=${dist.dir}/Jung.jar
 dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
 excludes=
 file.reference.collections-generic-4.01.jar=/home/luke/Desktop/jung2-2_0_1/collections-generic-4.01.jar
@@ -78,5 +79,5 @@
 # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
 # or test-sys-prop.name=value to set system properties for unit tests):
-run.jvmargs=
+run.jvmargs=-Xms1G
 run.test.classpath=\
     ${javac.test.classpath}:\
Index: branches/localSpectral/src/clustering/LocalSpectral.java
===================================================================
--- branches/localSpectral/src/clustering/LocalSpectral.java	(revision 29)
+++ branches/localSpectral/src/clustering/LocalSpectral.java	(revision 32)
@@ -85,14 +85,8 @@
 
         Collections.sort(vertexsScore,new VertexScoreComparator());
-        
-        double sum=0;
-        for(VertexScore<V> v : vertexsScore){
-            System.out.println(v.getVertex().toString()+ " " + v.getScore());
-            sum+=v.getScore();
-        }
-        System.out.println("SUM SCORES: "+sum);
+
+        System.out.println("\n\nClustering with prior seed: "+seed.toString());
         
         int volume_graph = 2 * graph.getEdgeCount();
-        System.out.println("GRAPH VOLUME: " + volume_graph);
         double max_volume = (volume_graph / 3) * 2;
         double min_conductance_subset=100;
@@ -101,5 +95,4 @@
         int subsets_count = vertexsScore.size();
         for(int i=0; i<subsets_count; i++){
-            System.out.println("i="+i);
             int volume_subset = 0;
             ArrayList<V> subset = new ArrayList<V>();
@@ -127,13 +120,17 @@
                     }
                 }
-                System.out.println("CONDUCTANCE: "+conductance + " minvolume: "+minvolume + " edge_boundary: "+edge_boundary);
+                //System.out.println("CONDUCTANCE: "+conductance + " minvolume: "+minvolume + " edge_boundary: "+edge_boundary);
             }
 
         }
-        System.out.println("MIN CONDUCTANCE: "+min_conductance_subset + " INDEX "+min_conductance_index );
+        System.out.println("MIN CONDUCTANCE: "+min_conductance_subset);
 
+        System.out.println("CLUSTER: ");
         List<V> cluster = new ArrayList<V>();
         for(int i=0; i< min_conductance_index; i++)
             cluster.add(vertexsScore.get(i).getVertex());
+
+        for(V node : cluster)
+            System.out.println(node.toString());
        
         return cluster;
Index: branches/localSpectral/src/data/GraphBuilder.java
===================================================================
--- branches/localSpectral/src/data/GraphBuilder.java	(revision 29)
+++ branches/localSpectral/src/data/GraphBuilder.java	(revision 32)
@@ -2,4 +2,6 @@
 package data;
 
+import clustering.Edge;
+import clustering.VertexString;
 import edu.uci.ics.jung.graph.Graph;
 import edu.uci.ics.jung.graph.SparseGraph;
@@ -16,14 +18,14 @@
 
 
-public class GraphBuilder<V,E> {
+public class GraphBuilder {
 
-    Graph<String,Integer> graph;
+    Graph<String,Edge<String>> graph;
 
     public GraphBuilder(){
-        graph = new SparseGraph<String, Integer>();
+        graph = new SparseGraph<String, Edge<String>>();
 
     }
 
-    public Graph<String, Integer> getGraph() {
+    public Graph<String, Edge<String>> getGraph() {
         return graph;
     }
@@ -45,5 +47,5 @@
                     String[] splitted = read.trim().split(",");
                     vertex.addAll(Arrays.asList(splitted));
-                    graph.addEdge(edge, splitted[0], splitted[1]);
+                    graph.addEdge(new Edge<String>(splitted[0], splitted[1]), splitted[0], splitted[1]);
                     edge++;
                 }
Index: branches/localSpectral/src/jung/Main.java
===================================================================
--- branches/localSpectral/src/jung/Main.java	(revision 29)
+++ 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);
        }
+        
 
     }
Index: branches/localSpectral/src/view/VertexPaintTransformer.java
===================================================================
--- branches/localSpectral/src/view/VertexPaintTransformer.java	(revision 29)
+++ branches/localSpectral/src/view/VertexPaintTransformer.java	(revision 32)
@@ -18,6 +18,8 @@
 
     public Paint transform(V node) {
-      if(cluster.contains(node))
-         return (Paint) Color.GREEN;
+      if(cluster.contains(node)){
+         Color c = new Color(0,255,0);
+         return (Paint) c;
+      }
       else
          return (Paint) Color.RED;
Index: branches/localSpectral/src/view/Viewer.java
===================================================================
--- branches/localSpectral/src/view/Viewer.java	(revision 29)
+++ branches/localSpectral/src/view/Viewer.java	(revision 32)
@@ -2,4 +2,6 @@
 package view;
 
+import clustering.VertexScore;
+import clustering.VertexString;
 import edu.uci.ics.jung.algorithms.layout.FRLayout;
 import edu.uci.ics.jung.algorithms.layout.Layout;
@@ -8,4 +10,5 @@
 import java.awt.Color;
 import java.awt.Dimension;
+import java.awt.LayoutManager;
 import java.awt.Paint;
 import java.util.ArrayList;
@@ -34,4 +37,20 @@
     }
 
+    public void setGraph(Graph<V, E> graph) {
+        this.graph = graph;
+        layout.setGraph(graph);
+        frame.repaint();
+    }
+    
+    public void viewGraphRank(List<VertexScore<V>> pagerank, List<V> cluster){
+         VertexPaintRankTransformer vertexPaint = new VertexPaintRankTransformer(pagerank,cluster);
+         vv.getRenderContext().setVertexFillPaintTransformer((Transformer<V, Paint>) vertexPaint);
+         
+         frame.getContentPane().add(vv);
+         frame.pack();
+         frame.repaint();
+         frame.setVisible(true);
+    }
+
 
     public void viewGraph(List<V> cut){
