Skip to content

Commit

Permalink
Merge pull request aestrivex#52 from jtpdowns/fix-btwn-wei
Browse files Browse the repository at this point in the history
fix: update btwn wei to fix index issue
  • Loading branch information
aestrivex committed Aug 11, 2017
2 parents a66b820 + 43afb2f commit b4afc77
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bct/algorithms/centrality.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def betweenness_wei(G):
NP[u] = 1 # number of paths from u
S = np.ones((n,), dtype=bool) # distance permanence
P = np.zeros((n, n)) # predecessors
Q = np.zeros((n,))
Q = np.zeros((n,), dtype=int) # indices
q = n - 1 # order of non-increasing distance

G1 = G.copy()
Expand Down Expand Up @@ -213,7 +213,7 @@ def edge_betweenness_bin(G):
NP = np.zeros((n,))
NP[u] = 1 # number of paths from u
P = np.zeros((n, n)) # predecessors
Q = np.zeros((n,))
Q = np.zeros((n,), dtype=int) # indices
q = n - 1 # order of non-increasing distance

Gu = G.copy()
Expand Down Expand Up @@ -287,7 +287,7 @@ def edge_betweenness_wei(G):
NP[u] = 1 # number of paths from u
S = np.ones((n,), dtype=bool) # distance permanence
P = np.zeros((n, n)) # predecessors
Q = np.zeros((n,))
Q = np.zeros((n,), dtype=int) # indices
q = n - 1 # order of non-increasing distance

G1 = G.copy()
Expand Down Expand Up @@ -487,7 +487,7 @@ def gateway_coef_sign(W, ci, centrality_type='degree'):

def gcoef(W):
#strength
s = np.sum(W, axis=1)
s = np.sum(W, axis=1)
#neighbor community affiliation
Gc = np.inner((W != 0), np.diag(ci))
#community specific neighbors
Expand Down Expand Up @@ -532,7 +532,7 @@ def gcoef(W):
G_pos = gcoef(W * (W > 0))
G_neg = gcoef(-W * (W < 0))
return G_pos, G_neg


def kcoreness_centrality_bd(CIJ):
'''
Expand Down

0 comments on commit b4afc77

Please sign in to comment.