7
$\begingroup$

I am solving a MILP with cbc and gurobi (via pyomo). Gurobi states that the model is infeasible. As to cbc the solver status states that a feasible and optimal solution is found, but then it fails to access the value of the objective (which in turn crashed my program).

Here is how I access the objective value

solver_parameters = "ResultFile=model.lp"
opt = SolverFactory(solver)
        
results = opt.solve(self.model, tee=False, options_string=solver_parameters,logfile="model.log")
# checking status and terminiation condition
print ("The solver returned a status of: "+str(results.solver.status))
print (str(results.solver))
if (results.solver.status == SolverStatus.ok) and (results.solver.termination_condition== TerminationCondition.optimal):
   print ("Problem is feasible and solution is optimal")
        objective_value = value(self.model.objective)
else:
   print("Problem is infeasible")
   objective_value = None

With cbc I get

The solver returned a status of: ok

- Status: ok
  Message: CBC 2.10.5
  Termination condition: optimal
  Id: 0
  Error rc: 0
  Time: 0.011972904205322266

Problem is feasible and solution is optimal

ERROR: evaluating object as numeric value: x[0]
        (object: <class 'pyomo.core.base.var._GeneralVarData'>)
    No value for uninitialized NumericValue object x[0]
ERROR: evaluating object as numeric value: objective
        (object: <class 'pyomo.core.base.objective.SimpleObjective'>)
    No value for uninitialized NumericValue object x[0]
Traceback (most recent call last):
...
  File "c:...", line 531, in solve
    objective_value = value(self.model.objective)
  File "pyomo\core\expr\numvalue.pyx", line 246, in pyomo.core.expr.numvalue.value
  File "pyomo\core\expr\numvalue.pyx", line 231, in pyomo.core.expr.numvalue.value
  File "C:...\lib\site-packages\pyomo\core\base\expression.py", line 55, in __call__
    return self.expr(exception=exception)
  File "pyomo\core\expr\numeric_expr.pyx", line 218, in pyomo.core.expr.numeric_expr.ExpressionBase.__call__
  File "C:...\lib\site-packages\pyomo\core\expr\visitor.py", line 1054, in evaluate_expression
    return visitor.dfs_postorder_stack(exp)
  File "C:...\venv\lib\site-packages\pyomo\core\expr\visitor.py", line 584, in dfs_postorder_stack
    flag, value = self.visiting_potential_leaf(_sub)
  File "C:...\lib\site-packages\pyomo\core\expr\visitor.py", line 962, in visiting_potential_leaf
    return True, value(node)
  File "pyomo\core\expr\numvalue.pyx", line 246, in pyomo.core.expr.numvalue.value
  File "pyomo\core\expr\numvalue.pyx", line 233, in pyomo.core.expr.numvalue.value
ValueError: No value for uninitialized NumericValue object x[0]

Cbc log is

Solver command line: ['C:...\\cbc.exe', 'C:...\\AppData\\Local\\Temp\\tmp49biprhm.pyomo.nl', '-AMPL']

CBC 2.10.5: 

On the other hand with gurobi I get

WARNING: Loading a SolverResults object with a warning status into
    model.name="unknown";
      - termination condition: infeasible
      - message from solver: Model was proven to be infeasible.
The solver returned a status of: warning

- Status: warning
  Return code: 0
  Message: Model was proven to be infeasible.
  Termination condition: infeasible
  Termination message: Model was proven to be infeasible.
  Wall time: 0.0019626617431640625
  Error rc: 0
  Time: 0.08476400375366211

Problem is infeasible

I'm assuming problem is indeed infeasible and the error comes from cbc. Is this kind of error common, and what would be a way to avoid this?

Finally, this is the lp model returned by gurobi

\ Model x79
\ LP format - for model browsing. Use MPS format to capture full model detail.
Maximize
  - 100 x12 - 200 x13 - 300 x14 - 400 x15 - 70 x16 - 140 x17 - 90 x18
   - 90 x19
