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 isomorphism fails with parallel edges #429
Labels
bug
Something isn't working
Comments
Fixing this definitely seems worth including in a 0.10.2 release. |
georgios-ts
added a commit
to georgios-ts/retworkx
that referenced
this issue
Aug 30, 2021
Closes Qiskit#429. The solution is build an adjacency matrix with entries equal to the number of edges connecting a pair of nodes instead of 0/1 values
UPDATE: import retworkx as rx
graph = rx.PyGraph()
graph.extend_from_weighted_edge_list([
(0, 1, 'a'), (0, 1, 'b'), (1, 2, 'c')
])
rx.is_isomorphic(graph, graph,
edge_matcher=lambda x, y: x == y)
----
False UPDATE 2: first = rx.PyGraph()
first.extend_from_weighted_edge_list([
(0, 1, 'a'), (1, 2, 'b'), (2, 0, 'c')
])
second = rx.PyGraph()
second.extend_from_weighted_edge_list([
(0, 1, 'a'), (1, 2, 'b')
])
rx.is_subgraph_isomorphic(first, second, induced=False,
edge_matcher=lambda x, y: x == y
)
---
PanicException: internal error: entered unreachable code |
mtreinish
pushed a commit
that referenced
this issue
Sep 3, 2021
* Fix `is_subgraph_isomorphic` with parallel edges. Closes #429. The solution is build an adjacency matrix with entries equal to the number of edges connecting a pair of nodes instead of 0/1 values * run black * use HashMap for adjacency matrix * Fixes Vf2 algorithm if an `edge_matcher` is specified * avoid clone * call `edge_multiplicity` directly Co-authored-by: Ivan Carvalho <ivan.ivancps.cn@gmail.com> * a note about the decrease of memory usage * drop extra referenece
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Information
What is the current behavior?
is_subgraph_isomorphic
returnsTrue
even in cases it shouldn't. This happens if the input "small" graph have parallel edges.What is the expected behavior?
Handle correctly graphs with parallel edges.
Steps to reproduce the problem
The text was updated successfully, but these errors were encountered: