问题
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