Last active
March 14, 2016 16:52
-
-
Save s1ck/801a8ef97ce374b358df to your computer and use it in GitHub Desktop.
Example PageRank with custom scatter gather conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// your code to create vertices and edges | |
Graph<Long, Double, Double> graph = Graph.fromDataSet(vertices, edges, env); | |
ScatterGatherConfiguration conf = new ScatterGatherConfiguration(); | |
conf.setSolutionSetUnmanagedMemory(true); | |
long vertexCount = graph.numberOfVertices(); | |
Graph<Long, Double, Double> ranks = graph.runScatterGatherIteration( | |
new PageRank.VertexRankUpdater<>(0.85, vertexCount), | |
new PageRank.RankMessenger<>(vertexCount), | |
5, | |
conf); | |
ranks.getVertices().print(); |
Hi, in 0.10.2 it's
VertexCentricConfiguration conf = new VertexCentricConfiguration();
conf.setSolutionSetUnmanagedMemory(true);
long vertexCount = graph.numberOfVertices();
Graph<Long, Double, Double> ranks = graph.runVertexCentricIteration(
new PageRank.VertexRankUpdater<>(0.85, vertexCount),
new PageRank.RankMessenger<>(vertexCount), 5, conf);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using this:
DataSet<Vertex<Long, Double>> result = inputGraph.run(new PageRank(0.85, numberIterations));
result.writeAsCsv(outputPath, "\n", " ", WriteMode.OVERWRITE);
I don't have runScatterGatherIteration, my version is 0.10.
Is your code using 1.0 version?