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

Doesn't work for a fully connected weighted graph #3

Open
qxu1994 opened this issue Feb 10, 2021 · 0 comments
Open

Doesn't work for a fully connected weighted graph #3

qxu1994 opened this issue Feb 10, 2021 · 0 comments

Comments

@qxu1994
Copy link

qxu1994 commented Feb 10, 2021

Thanks for the code!

I'm trying to calculate SWP for my fully connected weighted graph which contains 10 nodes. A further check shows that the program was stuck within the while loop in regular_matrix_generator( ), as B[a, z] was always 0 when z equals to 4. Maybe the approximate radius in small_world_propensity( ) should be adjusted?

Here is a preview of the 10x10 input matrix:

array([[0.        , 0.49810255, 0.23660737, ..., 0.24742661, 0.16791965, 0.41762051],
       [0.49810255, 0.        , 0.24386877, ..., 0.14405741, 0.16249932, 0.33356544],
       [0.23660737, 0.24386877, 0.        , ..., 0.18854478, 0.08817706, 0.17486422],
       ...,
       [0.24742661, 0.14405741, 0.18854478, ..., 0.        , 0.12500563, 0.30264562],
       [0.16791965, 0.16249932, 0.08817706, ..., 0.12500563, 0.        , 0.08587351],
       [0.41762051, 0.33356544, 0.17486422, ..., 0.30264562, 0.08587351, 0.        ]])
 
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

1 participant