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

DiGraph support #203

Open
rjcortese opened this issue Oct 1, 2021 · 3 comments
Open

DiGraph support #203

rjcortese opened this issue Oct 1, 2021 · 3 comments

Comments

@rjcortese
Copy link
Contributor

Hello!

I want to use dwave-networkx with networkx.DiGraphs.
Specifically, I'm trying to pass a networkx.DiGraph to dwave_networkx.traveling_salesperson but it does not seem to work. My DiGraph is complete and I believe does meet other requirements.

Is there already support for DiGraph?
If not, I propose it be added.

Thanks!

@arcondello
Copy link
Member

We don't currently support it, though I don't think it would be especially difficult to make the change. #200 actually does some of the work but I think that PR is abandoned and still needs a few features (see #200 (comment)). Would you be interested in making a PR?

@rjcortese
Copy link
Contributor Author

I can make a PR that addresses those issues, just need a bit of time to do it.

I was worried the QUBO formulation might be different from regular Graph QUBO formulation... but from looking at that PR, maybe that is not the case? :)

@arcondello
Copy link
Member

Yeah, there are two issues that need to be addressed:

  1. Assign the appropriate edge weight based on the direction
  2. Handle missing edges (if there are any)
    but the formulation is pretty close.

Happy to answer questions if it would be helpful!

necaisej pushed a commit to necaisej/dwave-networkx that referenced this issue Dec 13, 2021
necaisej pushed a commit to necaisej/dwave-networkx that referenced this issue Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants