dwavesystems / dwavesystems/minorminer
subgraph.find_subgraph has unexpected behaviour if some nodes are disconnected. Only nodes assocaited to at least one edge are embedded
- Dominant language
- Python
- Stars
- 54
- Forks
- 48
- Avg merge
- 19h 28m
- Merged PRs (30d)
- 1
Description
**Description**
subgraph fails to find an embedding if source graph contains nodes without edges.
This is a pathological case, but worth protecting against.
**To Reproduce**
```
S = nx.Graph()
S.add_node_from(1)
T = S.copy()
emb = minorminer.subgraph.find_subgraph(S, T)
# emb is an empty list, not {1: 1} as expected
```
**Expected behavior**
A graph that includes disconnected nodes should be embeddable if the connected components are embeddable and there are sufficiently many total nodes.
**Environment:**
- OS: [Ubuntu 16.04.4 LTS]
- Python version: [e.g. 3.7.0]
**Additional context**
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.