Subject To
 c_u_x80_: x12 - 100 x1 <= 0
 c_u_x81_: x13 - 100 x2 <= 0
 c_u_x82_: x14 - 100 x3 <= 0
 c_u_x83_: x15 - 100 x4 <= 0
 c_u_x84_: x16 - 50 x5 <= 0
 c_u_x85_: x17 - 50 x6 <= 0
 c_u_x86_: x18 - 25 x7 <= 0
 c_u_x87_: x19 - 25 x8 <= 0
 c_l_x88_: x12 >= 0
 c_l_x89_: x13 >= 0
 c_l_x90_: x14 >= 0
 c_l_x91_: x15 >= 0
 c_l_x92_: x16 >= 0
 c_l_x93_: x17 >= 0
 c_l_x94_: x18 >= 0
 c_l_x95_: x19 >= 0
 c_u_x96_: x1 <= 1
 c_u_x97_: x2 <= 1
 c_u_x98_: x3 <= 1
 c_u_x99_: x4 <= 1
 c_u_x100_: x5 <= 1
 c_u_x101_: x6 <= 1
 c_u_x102_: x7 <= 1
 c_u_x103_: x8 <= 1
 c_e_x104_: x12 + x16 = 51
 c_e_x105_: x13 + x17 = 51
 c_e_x106_: x14 + x18 = 51
 c_e_x107_: x15 + x19 = 51
 c_u_x108_: - x7 + x9 <= 0
 c_u_x109_: - x6 + x10 <= 0
 c_u_x110_: - x2 - x3 + x11 <= 0
 c_u_x111_: x7 - 2 x9 <= 0
 c_u_x112_: x6 - 2 x10 <= 0
 c_u_x113_: x2 + x3 - 2 x11 <= 0
 c_u_x114_: 100 x13 + 20 x14 + 100 x17 + 20 x18 <= 6072
 c_u_x115_: - 20 x18 + 1260 x9 <= 0
 c_u_x116_: - 100 x17 + 1260 x10 <= 0
 c_u_x117_: - 100 x13 - 20 x14 + 1260 x11 <= 0
 c_u_x118_: 2 x1 - x24 <= 0
 c_u_x119_: 2 x2 - x25 <= 0
 c_u_x120_: 15 x3 - x26 <= 0
 c_u_x121_: 10 x4 - x27 <= 0
 c_u_x122_: 1.4 x5 - x24 <= 0
 c_u_x123_: 1.4 x6 - x25 <= 0
 c_u_x124_: 4.5 x7 - x26 <= 0
 c_u_x125_: 2.25 x8 - x27 <= 0
 c_u_x126_: 100 x12 + 200 x13 + 300 x14 + 400 x15 + 70 x16 + 140 x17
   + 90 x18 + 90 x19 - 2550 x24 - 5100 x25 - 1020 x26 - 2040 x27 + 6072 x48
   + 100 x60 + 100 x61 + 100 x62 + 100 x63 + 50 x64 + 50 x65 + 25 x66
   + 25 x67 - 1260 x76 - 1260 x77 - 1260 x78 <= 0
 c_u_x127_: - 1000 x1 + x60 <= 0
 c_u_x128_: - 1000 x2 + x61 <= 0
 c_u_x129_: - 1000 x3 + x62 <= 0
 c_u_x130_: - 1000 x4 + x63 <= 0
 c_u_x131_: - 1000 x5 + x64 <= 0
 c_u_x132_: - 1000 x6 + x65 <= 0
 c_u_x133_: - 1000 x7 + x66 <= 0
 c_u_x134_: - 1000 x8 + x67 <= 0
 c_u_x135_: x60 - x32 <= 0
 c_u_x136_: x61 - x33 <= 0
 c_u_x137_: x62 - x34 <= 0
 c_u_x138_: x63 - x35 <= 0
 c_u_x139_: x64 - x36 <= 0
 c_u_x140_: x65 - x37 <= 0
 c_u_x141_: x66 - x38 <= 0
 c_u_x142_: x67 - x39 <= 0
 c_u_x143_: 1000 x1 - x60 + x32 <= 1000
 c_u_x144_: 1000 x2 - x61 + x33 <= 1000
 c_u_x145_: 1000 x3 - x62 + x34 <= 1000
 c_u_x146_: 1000 x4 - x63 + x35 <= 1000
 c_u_x147_: 1000 x5 - x64 + x36 <= 1000
 c_u_x148_: 1000 x6 - x65 + x37 <= 1000
 c_u_x149_: 1000 x7 - x66 + x38 <= 1000
 c_u_x150_: 1000 x8 - x67 + x39 <= 1000
 c_u_x151_: - 1000 x1 + x68 <= 0
 c_u_x152_: - 1000 x2 + x69 <= 0
 c_u_x153_: - 1000 x3 + x70 <= 0
 c_u_x154_: - 1000 x4 + x71 <= 0
 c_u_x155_: - 1000 x5 + x72 <= 0
 c_u_x156_: - 1000 x6 + x73 <= 0
 c_u_x157_: - 1000 x7 + x74 <= 0
 c_u_x158_: - 1000 x8 + x75 <= 0
 c_u_x159_: x68 - x40 <= 0
 c_u_x160_: x69 - x41 <= 0
 c_u_x161_: x70 - x42 <= 0
 c_u_x162_: x71 - x43 <= 0
 c_u_x163_: x72 - x44 <= 0
 c_u_x164_: x73 - x45 <= 0
 c_u_x165_: x74 - x46 <= 0
 c_u_x166_: x75 - x47 <= 0
 c_u_x167_: 1000 x1 - x68 + x40 <= 1000
 c_u_x168_: 1000 x2 - x69 + x41 <= 1000
 c_u_x169_: 1000 x3 - x70 + x42 <= 1000
 c_u_x170_: 1000 x4 - x71 + x43 <= 1000
 c_u_x171_: 1000 x5 - x72 + x44 <= 1000
 c_u_x172_: 1000 x6 - x73 + x45 <= 1000
 c_u_x173_: 1000 x7 - x74 + x46 <= 1000
 c_u_x174_: 1000 x8 - x75 + x47 <= 1000
 c_u_x175_: - 1000 x9 + x76 <= 0
 c_u_x176_: - 1000 x10 + x77 <= 0
 c_u_x177_: - 1000 x11 + x78 <= 0
 c_u_x178_: x76 - x49 <= 0
 c_u_x179_: x77 - x50 <= 0
 c_u_x180_: x78 - x51 <= 0
 c_u_x181_: 1000 x9 - x76 + x49 <= 1000
 c_u_x182_: 1000 x10 - x77 + x50 <= 1000
 c_u_x183_: 1000 x11 - x78 + x51 <= 1000
 c_l_x184_: - 50 x24 + x32 - x40 >= -100
 c_l_x185_: - 100 x25 + 100 x48 + x33 - x41 - 100 x51 >= -200
 c_l_x186_: - 20 x26 + 20 x48 + x34 - x42 - 20 x51 >= -300
 c_l_x187_: - 40 x27 + x35 - x43 >= -400
 c_l_x188_: - 50 x24 + x36 - x44 >= -70
 c_l_x189_: - 100 x25 + 100 x48 + x37 - x45 - 100 x50 >= -140
 c_l_x190_: - 20 x26 + 20 x48 + x38 - x46 - 20 x49 >= -90
 c_l_x191_: - 40 x27 + x39 - x47 >= -90
 c_u_x192_: x24 <= 2
 c_u_x193_: x25 <= 2
 c_u_x194_: x26 <= 15
 c_u_x195_: x27 <= 10
 c_e_ONE_VAR_CONSTANT: ONE_VAR_CONSTANT = 1
