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

subgraph.find_subgraph has unexpected behaviour if some nodes are disconnected. Only nodes assocaited to at least one edge are embedded #254

Open
jackraymond opened this issue Nov 6, 2024 · 0 comments

Comments

@jackraymond
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant