-
Notifications
You must be signed in to change notification settings - Fork 230
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
Misinterpreting QCP as MIQCP #80
Comments
Hello, The problem type you see is directly queried from CPLEX, this is not DOcplex code. |
Hi |
SOS set constraints are added to the model via the |
I didn't add any constraint using this method. I used the model.add_constraint method for everything. I have nearly 500 constraints and I'm unable to identify which is SOS. Is there a way to identify? |
Do you have piecewise? In cplex, PWL functions in the problem are internally reformulated with SOS2. |
No I dont. It is a second order cone program, so it is convex |
I just realised the issue. I have absolute value constraints which is formulated as SOS. Do you have any suggestions how to reformulate this? |
Good news. Yes, some docplex constructs also generate sos "under the hood".
What are you using the abs value for? the sos is there to implement that a
variable Z is exactly equal to the absolute value of some X.
So I would have to ideas:
1. if possible, reformulate the model with positive variables, eliminating
the need for abs. if Z can take negative or positive values, introduce
two positive values Z1 and Z2 such that Z = Z1 - Z2, Then minimize the sum
Z1+Z2 as a secondary objective.
2. if absolute values are used in <= and <= constraints only then you don't
need an exact absolute value.
For example, abs(X) <= Z can be rewritten as X <= Z and --X <= Z
Sorry for the trouble, this should be emphasized in the documentation.
Le mar. 18 oct. 2022 à 13:49, Anjula-Antonis ***@***.***> a
écrit :
… I just realised the issue. I have absolute value constraints which is
formulated as SOS. Do you have any suggestions how to reformulate this?
—
Reply to this email directly, view it on GitHub
<#80 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJLZWW2INRTMS7BKRPTZUQDWD2FGFANCNFSM6AAAAAAREIVP3M>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Thank you so much for the suggestions. |
If X and Y are positive (which I guess) , then minimizing X+Y should minimize the absolute value of Z=X-Y. At the end of the solve, at most one of X,Y should be nonzero. And no need for an exact abs value... |
Hi Philippe
|
Hello,
To investigate infeasible models , I suggest you have a look at the Relaxer class, this is described in details in the
With this mode cplex will report modeling issues which might cause numerical instabilities. |
Hi |
Big-M constraints can usually be modeled using Cplex indicator or equivalence constraints. An indicator constraint acts as a logical implication (one-way) from the value of a binary variable and the satisfaction of a linear constraint, without introducing artificial big-Ms. See the However, I hope this is not the original model which started this discussion, because indicators only work with binary variables (and add some extra under the hood), so that Cplex works with a MIP problem. |
Hi Philippe |
just a correction to my previous text. I am getting a sub-optimal solution. |
Hi,
Side idea: set If none of this helps, you might attach a LP file here and I'll take a look. Note that I'm not with IBM anymore so this would not be IBM support, . |
Hi, I suspect my feasibility set is small, could this be a reason for sub-optimal value? |
Hi
The first quadratic constraint is:
which, to me, is non convex due to the non-separable product. As such, Cplex refuses to solve it as non-convex QCPs are not supported. The fact that this non-convexity is detected hen widening the bounds seems suspicious to me. To summarize, your model has sound data and formulation. It exhibits at least one issue with presolve and another issue with the detection of non-convex QCPs. In the meantime you can try narrowing the bounds of free variables, though I don't understand what happens with convexity here. I used the code below to change bounds and trigger the convexity error:
I also found the following support note on non-convex qcps, I did not try them, I understand all that is a bit negative and I am very sorry for that. |
Hi Philippe, Thanks again for all your help. I really appreciate it |
Hi,
I have written a code to find the duals of a QCP problem. But DOcplex is misinterpreting QCP as MIQCP. What could be the reasons for this?
Model: Con_acopf2
Version identifier: 22.1.0.0 | 2022-03-09 | 1a383f8ce
CPXPARAM_Read_DataCheck 1
MIP Presolve eliminated 2 redundant SOS constraints.
Tried aggregator 2 times.
MIQCP Presolve eliminated 3522 rows and 6143 columns.
MIQCP Presolve modified 4 coefficients.
Aggregator did 297 substitutions.
Reduced MIQCP has 630 rows, 862 columns, and 2037 nonzeros.
Reduced MIQCP has 0 binaries, 0 generals, 76 SOSs, and 0 indicators.
Reduced MIQCP has 133 quadratic constraints.
Presolve time = 0.00 sec. (6.58 ticks)
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: deterministic, using up to 4 threads.
Root relaxation solution time = 0.00 sec. (3.36 ticks)
The text was updated successfully, but these errors were encountered: