commit 739fe075000536fc13fd1f7c68dd500410860835
Author: Quynh PX Nguyen
Date: Mon Dec 28 08:35:54 2015 +0700
Heuristic BC for different graphs
diff --git a/fiddle/heuristic-betweenness-centrality/betweenness_centrality.py b/fiddle/heuristic-betweenness-centrality/betweenness_centrality.py
index cb81119..7347111 100644
--- a/fiddle/heuristic-betweenness-centrality/betweenness_centrality.py
+++ b/fiddle/heuristic-betweenness-centrality/betweenness_centrality.py
@@ -135,7 +135,7 @@ def weight_betweenness_centrality(G, traffic_matrix=None, k=None, normalized=Tru
else:
betweenness = _accumulate_weight_basic(betweenness, S, P, sigma, s)
- print 'betweenness = %s' % betweenness
+ print '@@@ betweenness = %s' % betweenness
if rescale:
betweenness = _rescale(betweenness, len(G),
normalized=normalized,
@@ -259,7 +259,7 @@ def _accumulate_weight_basic(betweenness, S, P, sigma, s):
while S:
w = S.pop()
if w != s:
- delta[w] += 1
+ delta[w] += 1 # this is the h, when w != s, then h(s, w) = 1
coeff = delta[w] / sigma[w]
for v in P[w]:
delta[v] += sigma[v] * coeff