anchor.diff:          fun({AllDegree, InDegree}) ->
               {AllDegree + NodeDegree, InDegree + CommWeight}
           end, {NodeDegree, CommWeight}, Weights#louvain_weights.weights)}.
  +
  +compare_weights(WA, WB) ->
  +    ?ASSERTEQUAL(WA#louvain_weights.m, WB#louvain_weights.m),
  +    WeightsDA = lists:sort(lists:filter(fun({_,{0.0,0.0}}) -> false; (_) -> true end, dict:to_list(WA#louvain_weights.weights))),
  +    WeightsDB = lists:sort(lists:filter(fun({_,{0.0,0.0}}) -> false; (_) -> true end, dict:to_list(WB#louvain_weights.weights))),
  +    ?ASSERTEQUAL(WeightsDA, WeightsDB).
   
   % weight of all edges to neighbors, and weights to neighboring communities.
   % weights to neighboring communities exclude Node
  
positive.code:     {N1,N2};
  vsort({N1,N2}) ->
      {N2,N1}.
  
negative.code: %% Python implementation - https://bitbucket.org/taynaud/python-louvain
  %% @end
  
  -define(ASSERTEQUAL(A,B), begin case A == B of true -> ok; false -> error({?FILE, ?LINE, A, not_equal, B}) end end).
  
  -module(part_louvain).
  
  