Closed mitchphillipson closed 6 months ago
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.
See https://github.com/chkwon/PATHSolver.jl/pull/107. This is just my fault in #104
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.
Already fixed in #107 :smile:
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.
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 beforenot_used_in_model
.