source: branches/localSpectral/src/jung/Main.java @ 27

Last change on this file since 27 was 27, checked in by toshi, 14 years ago

creato il branch local spectral

File size: 1.4 KB
RevLine 
[27]1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5
6package jung;
7
8import clustering.LocalSpectral;
9import clustering.VertexScore;
10import data.GraphBuilder;
11import edu.uci.ics.jung.algorithms.scoring.PageRank;
12import edu.uci.ics.jung.graph.Graph;
13import edu.uci.ics.jung.graph.SparseGraph;
14import java.awt.Paint;
15import java.util.ArrayList;
16import java.util.Collection;
17import java.util.List;
18import view.VertexPaintTransformer;
19import view.Viewer;
20
21public class Main {
22
23    public static void main(String[] args) {
24       GraphBuilder builder = new GraphBuilder();
25       builder.buildGraphFromARFF("/home/luke/Desktop/reteSemplice.txt", 6000);
26       Graph<String, Integer> graph = builder.getGraph();
27       Viewer viewGraph = new Viewer(graph);
28       viewGraph.viewGraph(null);
29       LocalSpectral<String,Integer> clusterer = new LocalSpectral(graph);
30       List<VertexScore<String>> global_ranking = clusterer.getGlobalRank();
31       System.out.println("GLOBAL RANKING");
32       for(VertexScore<String> v : global_ranking)
33           System.out.println("VERTEX: "+v + " RANK "+v.getScore());
34       for(VertexScore<String> v : global_ranking){
35           Long stoptime = 5000L; 
36           try {
37                Thread.sleep(stoptime);
38            } catch (InterruptedException e) {}
39           List<String> cut = clusterer.clusterPageRankPriors(v.getVertex(),6);
40           viewGraph.viewGraph(cut);
41       }
42
43    }
44
45
46}
Note: See TracBrowser for help on using the repository browser.