ERGO-Code / HiGHS

Linear optimization software
MIT License
978 stars 182 forks source link

Small Linear Data Reconciliation QP Problem Solution Incorrect #934

Open jeffreydeankelly2 opened 2 years ago

jeffreydeankelly2 commented 2 years ago

Below is a relatively small linear data reconciliation problem formulated mathematically as a QP problem and output as a HiGHS LP file.

When solved in IPOPT and our home-grown equality-constrained QP the objective function = -28.65073, however when solved with HiGHS QP it gets -27223.81069 and the published answer is ~28.65.

The negative sign is due to the fact that we are maximizing the negative value.

Since the problem is unconstrained, this is why it solves using an equality-constrained QP.

Perhaps the small quadratic objective function weights are causing the issue in HiGHS ...


\ File written by Highs .lp filereader max obj: +1 x1 +0 x2 +0 x3 +0 x4 +0 x5 +0 x6 +0 x7 +0 x8 +0 x9 +0 x10 +0 x11 +0 x12 +0 x13 +0 x14 +0 x15 +0 x16 +0 x17 +0 x18 +0 x19 +0 x20 +0 x21 +0 x22 +0 x23 +0 x24 +0 x25 +0 x26 +0 x27 +0 x28 +0 x29 +0 x30 +0 x31 +0 x32 +0 x33 +0 x34 +0 x35 +0 x36 +0 x37 + [ +0 x0 x0 +0 x1 x1 +0 x2 x2 +0 x3 x3 +0 x4 x4 +0 x5 x5 +0 x6 x6 +0 x7 x7 +0 x8 x8 +0 x9 x9 +0 x10 x10 +0 x11 x11 +0 x12 x12 +0 x13 x13 +0 x14 x14 +0 x15 x15 +0 x16 x16 +0 x17 x17 +0 x18 x18 -1.86916e-07 x19 x19 -1.20482e-07 x20 x20 -4.0404e-08 x21 x21 -1.83486e-07 x22 x22 -0.31321 x23 x23 -2.95421e-08 x24 x24 -1.90476e-08 x25 x25 -4.25532e-07 x26 x26 -4.64792 x27 x27 -4.86665e-05 x28 x28 -2.41838e-07 x29 x29 -0.00259235 x30 x30 -0.305483 x31 x31 -2.35294e-08 x32 x32 -0.000268889 x33 x33 -0.00023892 x34 x34 -0.000499875 x35 x35 -2.41838e-06 x36 * x36 ]/2 st con1: +1 x2 +1 x20 = +64557 con2: +1 x3 +1 x21 = +79550 con3: +1 x4 +1 x22 = +140130 con4: +1 x5 +1 x23 = +65681 con5: +1 x6 +1 x24 = +10.08 con6: +1 x7 +1 x25 = +51411 con7: +1 x8 +1 x26 = +180540 con8: +1 x9 +1 x27 = +39573 con9: +1 x10 +1 x28 = +2.624 con10: +1 x11 +1 x29 = +3834.3 con11: +1 x12 +1 x30 = +49312 con12: +1 x13 +1 x31 = +841.92 con13: +1 x14 +1 x32 = +10.235 con14: +1 x15 +1 x33 = +181030 con15: +1 x16 +1 x34 = +344.98 con16: +1 x17 +1 x35 = +365.97 con17: +1 x18 +1 x36 = +600.66 con18: +1 x19 +1 x37 = +1762.4 con19: +1 x3 -1 x9 -1 x12 = -0 con20: +1 x5 -1 x6 -1 x7 = -0 con21: +1 x7 -1 x12 +1 x17 +1 x18 -1 x19 = -0 con22: +1 x2 -1 x5 -1 x18 = -0 con23: +1 x8 +1 x10 -1 x11 -1 x15 +1 x19 = -0 con24: -1 x4 +1 x6 -1 x9 -1 x10 +1 x11 -1 x13 -1 x14 +1 x15 +1 x16 = -0 con25: +1 x1 = -0 bounds -0 <= x1 <= -0 +0 <= x2 <= +inf +0 <= x3 <= +inf +0 <= x4 <= +inf +0 <= x5 <= +inf +0 <= x6 <= +inf +0 <= x7 <= +inf +0 <= x8 <= +inf +0 <= x9 <= +inf +0 <= x10 <= +inf +0 <= x11 <= +inf +0 <= x12 <= +inf +0 <= x13 <= +inf +0 <= x14 <= +inf +0 <= x15 <= +inf +0 <= x16 <= +inf +0 <= x17 <= +inf +0 <= x18 <= +inf +0 <= x19 <= +inf x20 free x21 free x22 free x23 free x24 free x25 free x26 free x27 free x28 free x29 free x30 free x31 free x32 free x33 free x34 free x35 free x36 free x37 free end


