Static PageRank

staticPageRank runs for a defined number of iterations to calculate the page rank. Here is the signature of static PageRank operations:

staticPageRank (int numIter, double resetProb)

This method requires two arguments. The first argument is the number of iterations needed to be executed to calculate the page rank and the second parameter is the reset probability that is used to calculate the damping factor in PageRank and its value should be 0.0<resetProb<1.0. Please refer to http://infolab.stanford.edu/~backrub/google.html to get details about the damping factor.

The static page rank on the graph can be executed as follows:

Graph<Object, Object> graphWithStaticRanking = graph.ops().staticPageRank(1,0.20);

This operation results in a graph that contains vertices with their ranking. To find the ranks, vertices' elements can be printed as follows:

graphWithStaticRanking.vertices().toJavaRDD().collect().forEach(System.out::println);

Considering the graph example provided in this chapter, vertex 3 should be ranked as the highest.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.51.36