@Override public DataSet<Vertex<K, Double>> run(Graph<K, Double, Double> network) throws Exception { DataSet<Tuple2<K, LongValue>> vertexOutDegrees = network.outDegrees(); Graph<K, Double, Double> networkWithWeights = network .joinWithEdgesOnSource(vertexOutDegrees, new InitWeights()); GSAConfiguration parameters = new GSAConfiguration(); parameters.setOptNumVertices(true); return networkWithWeights.runGatherSumApplyIteration(new GatherRanks(), new SumRanks(), new UpdateRanks<>(beta), maxIterations, parameters) .getVertices(); }