Forum Discussion
FICO
3 years agoCommunity Manager
Is it possible to disable the implicit factor of 0.5 in the optimization objectives quadratic part?
Through trial and error, I figured out, that the XPress optimizer is using an implicit factor of 0.5 in the quadratic part of the optimization objective (which doesn't show up in the mps dumps btw.) and I suspect this is also the case for quadratic constraints. Can someone confirm this?
I can work around this issue on my side, by multiplying all quadratic terms by 2.0, but it would be more convenient and less error-prone, if I could simply disable this implicit factor altogether. Is it possible to do it?
Attached is a minimal mps file to illustrate this:
NAME
OBJSENSE MAXIMIZE
ROWS
N __OBJ___
COLUMNS
x __OBJ___ 4
BOUNDS
UP BND00001 x 1
QUADOBJ
x x -4
ENDATANaively, I would read this as a one dimensional optimization problem, maximizing the function 4x - 4x^2 over the variable "x", which has it's maximum at a = 0.5, but XPress returns x = 0.998 as the optimal value.
4 Replies
- FICOCommunity Manager
Dear Patrick,
This behaviour is documented at https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML/chapter10.html?scroll=subsection13
I believe this is consistent with how other solvers treat the quadratic extension of the MPS format.
Unfortunately, this cannot be changed.
Best,
Imre Polik
- FICOCommunity Manager
I see. Yes, the display part in the .mps file may be one thing, however the implicit 0.5 is also applied, when setting the matrix coefficients through the API using XPRSprob::addQMatrix and this is not what my experience with other solvers like Gurobi and SCIP has been.
Also, it's not specifically mentioned, but if I interpret the example of the quadratic restriction correctly, the implicit 0.5 is not applied on the quadratic part of restrictions. So technically, I could circumnavigate this implicit 0.5 factor by setting up my quadratic objective using a quadratic constraint by introducing another variable for the objective value and maximize or minimize that one?
- FICOCommunity Manager
Dear Patrick,
Yes, as documented here
You can use a type N row to indicate on objective. This is also in the documentation:
NOTE: technically, there is one exception for the restriction on the row type being L or G. If the row is the first nonbinding row (type N) then the section is treated as a QMATRIX section instead. Please be aware, that this also means that the objective specific implied divider of 2 will be assumed (Q matrix has an implicit factors of 0.5 when included in the objective function, see the QMATRIX section). It's probably much better to use the QMATRIX or QUADOBJ sections to define quadratic objectives.
Your solution is using an objective transfer variable would also work.
Best,
Imre Polik
- FICOCommunity Manager
Hi Imre,
I read this part of the documentation, but cannot make sense out of it: The first sentence claims, there is an exception, for rows of type L or G, but then the second sentence doesn't seem to explain the exception and is rather concerned about rows of type N instead.
Anyway, I can confirm, that using the objective transfer variable works and doesn't include the implicit factor of 0.5.

