Skip to content
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

Improving the vf2_mappings API #1376

Open
eginez opened this issue Jan 30, 2025 · 1 comment
Open

Improving the vf2_mappings API #1376

eginez opened this issue Jan 30, 2025 · 1 comment
Labels
enhancement New feature or request hard

Comments

@eginez
Copy link

eginez commented Jan 30, 2025

What is the expected enhancement?

Add a call_limit parameter to the vf2_mappings API

Background

Hey all, we have been using the vf2_mappings call more extensively lately and wanted to propose an improvement to the API. Currently the only way to limit the time that it takes for the vf2_mappings call to return results is via call_limit. However call_limit is hard to tune because

  1. Its magnitude might depend on the input graphs
  2. From the user's of the api is hard to predict how long the call is going to take.
  3. It requires deeper knowledge of the vf2 algorithm to find a good limit.

What we would like to propose is the time_limit parameter. Which would limit the execution of the call up to a certain duration.
This is currently hard to implement outside of the rust API, because the call retains the GIL until the next mapping is found. The only option available is fork a new process and forcefully kill it after some time. Perhaps I am missing something here?

Hoping to hear your thoughts on this.

@IvanIsCoding
Copy link
Collaborator

I will expand this answer but:

After #1235 is merged, I think we’ll be able to spawn VF2 in a separate thread and then have the main thread check Python for Control + C signals.

Then maybe we can implement a time out. With that being said, this is a hard problem. Contributions are welcome but there is a reason why we haven’t had this feature.

@IvanIsCoding IvanIsCoding added enhancement New feature or request hard labels Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hard
Projects
None yet
Development

No branches or pull requests

2 participants