Merge pull request #40 from radkoff/master

fix KeyError during node2vec
This commit is contained in:
浅梦 2020-07-25 20:30:37 +08:00 committed by GitHub
commit 6f4aac5e42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,6 +191,8 @@ class RandomWalker:
for edge in G.edges():
alias_edges[edge] = self.get_alias_edge(edge[0], edge[1])
if not G.is_directed():
alias_edges[(edge[1], edge[0])] = self.get_alias_edge(edge[1], edge[0])
self.alias_edges = alias_edges
self.alias_nodes = alias_nodes