-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Added code to handle multi-graph in mst #7454
base: main
Are you sure you want to change the base?
Conversation
This code is written to address issue #7451. |
The code itself looks pretty good, but you should definitely add some test cases using multi-graphs to the iterator. Things that are worth testing would be that the number of generated trees is correct, and then that the trees themself are presented in a non-decreasing (and non-increasing for the reverse mode). For a small tests, enumerating the trees explicitly can be a good sanity check. The current tests for the iterator should provide a good roadmap. |
I will try to add the test cases. |
edges = ( | ||
G.edges(keys=True, data=True) if G.is_multigraph() else G.edges(data=True) | ||
) | ||
for *e, d in edges: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this pattern! What do you think about using it above when setting d[partition_key]
? This way, we wouldn't need separate for loops for if G.is_multigraph()
and else
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looked neat this way.
Will it affect the performance of the code? I would love to hear your suggestions. I will make sure to change the code accordingly.
No description provided.