At 2014-11-13 21:28:52 +0000, "Ommen, Jurgen" <omme0...@stthomas.edu> wrote: > I'm using GraphX and playing around with its PageRank algorithm. However, I > can't see from the documentation how to use edge weight when running PageRank. > Is this possible to consider edge weights and how would I do it?
There's no built-in way to prefer certain edges over others; edge weights are just set to the inverse of the outdegree of the source vertex. But it's simple to modify the PageRank code [1] to use custom edge weights instead: (1) copy the PageRank.run method body to your own project, (2) change the type signature of the input graph from Graph[VD, ED] to Graph[VD, Double], and (3) remove the calls to outerJoinVertices and mapTriplets on line 86 and 88. Ankur [1] https://github.com/apache/spark/blob/master/graphx/src/main/scala/org/apache/spark/graphx/lib/PageRank.scala#L79 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional commands, e-mail: user-h...@spark.apache.org