mathematical-optimizationcplexor-toolsmixed-integer-programmingscip

Cplex giving wrong result


I created a sample test.lp file as follows:

Maximize
    y

Subject To
 +x1+100M+3M2+x4-y+A=0
 x1-M-M2-10x4>=-20
 x1 - 3 M + M2 <= 100
 M - 3.5 x4 + M2= 0
 A+x1<=140
 
Bounds
 x1<= 40
 2 <= x4 <= 3
 0<=x1
Binary
 M
Integer
 A
End

Used all default settings, and the following commands: read test.lp->opt->d sol v -

Result is:

Variable Name           Solution Value
y                           172.500000
x1                           40.000000
M                             1.000000
M2                            9.500000
x4                            3.000000
A                             1.000000

However, the result should be y=271.5 and A=100, the value of other variables seems okay.

This is also tested with google OR-Tools (SCIP solver), which gives proper results.

What did I miss?


Solution

  • If you change

    Integer
     A
    End
    

    into

    Generals
     A
    End
    

    you ll get the right solution