feldmeier commented 2 years ago

Thanks for spotting this and providing the QP, I'll investigate!

feldmeier commented 2 years ago

Sorry for the slow response. I couldn't reproduce the issue. This is likely due to a bug in the .lp writing procedure in HiGHS that was fixed recently- would you mind writing out the problem again using the latest version of HiGHS master?

jeffreydeankelly2 commented 2 years ago

No problem, I cannot re-solve with your latest version of HiGHS as I use the pre-compiled DLL's from JuMP but here is the MPS file instead of the LP sent previously.

ldrexample.mps.txt

NAME
ROWS N COST E R0
E R1
E R2
E R3
E R4
E R5
E R6
E R7
E R8
E R9
E R10
E R11
E R12
E R13
E R14
E R15
E R16
E R17
E R18
E R19
E R20
E R21
E R22
E R23
E R24
COLUMNS C0 COST -1 C0 R24 1 C1 R0 1 C1 R21 1 C2 R1 1 C2 R18 1 C3 R2 1 C3 R23 -1 C4 R3 1 C4 R19 1 C4 R21 -1 C5 R4 1 C5 R19 -1 C5 R23 1 C6 R5 1 C6 R19 -1 C6 R20 1 C7 R6 1 C7 R22 1 C8 R7 1 C8 R18 -1 C8 R23 -1 C9 R8 1 C9 R22 1 C9 R23 -1 C10 R9 1 C10 R22 -1 C10 R23 1 C11 R10 1 C11 R18 -1 C11 R20 -1 C12 R11 1 C12 R23 -1 C13 R12 1 C13 R23 -1 C14 R13 1 C14 R22 -1 C14 R23 1 C15 R14 1 C15 R23 1 C16 R15 1 C16 R20 1 C17 R16 1 C17 R20 1 C17 R21 -1 C18 R17 1 C18 R20 -1 C18 R22 1 C19 R0 1 C20 R1 1 C21 R2 1 C22 R3 1 C23 R4 1 C24 R5 1 C25 R6 1 C26 R7 1 C27 R8 1 C28 R9 1 C29 R10 1 C30 R11 1 C31 R12 1 C32 R13 1 C33 R14 1 C34 R15 1 C35 R16 1 C36 R17 1 RHS RHS_V R0 64557 RHS_V R1 79550 RHS_V R2 140130 RHS_V R3 65681 RHS_V R4 10.08 RHS_V R5 51411 RHS_V R6 180540 RHS_V R7 39573 RHS_V R8 2.624 RHS_V R9 3834.3 RHS_V R10 49312 RHS_V R11 841.92 RHS_V R12 10.235 RHS_V R13 181030 RHS_V R14 344.98 RHS_V R15 365.97 RHS_V R16 600.66 RHS_V R17 1762.4 BOUNDS FX BOUND C0 -0 FR BOUND C19
FR BOUND C20
FR BOUND C21
FR BOUND C22
FR BOUND C23
FR BOUND C24
FR BOUND C25
FR BOUND C26
FR BOUND C27
FR BOUND C28
FR BOUND C29
FR BOUND C30
FR BOUND C31
FR BOUND C32
FR BOUND C33
FR BOUND C34
FR BOUND C35
FR BOUND C36
QUADOBJ C19 C19 1.86915887850467e-07 C20 C20 1.20481927710843e-07 C21 C21 4.04040404040404e-08 C22 C22 1.8348623853211e-07 C23 C23 0.313209615535197 C24 C24 2.95420974889217e-08 C25 C25 1.9047619047619e-08 C26 C26 4.25531914893617e-07 C27 C27 4.64792005577504 C28 C28 4.8666536889235e-05 C29 C29 2.41837968561064e-07 C30 C30 0.00259235255994815 C31 C31 0.305483427524057 C32 C32 2.35294117647059e-08 C33 C33 0.000268889486421081 C34 C34 0.000238920081232828 C35 C35 0.000499875031242189 C36 C36 2.41837968561064e-06 ENDATA