DiGraph support
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!
We don't currently support it, though I don't think it would be especially difficult to make the change. https://github.com/dwavesystems/dwave-networkx/pull/200 actually does some of the work but I think that PR is abandoned and still needs a few features (see https://github.com/dwavesystems/dwave-networkx/pull/200#issuecomment-896192804). Would you be interested in making a PR?
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? :)
Yeah, there are two issues that need to be addressed:
- Assign the appropriate edge weight based on the direction
- Handle missing edges (if there are any) but the formulation is pretty close.
Happy to answer questions if it would be helpful!