Closed kamilkhanlab closed 1 year ago
Let me take a look
It's to do with the starting point.
The quickest work-around is to explicitly set a valid starting point:
julia> model = Model(PATHSolver.Optimizer)
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: Path 5.0.03
julia> set_optimizer_attribute(model, "output", "no")
julia> @variable(model, x[1:4] >= 0, start = 0)
4-element Vector{VariableRef}:
x[1]
x[2]
x[3]
x[4]
julia> @constraint(model, M * x .+ q ⟂ x)
[-x[3] - x[4] + 2, x[3] - 2 x[4] + 2, x[1] - x[2] + 2 x[3] - 2 x[4] - 2, x[1] + 2 x[2] - 2 x[3] + 4 x[4] - 6, x[1], x[2], x[3], x[4]] ∈ MathOptInterface.Complements(8)
julia> optimize!(model)
(M, q, lower, upper, initial) = (
⋅ ⋅ -1.0 -1.0
⋅ ⋅ 1.0 -2.0
1.0 -1.0 2.0 -2.0
1.0 2.0 -2.0 4.0, [2.0, 2.0, -2.0, -6.0], [0.0, 0.0, 0.0, 0.0], [Inf, Inf, Inf, Inf], [0.0, 0.0, 0.0, 0.0])
Reading options file /var/folders/bg/dzq_hhvx1dxgy6gb5510pxj80000gn/T/jl_tgiBJB
Read of options file complete.
Path 5.0.03 (Fri Jun 26 09:58:07 2020)
Written by Todd Munson, Steven Dirkse, Youngdae Kim, and Michael Ferris
julia> value.(x)
4-element Vector{Float64}:
2.8
0.0
0.8
1.2
I'll make a PR with a better fix.
Fix incoming: https://github.com/chkwon/PATHSolver.jl/pull/81.
Should be released in an hour or so. Once a new release has been tagged, https://github.com/chkwon/PATHSolver.jl/releases, try updating your packages. You'll be after HiGHS.jl v1.4.1.
After upgrading PATHSolver.jl from v1.3.0 to v1.4.0, it now seems to produce incorrect solutions via JuMP v1.6.0. We have seen consistently incorrect results across a few setups: a 2016 MacBook Pro (Intel), a more recent MacBook Pro (M1), and a Windows laptop. If we revert PATHSolver.jl back to v1.3.0, then we get correct solutions again.
Here are summaries of two examples illustrating this behavior. The corresponding REPL output for each example is pasted subsequently.
When attempting to replicate the LCP example in PATHSolver.jl's README, PATHSolver.jl v1.4.0 instead reports the incorrect solution:
x = [6.0, 0.0, 0.0, 0.0]
.When attempting to solve the simple MLCP:
-1.0 + 2.0*u ⟂ u
withu
unbounded, PATHSolver.jl v1.4.0 reports the solution asu = 0.0
, which is incorrect. (Sinceu
is otherwise unbounded, this MLCP should instead be equivalent to the equation-1.0 + 2.0*u == 0.0
, by my reading of JuMP's documentation on complementarity constraints.)Here is the corresponding REPL output for Example 1 above (attempting to replicate the LCP in the README):
And here is the REPL output for Example 2 above (a simple MCP):