Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when MOI tries to query the dual solution of a QCQP #309

Closed
mtanneau opened this issue Jul 1, 2020 · 3 comments · Fixed by #321
Closed

Error when MOI tries to query the dual solution of a QCQP #309

mtanneau opened this issue Jul 1, 2020 · 3 comments · Fixed by #321

Comments

@mtanneau
Copy link
Contributor

mtanneau commented Jul 1, 2020

I'm running into this error when solving a QCQP with CPLEX. (see below for link to instance).
It seems to be related to the absence/presence of dual variables.

Note that the error occurs within the call to MOI.optimize!; calling CPLEX.optimize!(cpx.inner) does not raise any error.

import CPLEX
import MathOptInterface
const MOI = MathOptInterface

mof = MOI.FileFormats.MOF.Model()
MOI.read_from_file(mof, "cgcp.mof")

cpx=  CPLEX.Optimizer()
MOI.copy_to(cpx, mof)

MOI.optimize!(cpx)

raises the error

Version identifier: 12.10.0.0 | 2019-11-26 | 843d4de
Tried aggregator 1 time.
QCP Presolve eliminated 1 rows and 23 columns.
Aggregator did 14 substitutions.
Reduced QCP has 30 rows, 48 columns, and 85 nonzeros.
Reduced QCP has 11 quadratic constraints.
Presolve time = 0.00 sec. (0.04 ticks)
Parallel mode: using up to 8 threads for barrier.
Number of nonzeros in lower triangle of A*A' = 368
Using Approximate Minimum Degree ordering
Total time for automatic ordering = 0.00 sec. (0.01 ticks)
Summary statistics for Cholesky factor:
  Threads                   = 8
  Rows in Factor            = 30
  Integer space required    = 47
  Total non-zeros in factor = 398
  Total FP ops to factor    = 7066
 Itn      Primal Obj        Dual Obj  Prim Inf Upper Inf  Dual Inf Inf Ratio
   0   5.5683686e+01   0.0000000e+00  2.57e+01  0.00e+00  5.18e+02  1.00e+00
   1   5.3021286e+01  -1.7264892e+00  2.57e+01  0.00e+00  5.18e+02  6.50e-01
   2   7.1670240e+00  -3.3115288e+01  2.55e+01  0.00e+00  5.14e+02  1.05e-01
   3  -6.8434212e+01  -8.0049405e+01  2.26e+01  0.00e+00  4.55e+02  5.75e-02
   4  -2.5242076e+01  -3.3640323e+01  1.31e+01  0.00e+00  2.65e+02  3.01e-01
   5  -6.1799726e+00  -8.1199681e+00  5.30e+00  0.00e+00  1.07e+02  2.78e+00
   6  -3.0068095e+00  -3.9322157e+00  1.04e+00  0.00e+00  2.10e+01  5.31e+00
   7  -1.3315820e+00  -1.7592574e+00  5.04e-01  0.00e+00  1.02e+01  7.54e+00
   8  -7.7572327e-01  -8.9679876e-01  2.54e-01  0.00e+00  5.12e+00  2.32e+01
   9  -4.3256118e-01  -4.5677784e-01  7.43e-02  0.00e+00  1.50e+00  1.09e+02
  10  -4.1508915e-01  -4.2372981e-01  1.51e-02  0.00e+00  3.05e-01  2.96e+02
  11  -3.9575998e-01  -3.9612075e-01  5.44e-03  0.00e+00  1.10e-01  7.05e+03
  12  -3.9503422e-01  -3.9509833e-01  2.27e-04  0.00e+00  4.59e-03  3.94e+04
  13  -3.9496659e-01  -3.9499011e-01  4.05e-05  0.00e+00  8.17e-04  1.03e+05
  14  -3.9491515e-01  -3.9492168e-01  1.50e-05  0.00e+00  3.03e-04  3.57e+05
  15  -3.9490664e-01  -3.9490784e-01  4.23e-06  0.00e+00  8.52e-05  1.88e+06
  16  -3.9490365e-01  -3.9490374e-01  7.81e-07  0.00e+00  1.58e-05  2.33e+07
CPLEX Error  1232: No dual solution exists.

ERROR: CPLEX.CplexError(1232, "CPLEX Error  1232: No dual solution exists.\n")
Stacktrace:
 [1] c_api_getdj at /home/mtanneau/.julia/packages/CPLEX/Hxpuk/src/cpx_solve.jl:150 [inlined]
 [2] optimize!(::CPLEX.Optimizer) at /home/mtanneau/.julia/packages/CPLEX/Hxpuk/src/MOI/MOI_wrapper.jl:1913
 [3] top-level scope at REPL[9]:1

(the first line is printed by CPLEX, the rest is Julia's error message).

There seems to be a disagreement between CPLEX and MOI over the dual solution.
MOI claims that the model is solved to optimality, with both primal and dual status at MOI.FEASIBLE_POINT.
CPLEX claims there is no dual solution.

Find the problematic instance here, or use the download link.

@odow
Copy link
Member

odow commented Jul 1, 2020

Is this on the latest release? The status codes got updated.

@mtanneau
Copy link
Contributor Author

mtanneau commented Jul 1, 2020

Yes, latest release and on master. (Just tried master 40s ago)

[EDIT]: did you mean latest release of CPLEX? I'm using 12.10.0.0

@odow
Copy link
Member

odow commented Oct 1, 2020

Current master gives

julia> MOI.get(cpx, MOI.TerminationStatus())
OPTIMAL::TerminationStatusCode = 1

julia> MOI.get(cpx, MOI.PrimalStatus())
FEASIBLE_POINT::ResultStatusCode = 1

julia> MOI.get(cpx, MOI.DualStatus())
NO_SOLUTION::ResultStatusCode = 0

But leaving this open until #295 is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants