Repository navigation
BUG: reverse the map returned by vf2pp functions - #8813
Merged
Merged
Conversation
rossbar
approved these changes
Aug 4, 2026
rossbar
left a comment
Contributor
There was a problem hiding this comment.
This is a tricky one! Nice catch @wenwen-666 and thanks for the fix @dschult !
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8810
The vf2pp functions (change recently in #8506) return the mapping from the subgraph to the graph instead of the graph to the subgraph. That breaks backward compatibility! Also, an advantage of mapping from the graph to the subgraph is that the keys of the dict are the nodes in the full graph that make an induced subgraph. And "fixing" vf2pp also brings it in line with the other algorithms in the isomorphism suite.
So: I have reversed the mapping that gets returned (put it back the way it was -- I never intended it to change).
I also added a test to ensure that the various isomorphism algorithms report the same direction for the mapping, and reversed the mapping for tests recently put into vf2pp with the wrong ordering.
And I adjusted the docs to reflect this change.
The diff for the 2nd commit is all in
test_vf2pp.pyand it just switches namesSHandFHexcept in calls to the vf2pp functions. The separate commit is to simplify review. But it is still quite long...I feel very lucky to have this reported before it was released. Thanks @wenwen-666