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

Bounds Error solving model in v1.7.3 #106

Closed
mitchphillipson opened this issue Mar 4, 2024 · 4 comments · Fixed by #107
Closed

Bounds Error solving model in v1.7.3 #106

mitchphillipson opened this issue Mar 4, 2024 · 4 comments · Fixed by #107
Labels

Comments

@mitchphillipson
Copy link
Contributor

Description of Issue

Version 1.7.3 passes constraint names to the PATH solver. The issue is that this doesn't take into account when variables are created so there is an issue extracting the correct names. Additionally, this will throw an error if you define two variables but only use the second.

Example of the issue

To illustrate the issue, here is a very simple example.

using JuMP
using PATHSolver

M = Model(PATHSolver.Optimizer)

@variables(M, begin
    not_used_in_model>=0
    x>=0
end)

@constraint(M, x_bound,
    x^2 +2*x - 1 ⟂ x
)

optimize!(M)

This code runs on version 1.7.2 but not on 1.7.3. On 1.7.2 the solver makes reference to f([2]), referring to the second variable, but there is only one constraint which causes an error on 1.7.3.

Note that this will not error if x is defined before not_used_in_model.

@odow
Copy link
Collaborator

odow commented Mar 4, 2024

Hmm. We could throw a nicer error for this, or we could add 0 ⟂ not_used_in_model by default.

But PATH assumes that there is exactly one complementarity constraint for every variable. We do not omit variables which are not used in the model.

@odow
Copy link
Collaborator

odow commented Mar 4, 2024

See #107. This is just my fault in #104

@mitchphillipson
Copy link
Contributor Author

The error isn't really with PATH, it's pairing the variable index with the "correct" variable. The issue, I think, is here. Adding extra trivial constraints isn't the worst solution and is probably the easiest.

I'm sorry I'm not familiar enough with either MOI or the PATHSolver package to fix the issue outright.

@odow
Copy link
Collaborator

odow commented Mar 4, 2024

Already fixed in #107 😄

@odow odow closed this as completed in #107 Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants