2

I'm using Graphchi for studying community detection algorithms on a weighted graph. In documentation, I can't find a method for calculating the total edge weight sum. Is there a way to do it?

I was thinking about a preprocessing initial phase, keeping a global variable in my GraphChiProgram class and sum the weight of edges in the update function for the vertices. The problem is the an edge could be counted multiple time: if vertex A is neighbour of vertex B, the same edge AB would be counted two times.

For now, I'm passing the value from command line, calculating it with a separate script on my graph file, but I don't like this solution.

Kara
  • 6,115
  • 16
  • 50
  • 57
besil
  • 1,308
  • 1
  • 18
  • 29

1 Answers1

0

you can sum the total weight as you propose: doing an update function that sums the edge weights. But instead of summing over all edges, sum only over in-edges (or out-edges). That way no edge is summed twice.

Aapo Kyrola
  • 1,100
  • 8
  • 8