Bounds
 x24 free
 x25 free
 x26 free
 x27 free
Binaries
 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11
End

EDIT: MPS file below

NAME x79
OBJSENSE MAX
ROWS
 N  OBJ
 L  c_u_x80_
 L  c_u_x81_
 L  c_u_x82_
 L  c_u_x83_
 L  c_u_x84_
 L  c_u_x85_
 L  c_u_x86_
 L  c_u_x87_
 G  c_l_x88_
 G  c_l_x89_
 G  c_l_x90_
 G  c_l_x91_
 G  c_l_x92_
 G  c_l_x93_
 G  c_l_x94_
 G  c_l_x95_
 L  c_u_x96_
 L  c_u_x97_
 L  c_u_x98_
 L  c_u_x99_
 L  c_u_x100_
 L  c_u_x101_
 L  c_u_x102_
 L  c_u_x103_
 E  c_e_x104_
 E  c_e_x105_
 E  c_e_x106_
 E  c_e_x107_
 L  c_u_x108_
 L  c_u_x109_
 L  c_u_x110_
 L  c_u_x111_
 L  c_u_x112_
 L  c_u_x113_
 L  c_u_x114_
 L  c_u_x115_
 L  c_u_x116_
 L  c_u_x117_
 L  c_u_x118_
 L  c_u_x119_
 L  c_u_x120_
 L  c_u_x121_
 L  c_u_x122_
 L  c_u_x123_
 L  c_u_x124_
 L  c_u_x125_
 L  c_u_x126_
 L  c_u_x127_
 L  c_u_x128_
 L  c_u_x129_
 L  c_u_x130_
 L  c_u_x131_
 L  c_u_x132_
 L  c_u_x133_
 L  c_u_x134_
 L  c_u_x135_
 L  c_u_x136_
 L  c_u_x137_
 L  c_u_x138_
 L  c_u_x139_
 L  c_u_x140_
 L  c_u_x141_
 L  c_u_x142_
 L  c_u_x143_
 L  c_u_x144_
 L  c_u_x145_
 L  c_u_x146_
 L  c_u_x147_
 L  c_u_x148_
 L  c_u_x149_
 L  c_u_x150_
 L  c_u_x151_
 L  c_u_x152_
 L  c_u_x153_
 L  c_u_x154_
 L  c_u_x155_
 L  c_u_x156_
 L  c_u_x157_
 L  c_u_x158_
 L  c_u_x159_
 L  c_u_x160_
 L  c_u_x161_
 L  c_u_x162_
 L  c_u_x163_
 L  c_u_x164_
 L  c_u_x165_
 L  c_u_x166_
 L  c_u_x167_
 L  c_u_x168_
 L  c_u_x169_
 L  c_u_x170_
 L  c_u_x171_
 L  c_u_x172_
 L  c_u_x173_
 L  c_u_x174_
 L  c_u_x175_
 L  c_u_x176_
 L  c_u_x177_
 L  c_u_x178_
 L  c_u_x179_
 L  c_u_x180_
 L  c_u_x181_
 L  c_u_x182_
 L  c_u_x183_
 G  c_l_x184_
 G  c_l_x185_
 G  c_l_x186_
 G  c_l_x187_
 G  c_l_x188_
 G  c_l_x189_
 G  c_l_x190_
 G  c_l_x191_
 L  c_u_x192_
 L  c_u_x193_
 L  c_u_x194_
 L  c_u_x195_
 E  c_e_ONE_VAR_CONSTANT
