2
votes

I'm running CPLEX (version 125) on MATLAB using the CPLEX API. I am trying to solve a Constrained Quadratic Programming problem, and I'm running into a primal infeasibility. In particular,the MATLAB code for the problem is:

[ystar, Jstar, flag, output]= ...
           cplexqp(H, f, F, phi, G, gamma, ymin, ymax);

which corresponds to the problem:

ystar = argmin_y    y'*H*y + f'*y
  subject to:
  ymin <= y <= ymax
  G * y = gamma
  F * y <= phi

However, the solution ystar returned by cplexqcp is such that:

 max(F*ystar-phi) = 5.1854e-05

I would like to decrease this infeasibility gap. I tried to change the primal feasibility bound, but it seems it doesn't have any effect:

 ops=cplexoptimset('cplex');
 ops.feasopt.tolerance=1e-7;

How can I configure the solver so as to level the infeasibility? The solver gives the following diagnostic messages:

Number of nonzeros in lower triangle of Q = 2622
Using Approximate Minimum Degree ordering
Summary statistics for factor of Q:
  Rows in Factor            = 4248
  Integer space required    = 4362
  Total non-zeros in factor = 27048
  Total FP ops to factor    = 334848
Tried aggregator 1 time.
QP Presolve eliminated 1128 rows and 114 columns.
Aggregator did 80 substitutions.
Reduced QP has 7984 rows, 8302 columns, and 129418 nonzeros.
Reduced QP objective Q matrix has 4134 nonzeros.
Parallel mode: using up to 8 threads for barrier.
Number of nonzeros in lower triangle of A*A' = 433356
Using Approximate Minimum Degree ordering
Summary statistics for Cholesky factor:
  Threads                   = 8
  Rows in Factor            = 7984
  Integer space required    = 32473
  Total non-zeros in factor = 556316
  Total FP ops to factor    = 62101602
 Itn      Primal Obj        Dual Obj  Prim Inf Upper Inf  Dual Inf          
   0   1.6154270e+04  -1.8807064e+06  1.92e+06  2.77e+05  5.03e+06
   1   1.7649880e+06  -4.6190853e+06  5.23e+05  7.57e+04  1.37e+06
   2   1.8883665e+06  -4.8518299e+06  1.30e+05  1.89e+04  3.42e+05
   3   8.3385088e+05  -2.9607988e+06  2.05e+04  2.97e+03  5.39e+04
   ... (some lines are omitted for brevity)
  31   9.9411620e+01   9.9411598e+01  1.10e-08  9.27e-10  4.32e-08
  32   9.9411615e+01   9.9411611e+01  1.37e-08  1.47e-10  6.85e-09
  33   9.9411614e+01   9.9411614e+01  2.19e-08  6.10e-12  2.51e-08
Barrier time = 1.91 sec. (361.06 ticks)    
Total time on 8 threads = 1.91 sec. (361.06 ticks)

So it seems that the primal infeasibility of the solution is 2.19e-08; however, it seems that the solution is not that feasible.

Update: I normalised the equality and inequality constraints as follows:

F = F ./ kron( ones(1,size(F,2)), abs(phi) );
phi = sign(phi);

(Note: no element of phi is zero or near-zero. This way, all elements of phi become either 1 or -1.) and

for i=1:numel(gamma)
  if (abs(gamma(i))>1e-4)
    G(i,:) = G(i,:)/abs(gamma(i));
    gamma(i) = sign(gamma(i));
  end
end    

The infeasibility I'm getting now is 5.577e-07 calculated as max(F*ystar-phi) (for the updated normalised matrices F and phi). Is CPLEX using an interior-point solver? If yes, there shouldn't be any infeasibility.

Update 2: I have uploaded the data for this problem and a test case HERE.

1

1 Answers

2
votes

The parameter feasopt.tolerance applies to feasOpt, which is a separate algorithm intended for debugging models and won't affect the optimizer. You want the parameter EpRhs which determines how much constraints can be violated in an optimal solution. You can use cplexoptimset('EpRhs', 1e-6') to set the parameter.