Adding edge weight vs adding multiple edges between two node in GCN?

I have a graph where two nodes might have multiple edges between them, and i want this to affect the embedding of nodes, so if two nodes (a,b) have more connections than other nodes, then the feature vector of node b should affect node a more than other nodes. now i assume when i use add_edge multiple times with same nodes, it will add more edges between them and therefore it will achieve my goal of giving the connection between this two node more importance in the embedding learned by GCN, right?

also lets say we have two nodes which have three edges between them, what is the difference of adding three edges between them vs adding one edge with a weight 3 (i assume the default is 1) in case of learnt node embedding?

I have a graph where two nodes might have multiple edges between them, and i want this to affect the embedding of nodes, so if two nodes (a,b) have more connections than other nodes, then the feature vector of node b should affect node a more than other nodes. now i assume when i use add_edge multiple times with same nodes, it will add more edges between them and therefore it will achieve my goal of giving the connection between this two node more importance in the embedding learned by GCN, right?

Right.

also lets say we have two nodes which have three edges between them, what is the difference of adding three edges between them vs adding one edge with a weight 3 (i assume the default is 1) in case of learnt node embedding?

It depends on the model you implement and the data you have:

  1. If your model simply computes the sum of received messages for each node, i.e. g.update_all(..., fn.sum(..., ...)), then mathematically they are equivalent. In other cases, for example g.update_all(..., fn.mean(..., ...)), this may not hold.
  2. The implementations can be different (more edges vs multiply messages by edge weights), yielding different efficiency. Iā€™m not sure which implementation will be more efficient in your case and you may need to benchmark for that.
1 Like