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

unweighted RWR #4

Closed
mkaanarici opened this issue May 27, 2020 · 2 comments
Closed

unweighted RWR #4

mkaanarici opened this issue May 27, 2020 · 2 comments

Comments

@mkaanarici
Copy link

I have tried to RWR without weight. However, in "utils/reader.py",  "weighted" is directly defined as True and so   even if my edges are unweighted,    "A = csr_matrix((np.ones(len(K), (I, J), shape=A.shape)))"  gives error due to lack of weight. I solved the problem by giving  them all same weight as default 1. In fact, it may be solved directly "utils/reader.py". weights argumant may be added as weights default True.

reader.txt

@jinhongjung
Copy link
Owner

jinhongjung commented Jun 15, 2020

Thanks for having an interest in this repository! The edge list file of unweighted graphs should contain a pair of nodes per line without its weight (i.e., # format: source (int) \t target (int)), as described in README. Have you tried this intended format for your unweighted graph?

The reason why I set "weighted" as True at line 80 of reader.py is for the default case n=3 where n is the number of columns of the input file. If your file has two columns, then "weighted" will be set as False at line 84.

@jinhongjung
Copy link
Owner

The error in the line is fixed!

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

2 participants