project-flink/flink-graph — pull request #11 by vasia (2014-11-18 22:45:30+00:00)
Title: vertex-centric and other iterations

Hi all,

I have replaced the `passMessages` method with `runVertexCentricIteration`, which simply takes a vertex update function and a message function and runs a spargel iteration. Let me know what you think.

Also, I was thinking it would be nice to implement bulk and delta iterations ifor graphs in general. Basically, I want to port my fixpoint api to the graph api. What I have in mind is something like this:
- `graph.iterate(stepFunction, maxIterations)`: iteratively apply the `stepFunction` to all vertices of the graph, for `maxIterations`. The `stepFunction` is computed over all the in-neighbors of each vertex.

- `graph.iterateIncremental(stepFunction, maxIterations)`: iteratively apply the `stepFunction` to all vertices of the graph, for `maxIterations`, using a `DeltaIteration`. The `stepFunction` is computed over changed in-neighbors of each vertex.

- `graph.iterateDelta(stepFunction, deltaInput, deltaUpdate, deltaEquals, maxIterations)`: iteratively apply the `stepFunction` to all vertices of the graph, for `maxIterations`, using a `DeltaIteration`. The `stepFunction` is computed over changed in-neighbors of each vertex, using _deltas_. Here, the user should also provide three additional functions:

`deltaInput` defines how to produce the initial input to the delta iteration,

`deltaUpdate` defines how to produce the next solution set and

`deltaEquals` defines when two values are considered equal, at the end of a delta iteration.

I have some examples of how these look like in the fixpoint api [here] (https://github.com/vasia/incubator-flink/tree/dependency-common-neighbors/flink-fixpoint/src/main/java/org/apache/flink/fixpoint/examples).

What do you think?

Cheers,
V.