coin-or / Clp

COIN-OR Linear Programming Solver
Other
392 stars 82 forks source link

QP: barrier method can't solve small problem #245

Open sergey-mogilnikov-kpbs opened 1 year ago

sergey-mogilnikov-kpbs commented 1 year ago

The problem as follow:

NAME Quad3
ROWS
 L  r1
 L  r2
 N  r3
COLUMNS
    x1        r1                  -1   r2                  -1
    x2        r1                  -2   r2                  -1
    x3        r1                  -3   r2                  -1
    x3        r3                   2
    x4        r1                  -4   r2                  -1
    x4        r3                 0.6
    x5        r1                  -5   r2                  -1
    x5        r3                 2.2
    x6        r1                  -6   r2                  -1
    x6        r3                   1
    x7        r1                  -7   r2                  -1
    x7        r3                 4.8
    x8        r1                  -8   r2                  -1
    x8        r3               -2.88
    x9        r1                  -9   r2                  -1
    x9        r3               -0.72
    x10       r1                 -10   r2                  -1
    x10       r3                -9.6
RHS
    RHS1      r1                -100   r2                 -13
    RHS1      r3               -3.44
BOUNDS
 UP BND1      x1               1E+20
 UP BND1      x2               1E+20
 UP BND1      x3               1E+20
 UP BND1      x4               1E+20
 UP BND1      x5               1E+20
 UP BND1      x6               1E+20
 UP BND1      x7               1E+20
 UP BND1      x8               1E+20
 UP BND1      x9               1E+20
 UP BND1      x10              1E+20
QUADOBJ
    x1  x1  2
    x2  x2  2
    x3  x3  2
    x3  x4  0.6
    x3  x5  0.2
    x3  x6  -1
    x4  x4  0.18
    x4  x5  0.06
    x4  x6  -0.3
    x5  x5  2.02
    x5  x6  1.9
    x6  x6  2.5
    x7  x7  10
    x7  x8  -4.8
    x7  x9  -1.2
    x7  x10  -16
    x8  x8  2.88
    x8  x9  0.72
    x8  x10  9.6
    x9  x9  0.18
    x9  x10  2.4
    x10  x10  32
ENDATA

The result as follow:

Executing algorithm...

Executing on prod-exec-1.neos-server.org
Coin LP version 1.17.7, build Apr 19 2022
command line - /opt/coin/clp clp.mps - 
At line 1 NAME Quad3
At line 2 ROWS
At line 6 COLUMNS
At line 25 RHS
At line 28 BOUNDS
At line 39 QUADOBJ
Problem Quad3 has 2 rows, 10 columns and 20 elements
At line 62 ENDATA
Model was imported from ./clp.mps in 0 seconds
Switching to line mode
Clp:35 elements in sparse Cholesky, flop count 189
0 Primal 200343.44 Dual -1.1952003e+23 Complementarity 1.1952003e+23 - 0 fixed, rank 14
1 Primal 507835.2 Dual -1.1952003e+23 Complementarity 1.1952003e+23 - 0 fixed, rank 14
2 Primal 1691401.5 Dual -1.1952003e+23 Complementarity 1.1952003e+23 - 0 fixed, rank 14
3 Primal 22681830 Dual -1.1952003e+23 Complementarity 1.1952003e+23 - 0 fixed, rank 14
4 Primal 4.1682367e+08 Dual -1.1952003e+23 Complementarity 1.1952003e+23 - 0 fixed, rank 14
5 Primal 1.9548372e+10 Dual -1.1952003e+23 Complementarity 1.1952003e+23 - 0 fixed, rank 14
6 Primal 4.8648899e+10 Dual -1.1952003e+23 Complementarity 1.1952003e+23 - 0 fixed, rank 14
7 Primal 9.4978103e+19 Dual 3.0315722e+19 Complementarity 6.4662381e+19 - 0 fixed, rank 14
8 Primal 8.8510344e+19 Dual 2.9947294e+19 Complementarity 5.8563049e+19 - 0 fixed, rank 14
9 Primal 9.0380469e+19 Dual 3.3071221e+19 Complementarity 5.7309248e+19 - 0 fixed, rank 14
10 Primal 7.876301e+19 Dual 4.2090125e+19 Complementarity 3.6672884e+19 - 0 fixed, rank 14
11 Primal 6.7465564e+19 Dual 6.2181853e+19 Complementarity 5.2837117e+18 - 0 fixed, rank 14
12 Primal 6.5250822e+19 Dual 6.4980757e+19 Complementarity 2.7006439e+17 - 0 fixed, rank 14
13 Primal 6.5159981e+19 Dual 6.5147616e+19 Complementarity 1.2364524e+16 - 0 fixed, rank 14
14 Primal 6.5155813e+19 Dual 6.5154614e+19 Complementarity 1.1994564e+15 - 0 fixed, rank 14
15 Primal 6.515561e+19 Dual 6.5155527e+19 Complementarity 8.3214375e+13 - 0 fixed, rank 14
16 Primal 6.5155606e+19 Dual 6.5155606e+19 Complementarity 5.5683547e+11 - 0 fixed, rank 14
17 Primal 6.5155606e+19 Dual 6.5155606e+19 Complementarity 2.7834737e+09 - 0 fixed, rank 14
18 Primal 6.5155606e+19 Dual 6.5155606e+19 Complementarity 13721318 - 3 fixed, rank 14
Optimal
At end primal/dual infeasibilities 0/1.0326586e+10, complementarity gap 13602283, objective 6.5155606e+19
Optimal objective 6.515560624e+19 - 36 iterations time 0.002
Clp:
Optimal - objective value   6.5155606e+19
      0 x1         2.1621354e+09           2.6702881e-05
      1 x2         2.3127631e+09           1.8119812e-05
      2 x3         6.3363482e+08               0.5477438
      3 x4         1.2615138e+10          -3.7500024e+09
      4 x5         1.9783198e+08           3.2573243e+09
      5 x6         3.9491372e+09          -4.0054321e-05
      6 x7         5.5110415e+09           0.00012969971
      7 x8         7.0136919e+09          -3.4988904e+09
      8 x9          5.527088e+09          -6.0007718e+09
      9 x10        5.4252409e+08           2.7449909e+09

Primal method gives right optimum (3.1267388)

It seems big values in right bounds leads to the wrong barrier method results...

jjhforrest commented 1 year ago

This should be fixed - but it almost looks as if you are trying to break the code. The code works if the BOUNDS section is taken out i.e. COIN_DBL_MAX as ub- or if bounds are changed to 1.0e10. But will look at it to see if simple fix.