Skip to content

558 reporting intermediate solutions#561

Merged
IgnaceBleukx merged 77 commits into
masterfrom
558-reporting-intermediate-solutions
Jun 22, 2026
Merged

558 reporting intermediate solutions#561
IgnaceBleukx merged 77 commits into
masterfrom
558-reporting-intermediate-solutions

Conversation

@IgnaceBleukx

Copy link
Copy Markdown
Collaborator

Following the discussion in #558.

It adds quite some code in all solver interfaces, but I tried to do it somewhat consistent.
Some solvers are missing still:

For Exact,it is somewhat hacky as we need to go through "runOnce" instead of the nice "toOptimal" function. So there will be some more ping-pong through the interface.

@IgnaceBleukx IgnaceBleukx linked an issue Dec 20, 2024 that may be closed by this pull request

@ThomSerg ThomSerg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a nice quality-of-life improvement. But yeah, the one for exact seems hack-y, especially with the "warning" part. Is there a way to restore the solver afterwards?

Comment thread cpmpy/solvers/gurobi.py Outdated
Comment thread cpmpy/solvers/gurobi.py Outdated
Comment thread cpmpy/solvers/minizinc.py Outdated
Comment thread cpmpy/solvers/ortools.py Outdated
Comment thread cpmpy/solvers/TEMPLATE.py Outdated
Comment thread cpmpy/solvers/gurobi.py Outdated
@ThomSerg

ThomSerg commented Jan 2, 2025

Copy link
Copy Markdown
Collaborator

Besides that it is never mentioned + silently enforced that "display" is only for optimization, it seems good to me.

@Wout4

Wout4 commented Jan 6, 2025

Copy link
Copy Markdown
Collaborator

we could add the gcs callback also since that bug is fixed or not?

@IgnaceBleukx

IgnaceBleukx commented Jan 9, 2025

Copy link
Copy Markdown
Collaborator Author

Made quite some changes to this PR after the last review, so maybe another round of revieuwing from @ThomSerg and/or @Wout4 would be appropriate before merging.

I'm wondering if we should really fill the solver.objective_ argument directly from the underlying solver object.
Alternatively, we can store the original objective expression and compute the objective value based on that. There were quite some tricky things to get right in this PR...

@IgnaceBleukx

Copy link
Copy Markdown
Collaborator Author

I think the comments are addressed @ThomSerg

@IgnaceBleukx IgnaceBleukx requested a review from ThomSerg May 27, 2026 13:15
@IgnaceBleukx

Copy link
Copy Markdown
Collaborator Author

I decided to take out the display support for Z3 after all.
It was too unreliable to be tested properly (z3 finds a first solution relatively quick, but then does not improve, even with a large time out).

Alternative is to keep it supported, but skip z3 in the tests?
In any case ready for a round of reviewing.

@ThomSerg ThomSerg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor styling comments. For the rest looks good!

Comment thread cpmpy/solvers/cpo.py Outdated
Comment thread cpmpy/solvers/cpo.py Outdated
Comment thread cpmpy/solvers/gurobi.py
Comment thread cpmpy/solvers/gurobi.py Outdated
Comment thread tests/test_solvers.py Outdated
@IgnaceBleukx

Copy link
Copy Markdown
Collaborator Author

Processed comments and merged master into this one; but its missing a PR "approval" :)

@ThomSerg ThomSerg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@IgnaceBleukx IgnaceBleukx merged commit cb91ff3 into master Jun 22, 2026
12 checks passed
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.

Reporting intermediate solutions

4 participants