-
Notifications
You must be signed in to change notification settings - Fork 164
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
Add bidirectional flag to existing generator functions #184
Comments
Can I work on this? |
@darknight009 sure go ahead. I've assigned the issue to you. |
What is the default expected behavior of bidirectionality? Should it be set to "false" for directed_* generators? |
Yeah, it should be default false. By default things should not be bidirectional, it should be an opt-in option that a user can set |
How should the case for directed_star_graph be handled where both bidirectionality and inward are passed. For eg. directed_star_graph(num_nodes = 5, bidirectional=True, inward= True). Does bidirectional override inward? |
Hmm, I forgot about that. I'll defer to you on that as long as it's documented clearly. Either we have one flag take precedence over the other or raise an exception. It doesn't really matter as long as we make it clear what the behavior is in that edge case (and probably have a test asserting that behavior too). |
Ok proceeding with precedence of bidirectional over inward. |
Allows users to pass optional parameter 'bidirectional' to add edges in both directions For directed_star_graph generator if 'bidirectional' is set to 'True', the 'inward' parameter is ignored. Fixes #184 * Added Bidirectional parameters for directed graph generators * Sets bidirectional parameter as false by default using pyfunction macro * Refactoring
What is the expected enhancement?
The existing directed_* generator functions in https://github.com/Qiskit/retworkx/blob/master/src/generators.rs only have an option to add a single edge. But it could be useful to add edges in both directions. While this is essentially the same as a undirected version of the function there are use cases where you could want bidirectional edges added to a directed graph generatore. For example a bidirectional path graph:
a <-> b <-> c
instead of justa -> b -> c
that exists now. This would be to add a new boolean kwarg to the existing (and potential future) directed generator functions to set adding bidirectional edges.This is related to #150 but self contained enhancement for the existing generator functions rather than adding new functions.
The text was updated successfully, but these errors were encountered: