Warning: max constraint violation and gurobi ignores constrains

Hi I’m trying to solve a SOCP problem which includes binary variables, when I run the code the status is solved but gurobi ignores constraints. I have tried to turn off presolve by using cvx_solver_settings(‘Presolve’,0), use the primal simplex instead of the barrier algorithm, and these others commands cvx_solver_settings(‘aggregate’,0), cvx_solver_settings(‘reset’,1), but nothing seems working

Is there something I overlooked?

I would really appreciate any help here.
Thank you in advance.

Here is the output cvx produces:

Warning: Unknown parameter: ‘isvname’

In cvx_gurobi
In cvx_gurobi
In cvx_global (line 85)
In cvxprob (line 4)
In cvx_begin (line 41)
In bombeo_PU (line 542)
Warning: Unknown parameter: ‘appname’

In cvx_gurobi
In cvx_gurobi
In cvx_global (line 85)
In cvxprob (line 4)
In cvx_begin (line 41)
In bombeo_PU (line 542)
Warning: Unknown parameter: ‘isv_key’

In cvx_gurobi
In cvx_gurobi
In cvx_global (line 85)
In cvxprob (line 4)
In cvx_begin (line 41)
In bombeo_PU (line 542)
Warning: Unknown parameter: ‘isvname’

In cvx_gurobi
In cvx_gurobi
In cvx_global (line 85)
In cvxprob (line 4)
In cvx_begin (line 41)
In bombeo_PU (line 542)
Warning: Unknown parameter: ‘appname’

In cvx_gurobi
In cvx_gurobi
In cvx_global (line 85)
In cvxprob (line 4)
In cvx_begin (line 41)
In bombeo_PU (line 542)
Warning: Unknown parameter: ‘isv_key’

In cvx_gurobi
In cvx_gurobi
In cvx_global (line 85)
In cvxprob (line 4)
In cvx_begin (line 41)
In bombeo_PU (line 542)

Calling Gurobi 7.52: 6622 variables, 5934 equality constraints

Gurobi optimizer, licensed to CVX for CVX
Academic license - for non-commercial use only
Optimize a model with 5934 rows, 6622 columns and 16303 nonzeros
Model has 168 quadratic constraints
Variable types: 6574 continuous, 48 integer (48 binary)
Coefficient statistics:
Matrix range [3e-02, 7e+02]
QMatrix range [1e+00, 1e+00]
Objective range [2e+01, 2e+03]
Bounds range [1e+00, 1e+00]
RHS range [7e-15, 8e+02]
Presolve removed 3698 rows and 4284 columns
Presolve time: 0.08s
Presolved: 2236 rows, 2338 columns, 7487 nonzeros
Variable types: 2290 continuous, 48 integer (48 binary)

Root relaxation: objective 2.408975e+05, 1186 iterations, 0.04 seconds

Nodes    |    Current Node    |     Objective Bounds      |     Work

Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time

  • 0 0 0 725934.31006 725934.310 0.00% - 1s

Explored 0 nodes (3824 simplex iterations) in 1.76 seconds
Thread count was 4 (of 4 available processors)

Solution count 1: 725934

Optimal solution found (tolerance 1.00e-04)
Warning: max constraint violation (2.8647e-07) exceeds tolerance
Best objective 7.259343100600e+05, best bound 7.259343100600e+05, gap 0.0000%

Status: Solved
Optimal value (cvx_optval): +845934

cvx_cputime =

25.4688

For reasons unknown to me (perhaps a bug in the CVX/Gurobi interface), it appears that incorrect solutions are sometimes produced using Gurobi as solver. I suggest you try another solver.

That said, I’m not sure Gurobi is actually producing an incorrect solution in this case. Do you have evidence constraints are being ignored, as opposed to not being met with your desired tolerance? The optimal objective of 7e5 is rather large, so better scaling might improve numerical performance and constraint satisfaction, regardless of which solve is used. You can also try cvx_solver_settings('NumericFocus',3) when using Gurobi.

when I check this constraint that must be zero, it isn’t zero. I tried what you said and it doesn’t work sadly.