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

A question about generating random walks #110

Open
mkhoshdeli opened this issue Feb 4, 2020 · 2 comments
Open

A question about generating random walks #110

mkhoshdeli opened this issue Feb 4, 2020 · 2 comments

Comments

@mkhoshdeli
Copy link

Thank you for the great code. I have a question about the way you generate the random walks. It seems that the weights of the edges do not have any effect (i.e., the nodes are selected based on a random uniform distribution). However, shouldn't random walk take into account the weights of edges when selecting the nodes?

Best,
Mina

@GTmac
Copy link
Collaborator

GTmac commented Mar 8, 2020

Hi Mina,

I am sorry for the late reply! But for posterity, yeah this implementation is for unweighted graphs. It is easy to adapt DeepWalk to weighted graphs though -- as you said, you can sample the next node based on the weights of edges.

The most efficient way to achieve this is via alias sampling. See section 3.2.3 of the node2vec paper as an example: https://cs.stanford.edu/~jure/pubs/node2vec-kdd16.pdf

Best,
Haochen

@PuneethaPai
Copy link

PuneethaPai commented Aug 5, 2020

Hello @GTmac ,

I would like to work on this. Any help would be appreciated.

I am confused by what @mkhoshdeli and you are referring by weight. In my understanding:

  • according to @mkhoshdeli, weight refers to edge weight, given by user in graph for every edge(default=1), i.e weighted graph.
  • according to @GTmac , you say we calculate the weight according to the paper based on 2 parameter (p-return parameter and q-in_out parameter) and ignore edge weight given by user in graph.

Looking at the examples I see users can give edgelist, .mat, or .adjlist. Not sure if there is a way for user to pass weighted graph i.e weight for each edge.

  • Is it ignored and always taken=1?
  • Should we ignore weighted graphs and work only for unweighted graphs?

PS: Also I was planning to use pytest for testing. Any thoughts on this?

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

No branches or pull requests

3 participants