COLUMNS
    x12       OBJ       -100
    x12       c_u_x80_  1
    x12       c_l_x88_  1
    x12       c_e_x104_  1
    x12       c_u_x126_  100
    x13       OBJ       -200
    x13       c_u_x81_  1
    x13       c_l_x89_  1
    x13       c_e_x105_  1
    x13       c_u_x114_  100
    x13       c_u_x117_  -100
    x13       c_u_x126_  200
    x14       OBJ       -300
    x14       c_u_x82_  1
    x14       c_l_x90_  1
    x14       c_e_x106_  1
    x14       c_u_x114_  20
    x14       c_u_x117_  -20
    x14       c_u_x126_  300
    x15       OBJ       -400
    x15       c_u_x83_  1
    x15       c_l_x91_  1
    x15       c_e_x107_  1
    x15       c_u_x126_  400
    x16       OBJ       -70
    x16       c_u_x84_  1
    x16       c_l_x92_  1
    x16       c_e_x104_  1
    x16       c_u_x126_  70
    x17       OBJ       -140
    x17       c_u_x85_  1
    x17       c_l_x93_  1
    x17       c_e_x105_  1
    x17       c_u_x114_  100
    x17       c_u_x116_  -100
    x17       c_u_x126_  140
    x18       OBJ       -90
    x18       c_u_x86_  1
    x18       c_l_x94_  1
    x18       c_e_x106_  1
    x18       c_u_x114_  20
    x18       c_u_x115_  -20
    x18       c_u_x126_  90
    x19       OBJ       -90
    x19       c_u_x87_  1
    x19       c_l_x95_  1
    x19       c_e_x107_  1
    x19       c_u_x126_  90
    MARKER    'MARKER'                 'INTORG'
    x1        c_u_x80_  -100
    x1        c_u_x96_  1
    x1        c_u_x118_  2
    x1        c_u_x127_  -1000
    x1        c_u_x143_  1000
    x1        c_u_x151_  -1000
    x1        c_u_x167_  1000
    x2        c_u_x81_  -100
    x2        c_u_x97_  1
    x2        c_u_x110_  -1
    x2        c_u_x113_  1
    x2        c_u_x119_  2
    x2        c_u_x128_  -1000
    x2        c_u_x144_  1000
    x2        c_u_x152_  -1000
    x2        c_u_x168_  1000
    x3        c_u_x82_  -100
    x3        c_u_x98_  1
    x3        c_u_x110_  -1
    x3        c_u_x113_  1
    x3        c_u_x120_  15
    x3        c_u_x129_  -1000
    x3        c_u_x145_  1000
    x3        c_u_x153_  -1000
    x3        c_u_x169_  1000
    x4        c_u_x83_  -100
    x4        c_u_x99_  1
    x4        c_u_x121_  10
    x4        c_u_x130_  -1000
    x4        c_u_x146_  1000
    x4        c_u_x154_  -1000
    x4        c_u_x170_  1000
    x5        c_u_x84_  -50
    x5        c_u_x100_  1
    x5        c_u_x122_  1.4
    x5        c_u_x131_  -1000
    x5        c_u_x147_  1000
    x5        c_u_x155_  -1000
    x5        c_u_x171_  1000
    x6        c_u_x85_  -50
    x6        c_u_x101_  1
    x6        c_u_x109_  -1
    x6        c_u_x112_  1
    x6        c_u_x123_  1.4
    x6        c_u_x132_  -1000
    x6        c_u_x148_  1000
    x6        c_u_x156_  -1000
    x6        c_u_x172_  1000
    x7        c_u_x86_  -25
    x7        c_u_x102_  1
    x7        c_u_x108_  -1
    x7        c_u_x111_  1
    x7        c_u_x124_  4.5
    x7        c_u_x133_  -1000
    x7        c_u_x149_  1000
    x7        c_u_x157_  -1000
    x7        c_u_x173_  1000
    x8        c_u_x87_  -25
    x8        c_u_x103_  1
    x8        c_u_x125_  2.25
    x8        c_u_x134_  -1000
    x8        c_u_x150_  1000
    x8        c_u_x158_  -1000
    x8        c_u_x174_  1000
    x9        c_u_x108_  1
    x9        c_u_x111_  -2
    x9        c_u_x115_  1260
    x9        c_u_x175_  -1000
    x9        c_u_x181_  1000
    x10       c_u_x109_  1
    x10       c_u_x112_  -2
    x10       c_u_x116_  1260
    x10       c_u_x176_  -1000
    x10       c_u_x182_  1000
    x11       c_u_x110_  1
    x11       c_u_x113_  -2
    x11       c_u_x117_  1260
    x11       c_u_x177_  -1000
    x11       c_u_x183_  1000
    MARKER    'MARKER'                 'INTEND'
    x24       c_u_x118_  -1
    x24       c_u_x122_  -1
    x24       c_u_x126_  -2550
    x24       c_l_x184_  -50
    x24       c_l_x188_  -50
    x24       c_u_x192_  1
    x25       c_u_x119_  -1
    x25       c_u_x123_  -1
    x25       c_u_x126_  -5100
    x25       c_l_x185_  -100
    x25       c_l_x189_  -100
    x25       c_u_x193_  1
    x26       c_u_x120_  -1
    x26       c_u_x124_  -1
    x26       c_u_x126_  -1020
    x26       c_l_x186_  -20
    x26       c_l_x190_  -20
    x26       c_u_x194_  1
    x27       c_u_x121_  -1
    x27       c_u_x125_  -1
    x27       c_u_x126_  -2040
    x27       c_l_x187_  -40
    x27       c_l_x191_  -40
    x27       c_u_x195_  1
    x48       c_u_x126_  6072
    x48       c_l_x185_  100
    x48       c_l_x186_  20
    x48       c_l_x189_  100
    x48       c_l_x190_  20
    x60       c_u_x126_  100
    x60       c_u_x127_  1
    x60       c_u_x135_  1
    x60       c_u_x143_  -1
    x61       c_u_x126_  100
    x61       c_u_x128_  1
    x61       c_u_x136_  1
    x61       c_u_x144_  -1
    x62       c_u_x126_  100
    x62       c_u_x129_  1
    x62       c_u_x137_  1
    x62       c_u_x145_  -1
    x63       c_u_x126_  100
    x63       c_u_x130_  1
    x63       c_u_x138_  1
    x63       c_u_x146_  -1
    x64       c_u_x126_  50
    x64       c_u_x131_  1
    x64       c_u_x139_  1
    x64       c_u_x147_  -1
    x65       c_u_x126_  50
    x65       c_u_x132_  1
    x65       c_u_x140_  1
    x65       c_u_x148_  -1
    x66       c_u_x126_  25
    x66       c_u_x133_  1
    x66       c_u_x141_  1
    x66       c_u_x149_  -1
    x67       c_u_x126_  25
    x67       c_u_x134_  1
    x67       c_u_x142_  1
    x67       c_u_x150_  -1
    x76       c_u_x126_  -1260
    x76       c_u_x175_  1
    x76       c_u_x178_  1
    x76       c_u_x181_  -1
    x77       c_u_x126_  -1260
    x77       c_u_x176_  1
    x77       c_u_x179_  1
    x77       c_u_x182_  -1
    x78       c_u_x126_  -1260
    x78       c_u_x177_  1
    x78       c_u_x180_  1
    x78       c_u_x183_  -1
    x32       c_u_x135_  -1
    x32       c_u_x143_  1
    x32       c_l_x184_  1
    x33       c_u_x136_  -1
    x33       c_u_x144_  1
    x33       c_l_x185_  1
    x34       c_u_x137_  -1
    x34       c_u_x145_  1
    x34       c_l_x186_  1
    x35       c_u_x138_  -1
    x35       c_u_x146_  1
    x35       c_l_x187_  1
    x36       c_u_x139_  -1
    x36       c_u_x147_  1
    x36       c_l_x188_  1
    x37       c_u_x140_  -1
    x37       c_u_x148_  1
    x37       c_l_x189_  1
    x38       c_u_x141_  -1
    x38       c_u_x149_  1
    x38       c_l_x190_  1
    x39       c_u_x142_  -1
    x39       c_u_x150_  1
    x39       c_l_x191_  1
    x68       c_u_x151_  1
    x68       c_u_x159_  1
    x68       c_u_x167_  -1
    x69       c_u_x152_  1
    x69       c_u_x160_  1
    x69       c_u_x168_  -1
    x70       c_u_x153_  1
    x70       c_u_x161_  1
    x70       c_u_x169_  -1
    x71       c_u_x154_  1
    x71       c_u_x162_  1
    x71       c_u_x170_  -1
    x72       c_u_x155_  1
    x72       c_u_x163_  1
    x72       c_u_x171_  -1
    x73       c_u_x156_  1
    x73       c_u_x164_  1
    x73       c_u_x172_  -1
    x74       c_u_x157_  1
    x74       c_u_x165_  1
    x74       c_u_x173_  -1
    x75       c_u_x158_  1
    x75       c_u_x166_  1
    x75       c_u_x174_  -1
    x40       c_u_x159_  -1
    x40       c_u_x167_  1
    x40       c_l_x184_  -1
    x41       c_u_x160_  -1
    x41       c_u_x168_  1
    x41       c_l_x185_  -1
    x42       c_u_x161_  -1
    x42       c_u_x169_  1
    x42       c_l_x186_  -1
    x43       c_u_x162_  -1
    x43       c_u_x170_  1
    x43       c_l_x187_  -1
    x44       c_u_x163_  -1
    x44       c_u_x171_  1
    x44       c_l_x188_  -1
    x45       c_u_x164_  -1
    x45       c_u_x172_  1
    x45       c_l_x189_  -1
    x46       c_u_x165_  -1
    x46       c_u_x173_  1
    x46       c_l_x190_  -1
    x47       c_u_x166_  -1
    x47       c_u_x174_  1
    x47       c_l_x191_  -1
    x49       c_u_x178_  -1
    x49       c_u_x181_  1
    x49       c_l_x190_  -20
    x50       c_u_x179_  -1
    x50       c_u_x182_  1
    x50       c_l_x189_  -100
    x51       c_u_x180_  -1
    x51       c_u_x183_  1
    x51       c_l_x185_  -100
    x51       c_l_x186_  -20
    ONE_VAR_CONSTANT  c_e_ONE_VAR_CONSTANT  1
