Setup vf2pp files for expansion to subgraph problems#6230
Closed
dschult wants to merge 2 commits intonetworkx:mainfrom
Closed
Setup vf2pp files for expansion to subgraph problems#6230dschult wants to merge 2 commits intonetworkx:mainfrom
dschult wants to merge 2 commits intonetworkx:mainfrom
Conversation
Notes:
- Reordered the intro of the main function vf2pp_all_isomorphisms.
- Replace `return False` (which doesn't do much inside a generator)
with `return "helpful string"`. The string is only seen if you manually
use `next` on the generator functuion. But that can be helpful for debugging.
- Moved the degree dict creation to `_initialize_parameters`. Moved this call
to before where the degrees are used.
- Inline the function `precheck_label_properties` and make more readable.
- added G1_degree and G2_degree degree dicts to the graph parameters namedtuple.
Removed the degree dict input parameter to some helper functions.
- Reworded, unified language and corrected the main module doc_strings.
- changed the name of utils.labels_different to utils.labels_many.
- adjusted the tests accordingly.
Adding the features for "sub" and "mono" problem types should be easier after
these changes.
For the future:
The namedtuples are very hard to adjust throughout the code. It would be good
to have a central place instead of unpacking the namedtuple in each function.
But maybe there isn't a better way.
I think the Directed version of the helper functions can be eliminated with
code that checks during the function. I also believe the namedtuples could
be better used here, perhaps being different between graph and directed graph.
The multiedge calculation should be moved to _initialize_parameters
to avoid recalculation for MultiGraphs.
Member
Member
|
Is this still relevant @dschult ? |
Member
Author
|
I'm sprinkling these changes into a (currently) larger version that tries to do the same thing. So I am closing this. Thanks for the nudge! |
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.
This PR sets up the VF2++ functions to allow easier addition of the subgraph versions of the problem.
The main change are to add the degree dicts to the namedtuple data structure and
make the
return Falsestatements in the main generator function more useful.Notes:
_initialize_parameters. Moved this call to before where the degrees are used.return False(which doesn't do much inside a generator) withreturn "helpful string", which is the same asraise StopIteration("helpful string"). The string is only seen if you manually usenexton the generator function. But that can be helpful for debugging why there is e.g. no isomorphism._precheck_label_propertiesand make more readable._find_candidateshelper function.If this is too much to review I can split it up. Most of the changes are due to the change in the namedtuple.