You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Jannik Rau <ra...@gmx.de> on 2021/11/08 20:48:43 UTC

GraphX Pregel: Access current iteration i

Hi all,  
  
I'm using the Pregel.apply function in an iterative graph algorithm.

In the algorithm, the update of a vertex's value is treated differently in the
first and last of the n total iterations.  
Calling Pregel.apply with maxIterations = 1, then with maxIterations = n - 2
and again with maxIterations = 1 results in three times going through the
initial procedure.  
If one could access the current iteration i, one could distinguish in the
vertex program, how to update a vertex's value.

I've searched for similar questions and came across this one:

https://mail-archives.apache.org/mod_mbox/spark-
user/201502.mbox/%3CCA+HOc9Nzp38SLMpB8R1Tpa_NB8ivfhCm8jHMM6VwON4O6x1L+A@mail.gmail.com%3E

The answer suggests to include the current iteration in every message, which
adds a lot of memory when working with large graphs.

Do you plan to adjust the apply function, or maybe refactor "var i" as an
object variable of the Pregel object?  
Or don't you plan to do this and rather recommend me using a different Graphx
utility, which is designed for such a scenario?

Thanks for any answer in advance!  
  
  
Kind Regards,



Jannik  
  


\--------------------------------------------------------------------- To
unsubscribe e-mail: user-unsubscribe@spark.apache.org