RHS
    RHS1      c_u_x96_  1
    RHS1      c_u_x97_  1
    RHS1      c_u_x98_  1
    RHS1      c_u_x99_  1
    RHS1      c_u_x100_  1
    RHS1      c_u_x101_  1
    RHS1      c_u_x102_  1
    RHS1      c_u_x103_  1
    RHS1      c_e_x104_  51
    RHS1      c_e_x105_  51
    RHS1      c_e_x106_  51
    RHS1      c_e_x107_  51
    RHS1      c_u_x114_  6072
    RHS1      c_u_x143_  1000
    RHS1      c_u_x144_  1000
    RHS1      c_u_x145_  1000
    RHS1      c_u_x146_  1000
    RHS1      c_u_x147_  1000
    RHS1      c_u_x148_  1000
    RHS1      c_u_x149_  1000
    RHS1      c_u_x150_  1000
    RHS1      c_u_x167_  1000
    RHS1      c_u_x168_  1000
    RHS1      c_u_x169_  1000
    RHS1      c_u_x170_  1000
    RHS1      c_u_x171_  1000
    RHS1      c_u_x172_  1000
    RHS1      c_u_x173_  1000
    RHS1      c_u_x174_  1000
    RHS1      c_u_x181_  1000
    RHS1      c_u_x182_  1000
    RHS1      c_u_x183_  1000
    RHS1      c_l_x184_  -100
    RHS1      c_l_x185_  -200
    RHS1      c_l_x186_  -300
    RHS1      c_l_x187_  -400
    RHS1      c_l_x188_  -70
    RHS1      c_l_x189_  -140
    RHS1      c_l_x190_  -90
    RHS1      c_l_x191_  -90
    RHS1      c_u_x192_  2
    RHS1      c_u_x193_  2
    RHS1      c_u_x194_  15
    RHS1      c_u_x195_  10
    RHS1      c_e_ONE_VAR_CONSTANT  1
