Skip to content

get multi-hop neighbors bug#5

Open
Sanzo00 wants to merge 1 commit intozhiqi-0:masterfrom
Sanzo00:master
Open

get multi-hop neighbors bug#5
Sanzo00 wants to merge 1 commit intozhiqi-0:masterfrom
Sanzo00:master

Conversation

@Sanzo00
Copy link

@Sanzo00 Sanzo00 commented May 23, 2023

There is a small bug in PaGraph/PaGraph/partition/dg.py, there are no issues within two hops, but beyond two hops will result in a bug.

On line 26, all in_neighbors of neighs should be appended to nids list, not one of neighs.

def in_neighbors_hop(csc_adj, nid, hops):
if hops == 1:
return in_neighbors(csc_adj, nid)
else:
nids = []
for depth in range(hops):
neighs = nids[-1] if len(nids) != 0 else [nid]
for n in neighs:
nids.append(in_neighbors(csc_adj, n))
return np.unique(np.hstack(nids))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant