In LouvainCore.louvain, we compute totalGraphWeight at very first step which is nothing but 2 * sum-of-all-edges-weights. Why do we need to compute this again and again whenever we call LouvainCore.louvain from outside do-while loop. I think this graph weight is fixed because we never delete any edges nor add any edge, we just compress node (means we convert edges into self edge) which should not change totalGraphWeight?
Please let me know, if I am thinking in wrong direction.