Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update btwn wei to fix index issue #52

Merged
merged 1 commit into from
Aug 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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