Is it guaranteed that the messages passed to the same node but with different keys follow the same order?

For example, if the message passing function is:

def message(edges):
    return {'f1': edges.src['f1'], 'f2': edges.dst['f2']}

In the reduce function, is it guaranteed that nodes.mailbox['f1'][i] and nodes.mailbox['f2'][i] are from the same edge?

I have tested on a small graph and found they were from the same edge, but I want to know whether that holds in general.

Yes. It’s guaranteed.

1 Like

Thank you for the confirmation!

Then what is the order be like in mailbox[β€˜f1’] and mailbox[β€˜f2’]? Will it the same as the order we added edges to graph?