dwavesystems / dwave-system

An API for easily incorporating the D-Wave system as a sampler, either directly or through Leap's cloud-based hybrid samplers
https://docs.ocean.dwavesys.com/
Apache License 2.0
90 stars 64 forks source link

Consider removing NetworkX as a direct dependency #504

Closed arcondello closed 10 months ago

arcondello commented 1 year ago

Currently this package only relies directly on NetworkX for one function, common_working_graph(). We could consider migrating that function to dwave-networkx. By doing so, we would not have a direct dependency on NetworkX - potentially lightening the maintenance load. See for instance https://github.com/dwavesystems/dwave-networkx/issues/221.

On the other hand, while that is the only place in the package we directly rely on NetworkX there are many places in the docs/tests that do use NetworkX directly, not to mention the many places that we rely on it transitively. So perhaps delegating version maintenance/testing to dwave-networkx/dimod/etc would just increase the probability of bugs.

arcondello commented 1 year ago

Ironically, it seems that common_working_graph() was originally slated for dwave-networkx. See https://github.com/dwavesystems/dwave-system/pull/179, https://github.com/dwavesystems/dwave-networkx/pull/117. I have no recollection as to why we moved it.

arcondello commented 10 months ago

Also, looks like networkx.intersection could more or less be a drop-in replacement for common_working_graph.