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

Solving a bug in the MaxCut class #611

Open
Maldini32 opened this issue Feb 19, 2024 · 0 comments
Open

Solving a bug in the MaxCut class #611

Maldini32 opened this issue Feb 19, 2024 · 0 comments

Comments

@Maldini32
Copy link

Environment

  • Qiskit Optimization version: 0.45.1
  • Python version: 3.10
  • Operating system: Windows 10

What is happening?

The problem regards the method parse_gset_format, which should be updated in order to correctly read the files.

While in the library version we can find this content in lines 117 to 120:

s__, t__, _ = v
s__ -= 1  # adjust 1-index
t__ -= 1  # ditto
w[s__, t__] = t__

They should be replace with these lines in order to properly assign the weight to the edges:

s__, t__, _ = v
s__ -= 1  # adjust 1-index
t__ -= 1  # ditto
w[s__, t__] = _

How can we reproduce the issue?

The problem is solved by modifying the 120 to:

w[s__, t__] = _

What should happen?

By modifying this line the weights will be correctly assigned to the problem instance.

Any suggestions?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant