aditya-grover / node2vec

http://snap.stanford.edu/node2vec/
MIT License
2.6k stars 912 forks source link

What is `alias_nodes` and `alias_edges` for? #96

Closed worthless443 closed 1 year ago

worthless443 commented 4 years ago

can anyone explain how alias_nodes and alias_edges in node2vec_walk of class:Graph is assigned and referenced?

I can't understand where the self instances of these two variables are assigned. This keeps giving me problems since it is undefined.

https://github.com/aditya-grover/node2vec/blob/883241e825e1473ef9916ac79f6686f5ef6b1603/src/node2vec.py#L18-L19

fiyen commented 4 years ago

The alias_nodes and alias_edges are computed in preprocess_transition_probs function and are assigned to self. Then the node2vec_walk can work with them. I think...