How to use PageRank algorithm in JUNG?

雨燕双飞 提交于 2019-12-08 05:40:58

问题


I am using JUNG as my tool to visualize network graph and compute network attributes(ex: indegree, outdegree, and pagerank).

I know JUNG already implemented PageRank algorithm, but there were no instruction on using pagerank algorithm in the manual(http://jung.sourceforge.net/doc/index.html).

Does anyone knows how to do it?

I also tried the following code, but it came out an error "Vertex CLP Holdings Ltd not an element of this graph".

public void calcPageRank()
{
   PageRank<MyNode, MyLink> alg = new PageRank<MyNode, MyLink>(g,0.1);
   alg.initialize();
   System.out.println(alg.getVertexScore(new MyNode(53084,"CLP Holdings Ltd")));    
}

code file is here

THX!!


回答1:


Example here:

  • https://github.com/castagna/mr-pagerank/blob/master/src/main/java/com/talis/labs/pagerank/jung/JungPageRank.java


来源:https://stackoverflow.com/questions/9757262/how-to-use-pagerank-algorithm-in-jung

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!