I'm trying to use PageRank and Hits algorithm on a DirectedSparseGraph I have build from a Wikipedia Dump. The graph is huge obviously and its nodes are String, while its Edge are Integer. The problem is that when I run this code:
PageRank<String,Integer> pageRank = new PageRank<String,Integer>(w, alpha);
pageRank.initialize();
pageRank.setTolerance(0.000001);
pageRank.setMaxIterations(200);
pageRank.evaluate();
HITS<String, Integer> hits = new HITS<String, Integer>(w,alpha);
hits.initialize();
hits.setTolerance(0.000001);
hits.setMaxIterations(200);
hits.evaluate();
for(String s: w.getVertices()){
writer.write(s + "\th:" + hits.getVertexScore(s).hub + "\ta:" + hits.getVertexScore(s).authority + "\tpagerank:" + pageRank.getVertexScore(s));
writer.newLine();
}
the results I'm writing on the file txt are always the same for each Node. Maybe I am making a mistake with parameters I pass the methods. I don't know.