forked from Qiskit/rustworkx
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix VF2 in case of empty graphs. (Qiskit#423)
* Fix VF2 in case of empty graphs. An alternative for Qiskit#421. This commit fixes the output of functions solving the isomorphism problem (`is_isomorphic`, `is_subgraph_isomorphic`, `vf2_mapping`) without handling empty graphs as a special case but rather they now fall naturally into the logic of the algorithm. The solution is to equivalently check if we have found a complete mapping in the `Outer` phase and not in the `Inner` phase of the algorithm, where we dont reach in case of an empty graph. * release note * irrelevant code simplification
- Loading branch information
1 parent
b97bc14
commit 06bad5c
Showing
6 changed files
with
82 additions
and
42 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/fix-vf2-mapping-empty-graph-1ef7a1aef9d84758.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
fixes: | ||
- | | ||
Previously, :func:`~retworkx.vf2_mapping` function when | ||
comparing 2 empty graph objects would incorrectly return an | ||
empty iterator. This has been fixed and now returns an iterator | ||
over the single valid mapping, i.e the empty mapping. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters