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 bug in aug_random_edge #12
Comments
Hi @skydetailme, Thanks for your interest in our work. Would you mind pointing out which file you are referring to? I think in my implementation I did not use "remove()" function but directly use indexing to modify them, e.g.
|
Hi, thanks for the reply. Here is the link. |
@yongduosui, would you mind giving some comments on this? Thanks! |
@skydetailme The aim of this code is to convert to convert bidirectional edges index to unidirectional index. I just debug my code and did't find any bug. It remove the other edge index pair successfully. You can print the list and check. Thanks. |
Would you mind take some minutes to read the link I posted, it explains well. |
Also, thanks for your help. |
It seems that if the adj matrix is self-loop, this code may cause a wrong result, and the index_list is not empty. |
@skydetailme Thank you for your carefulness, and I see your point. The citation net datasets happen to be without self-loop. I will read the post and give some comments after finishing my work at hand. |
Thanks for your reply and contribution. This project helps a lot. |
Hi @skydetailme, Sorry for the late reply that I just survive a DDL. I make certain modifications according to the blog u share https://thispointer.com/python-remove-elements-from-a-list-while-iterating/. Thanks again for your carefulness. |
Hi, Shen. Thanks for your efforts in this program. I noticed there might have a logical bug in the aug_random_edge function.
“for i in index_list:
single_index_list.append(i)
index_list.remove((i[1], i[0]))”
Removing items in a list while iterating that list may cause problems, as the list changed but the current index is not changed.
This blog illustrated well.
https://thispointer.com/python-remove-elements-from-a-list-while-iterating/
Thanks for your help.
The text was updated successfully, but these errors were encountered: