Improving the vf2_mappings API

Open
#1,376 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python, rust

Research direction

Start at the vf2_mappings API entry point and the Rust API, then clarify whether the requested parameter is call_limit or time_limit and how the Python GIL constraint affects it. Done means the intended API behavior and implementation scope are settled; the report names no files or tests.

Written by the indexing model from the issue text.

Description

enhancement hard
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.

Dominant language
Rust
Stars
1.8k
Forks
220
Avg merge
3d 16h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Qiskit/rustworkx

All issues in Qiskit/rustworkx

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.