On Mon, Jul 21, 2014 at 8:05 PM, Bin WU <bw...@connect.ust.hk> wrote:
> I am not sure how to specify different initial values to each node in the > graph. Moreover, I am wondering why initial message is necessary. I think > we can instead initialize the graph and then pass it into Pregel interface? Indeed it's not necessary, and a future update to Pregel will probably remove it: https://github.com/apache/spark/pull/1217 But the initial message parameter doesn't prevent you from specifying different initial *values* for each vertex. Pregel respects the initial vertex values of the provided graph; the initial message just ensures that it will run vprog at least once per vertex. If you don't want an initial message, one option is to set aside a special message value for it and check for this in vprog. For example, if the message type is Int, you could change it to Option[Int] and use None as the initial message. Ankur <http://www.ankurdave.com/>