for more information about simrank, see Article http://www.cnblogs.com/youwang/archive/2010/02/06/1665105.html. The following is a Java Code implementation that uses the webgraph library.
/** To change this template, choose tools | templates * and open the template in the editor. */package cn.edu. dlut. wisdom; import it. unimi. DSI. fastutil. ints. *; import it. unimi. DSI. webgraph. *;/***** @ author you wang */public class simrank {private immutablegraph; private immutablegraph igraph; private double dampening = 0.85; private int2objectarraymap <int2doublearraymap> scores; public double getdampening () {return dampening;} public void setdampening (double dampening) {This. dampening = dampening;} public simrank (immutablegraph graph) {This. graph = graph; this. igraph = transform. transpose (graph);} public simrank (immutablegraph graph, immutablegraph igraph) {This. graph = graph; this. igraph = igraph;} public void computesimrank () {int n = graph. numnodes (); int iter = (INT) math. ABS (math. log (double) N)/math. log (double) 10) + 1; computesimrank (ITER);} public int2learraymap getsimrank (int I) {return scores. get (I);} public int2objectarraymap getsimrank () {return scores;} public double getsimrank (int I, Int J) {return scores. get (I ). get (j);} public void computesimrank (int iter) {// initialize int numnodes = graph. numnodes (); this. scores = new int2objectarraymap <int2doublearraymap> (numnodes); For (INT I = 0; I <numnodes; I ++) {int2doublearraymap aux = new int2doublearraymap (numnodes ); for (Int J = 0; j <numnodes; j ++) {if (I = J) Aux. put (J, 1); else aux. put (J, 0);} scores. put (I, AUX);} // while (ITER --> 0) for Iterative Computing {for (INT I = 0; I <numnodes; I ++) {int numinneighborsi = igraph. outdegree (I); If (numinneighborsi = 0) continue; int [] inneighborsi = igraph. successorarray (I); int2doublearraymap rimap = scores. get (I); For (Int J = 0; j <numnodes; j ++) {int numinneighborsj = igraph. outdegree (j); If (numinneighborsj = 0) continue; int [] inneighborsj = igraph. successorarray (j); double Rab = 0; For (int A: inneighborsi) {int2doublearraymap aux = scores. get (a); For (int B: inneighborsj) {Rab + = aux. get (B) ;}} Rab * = dampening/(numinneighborsi * numinneighborsj); rimap. put (J, Rab );}}}}}