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 · 1 comment
Open

Solving a bug in the MaxCut class #611

Maldini32 opened this issue Feb 19, 2024 · 1 comment

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

@MiasWuQG
Copy link
Collaborator

MiasWuQG commented Sep 4, 2024

Thank you for identifying this issue and providing a detailed explanation of the required changes. To help resolve this more efficiently, please consider submitting a Pull Request (PR) with your suggested code modifications. This will allow us to review, test, and merge the fix quickly. Let us know if you need any assistance with the PR process!

TolisChal added a commit to TolisChal/qiskit-optimization that referenced this issue Oct 8, 2024
TolisChal added a commit that referenced this issue Oct 24, 2024
* fix bug in max-cut solver (issue #611)

* fix copyrights

* add unknown-option-value as an error message to be ignored by pylint

* disable pylint too-many-positional-arguments error for the lines it pops up

* fix copyrights

* fix max-cut bug
mergify bot pushed a commit that referenced this issue Oct 25, 2024
* fix bug in max-cut solver (issue #611)

* fix copyrights

* add unknown-option-value as an error message to be ignored by pylint

* disable pylint too-many-positional-arguments error for the lines it pops up

* fix copyrights

* fix max-cut bug

(cherry picked from commit 8a7e09e)
mergify bot added a commit that referenced this issue Oct 25, 2024
* fix bug in max-cut solver (issue #611)

* fix copyrights

* add unknown-option-value as an error message to be ignored by pylint

* disable pylint too-many-positional-arguments error for the lines it pops up

* fix copyrights

* fix max-cut bug

(cherry picked from commit 8a7e09e)

Co-authored-by: Apostolos Chalkis <[email protected]>
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

2 participants