unbounded status returned for infeasible problem
Opened this issue · 1 comments
mlubin commented
With the following Julia code, I build two problems. The first one is declared unbounded (although I know it's infeasible). The second problem is the same as the first, except with a zero objective. This one is properly declared infeasible.
import ECOS
import MathProgBase
I = [1,1,2,5,3,4,7,1,2,3,4,5,6,7,8]
J = [1,2,2,2,3,3,3,4,5,6,7,8,9,10,2]
V = [1.0,-3.0,1.0,-2.0,-1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]
A = sparse(I,J,V)
b = [0.0,10.0,1.0,1.0,0.0,1.0,9.0,10.0]
c = [-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
var_cones = [(:Free,1:3),(:Zero,4:4),(:NonNeg,5:5),(:SOC,6:8),(:NonNeg,9:9),(:NonNeg,10:10)]
constr_cones = [(:Zero, 1:length(b))]
m = MathProgBase.model(ECOS.ECOSSolver(verbose=1))
MathProgBase.loadconicproblem!(m, c, A, b, constr_cones, var_cones)
MathProgBase.optimize!(m)
@show MathProgBase.status(m)
m = MathProgBase.model(ECOS.ECOSSolver(verbose=1))
MathProgBase.loadconicproblem!(m, zeros(length(c)), A, b, constr_cones, var_cones)
MathProgBase.optimize!(m)
@show MathProgBase.status(m)
The output on my machine is:
ECOS 2.0.2 - (C) embotech GmbH, Zurich Switzerland, 2012-15. Web: www.embotech.com/ECOS
It pcost dcost gap pres dres k/t mu step sigma IR | BT
0 -3.000e+01 -3.000e+01 +3e+01 2e-01 3e-01 1e+00 6e+00 --- --- 1 1 - | - -
1 -3.000e+01 +1.528e+02 +2e+01 7e+01 2e+01 2e+02 3e+00 0.6243 3e-01 1 1 1 | 0 0
2 -3.000e+01 -2.386e+01 +1e+00 5e+00 3e-01 7e+00 2e-01 0.9542 1e-02 1 1 1 | 0 0
3 -3.000e+01 +6.259e+02 +1e-02 1e+01 3e-01 7e+02 2e-03 0.9890 1e-04 2 2 2 | 0 0
4 -3.000e+01 +5.940e+04 +1e-04 1e+01 3e-01 6e+04 2e-05 0.9890 1e-04 4 3 3 | 0 0
5 -3.000e+01 +5.376e+06 +1e-06 1e+01 3e-01 5e+06 3e-07 0.9890 1e-04 6 5 5 | 0 0
6 -2.999e+01 +4.863e+08 +2e-08 1e+01 3e-01 5e+08 3e-09 0.9890 1e-04 1 1 1 | 0 0
UNBOUNDED (within feastol=9.5e-09).
Runtime: 0.000319 seconds.
MathProgBase.status(m) => :Unbounded
ECOS 2.0.2 - (C) embotech GmbH, Zurich Switzerland, 2012-15. Web: www.embotech.com/ECOS
It pcost dcost gap pres dres k/t mu step sigma IR | BT
0 +0.000e+00 -0.000e+00 +3e+01 2e-01 6e-01 1e+00 6e+00 --- --- 1 0 - | - -
1 +0.000e+00 +1.828e+02 +2e+01 7e+01 2e+01 2e+02 3e+00 0.6243 3e-01 1 1 1 | 0 0
2 +0.000e+00 +6.140e+00 +1e+00 5e+00 3e-01 7e+00 2e-01 0.9542 1e-02 1 1 1 | 0 0
3 +0.000e+00 +6.559e+02 +1e-02 1e+01 3e-01 7e+02 2e-03 0.9890 1e-04 2 2 2 | 0 0
4 +0.000e+00 +5.943e+04 +1e-04 1e+01 3e-01 6e+04 2e-05 0.9890 1e-04 3 3 3 | 0 0
5 +0.000e+00 +5.376e+06 +1e-06 1e+01 3e-01 5e+06 3e-07 0.9890 1e-04 7 5 5 | 0 0
6 +0.000e+00 +4.863e+08 +2e-08 1e+01 3e-01 5e+08 3e-09 0.9890 1e-04 1 1 1 | 0 0
PRIMAL INFEASIBLE (within feastol=1.6e-10).
Runtime: 0.000239 seconds.
MathProgBase.status(m) => :Infeasible
mlubin commented
Just tested on 2.0.4, no change in behavior.