At these lines:
w[u] += weight
w[v] += weight
wtot += weight
if u != v:
wtot += weight
did you mean:
w[u] += weight
wtot += weight
if u != v:
w[v] += weight
wtot += weight
Currently, self-edges are double-counted when calculating w, but only counted once when calculating wtot, which seems inconsistent.
Fabulous method, by the way!
At these lines:
did you mean:
Currently, self-edges are double-counted when calculating
w, but only counted once when calculatingwtot, which seems inconsistent.Fabulous method, by the way!