graph icon indicating copy to clipboard operation
graph copied to clipboard

Add user callback to `vf2_subgraph_mono` to potentially stop search before each check.

Open cqc-alec opened this issue 3 years ago • 3 comments

Also update documentation and add tests.

See the discussion on #271 .

Remarks:

  • I used a simple function pointer for the type rather than a templated "callable" so as to be able to default it, thereby maintaining compatibility with existing code. An alternative would be to define a new method or methods with a different name; this seems a bit like overkill but I can do that if preferred.
  • I only changed vf2_subgraph_mono, not vf2_subgraph_iso, but it should be simple to do the same thing there too if desired.
  • The tests are pretty basic. It isn't obvious to me how to test this fully without knowing internal details of the order of search. Suggestions welcome.

cqc-alec avatar Dec 14 '21 10:12 cqc-alec

Looks great so far! Thanks for keeping it simple, sorry it took me so long to take a look. I just made a couple of requests for changes.

jeremy-murphy avatar Jul 22 '22 00:07 jeremy-murphy

Thank you for the review Jeremy! I have actually switched to a different solution now, so no longer need this. I may come back to it anyway if you or others think it generally useful, though I cannot prioritize it just now. So, feel free to close, complete or leave open this PR as you see fit.

By the way, the reason I didn't use a template type for the callback was that I couldn't see how to do so while maintaining backward compatibility (i.e. how to set a no-op default value). I guess an alternative would be to overload the whole function.

cqc-alec avatar Jul 23 '22 12:07 cqc-alec

OK, no worries. I'll leave this open for a while in case someone else needs the same functionality and wants to finish it off.

jeremy-murphy avatar Jul 24 '22 23:07 jeremy-murphy