// Collect results - into memory ... This may consume a lot of memory.
// It would be better to have an iterator for the vertex data.
VertexAggregator.foreach(engine.numVertices(), graphName, new FloatPairConverter(), new ForeachCallback<FloatPair>() {
public void callback(int vertexId, FloatPair vertexValue) {
if (vertexValue.first > 0) {
results.add(new IdFloat(engine.getVertexIdTranslate().backward(vertexId), vertexValue.first));
}
}
});
engine = null;
resultIter = results.iterator();