BOUNDS
 BV BND1      x1      
 BV BND1      x2      
 BV BND1      x3      
 BV BND1      x4      
 BV BND1      x5      
 BV BND1      x6      
 BV BND1      x7      
 BV BND1      x8      
 BV BND1      x9      
 BV BND1      x10     
 BV BND1      x11     
 FR BND1      x24     
 FR BND1      x25     
 FR BND1      x26     
 FR BND1      x27     
ENDATA

EDIT 2: I've been able to produce a second program with the same issue

EDIT 3: Using the *.lp (instead of *.mps) with stand alone cbc, I indeed obtain a similar result as Kuifje (problem is infeasible according to cbc). Might it be that the problem comes from pyomo?

$\endgroup$
6
  • $\begingroup$ Could you attach the MPS file as well please ? $\endgroup$
    – Kuifje
    Feb 10 at 14:44
  • $\begingroup$ @Kuifje Done! =) $\endgroup$
    – Meth
    Feb 10 at 14:47
  • 1
    $\begingroup$ github.com/coin-or/Cbc/issues/482#issuecomment-1036452518 . CBC maintainer is not able to replicate. $\endgroup$
    – Kuifje
    Feb 11 at 18:03
  • $\begingroup$ hum... (Thanks a lot for the effort btw!!) could the issue come from pyomo? $\endgroup$
    – Meth
    Feb 11 at 18:04
  • 1
    $\begingroup$ not sure. you could try and solve it with your stand alone version of cbc (fairly easy since you have your mps file) $\endgroup$
    – Kuifje
    Feb 11 at 18:10

