Skip to content

feat: termination condition map for SCIP solver#447

Merged
siddharth-krishna merged 2 commits intomasterfrom
scip-condition-map
Apr 25, 2025
Merged

feat: termination condition map for SCIP solver#447
siddharth-krishna merged 2 commits intomasterfrom
scip-condition-map

Conversation

@siddharth-krishna
Copy link
Copy Markdown
Collaborator

Closes # (if applicable).

Changes proposed in this Pull Request

Currently, if the user sets the limits/gap SCIP solver option to stop solving MIPs when a certain duality gap is reached, then linopy reports the termination condition as unknown. This PR tries to map the SCIP statuses to linopy termination conditions, using
https://github.com/scipopt/scip/blob/b2bac412222296ff2b7f2347bb77d5fc4e05a2a1/src/scip/type_stat.h#L40

(CC @pfetsch, I couldn't find the exact mapping from the enum integers to the strings returned by pyscipopt so I guessed that it's the same as the names of the enums)

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

@siddharth-krishna siddharth-krishna merged commit 353d45f into master Apr 25, 2025
20 of 21 checks passed
@siddharth-krishna siddharth-krishna deleted the scip-condition-map branch April 25, 2025 11:13
@pfetsch
Copy link
Copy Markdown

pfetsch commented Apr 25, 2025

The mapping looks good, except possibly for gap limit reached. This should probably be handled differently. Currently, you cannot determine whether this happened or some other limit was reached. I think that for the other solvers, a gap limit reached is treated as optimal.

@siddharth-krishna
Copy link
Copy Markdown
Collaborator Author

Thank you @pfetsch ! That makes sense, I've opened a new PR to fix that: #448

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

Successfully merging this pull request may close these issues.

3 participants