1 Answer 1

10
$\begingroup$

If I read the lp file and try solving with CPLEX:

enter image description here

So I think your assumption is correct: the bug comes from CBC, as CPLEX and GUROBI both return infeasible. The CPLEX log also tells you which row is infeasible, you could try playing with the corresponding constraint. Maybe it is a tolerance issue (CBC, CPLEX and GUROBI may use different tolerances ?) ?

You can also access the ISS:

enter image description here

It is easy to see that the constraints imply : $$ 100 (\underbrace{x_{13}+x_{17}}_{=51}) + 20 (\underbrace{x_{14}+x_{18}}_{=51}) \le 6072 \quad \Longrightarrow \quad 6120 \le 6072 $$

which indeed is not possible. So clearly there is a problem with CBC.

ADDENDUM

Here is my log with CBC:

enter image description here

This version of CBC returns infeasible. Are you using the same version ?

$\endgroup$
5
  • $\begingroup$ Thanks for your answer! From this point on what's the way to go? Is there a way to make cbc more reliable on the solver's status and termination condition? $\endgroup$
    – Meth
    Feb 10 at 14:50
  • 1
    $\begingroup$ when I try with CBC, i get infeasible...are you using the same version ? $\endgroup$
    – Kuifje
    Feb 10 at 14:54
  • $\begingroup$ I've added cbc log to my OP (which is almost empty). In particular I am using CBC 2.10.5 $\endgroup$
    – Meth
    Feb 10 at 15:00
  • $\begingroup$ I haven't been able to install cbc 2.10.3 so far. Would you be able to check if 2.10.5 is working on your side? Is there a way to report this issue to the cbc team? $\endgroup$
    – Meth
    Feb 11 at 8:38
  • $\begingroup$ I am using the default CBC version embedded in PuLP and cannot select the version. I think you could post the issue on the GitHub repo : github.com/coin-or/Cbc $\endgroup$
    – Kuifje
    Feb 11 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.