Cbc icon indicating copy to clipboard operation
Cbc copied to clipboard

CBC with semi continuous and binary variables reports infeasible or runs long

Open raller09 opened this issue 1 year ago • 1 comments

Hi,

coming from lpSolve I'm testing a model with Semi-continuous and binary variables with different solvers with https://neos-server.org/neos/solvers/index.html and CBC, Gurobi + CPLEX

With my model (v1 had missing SC upper bounds which are needed by Gurobi + CPLEX, I guess CBC takes +infinity) 2_bad_scaling_bin_SC_with_upper.mps

cbc reports: Result - Problem proven infeasible

both others can solve it in a reasonable short time: Gurobi Optimal solution found (tolerance 1.00e-04) Best objective 1.458200594112e+05, best bound 1.458162060864e+05, gap 0.0026%
CPLEX MIP - Integer optimal, tolerance (0.0001/1e-06): Objective = 1.4581981462e+05 Current MIP best bound = 1.4581719846e+05 (gap = 2.61616, 0.00%) Solution time = 0.29 sec. Iterations = 1257 Nodes = 77 (7) Deterministic time = 235.10 ticks (806.08 ticks/sec)

I tried something more with my model and found the Big M?!? value for my bin variables a little high?!? If i reduce it to a smaller but "big enough" value: 3_smaller_bin_SC_with_upper

cbc runs long Gurobi Optimal solution found (tolerance 1.00e-04) Best objective 1.458200594112e+05, best bound 1.458162060864e+05, gap 0.0026% CPLEX MIP - Integer optimal, tolerance (0.0001/1e-06): Objective = 1.4581981462e+05 Current MIP best bound = 1.4581719846e+05 (gap = 2.61616, 0.00%) Solution time = 0.29 sec. Iterations = 1257 Nodes = 77 (7) Deterministic time = 235.09 ticks (810.31 ticks/sec)

-> for Gurobi + CPLEX no difference cbc finds a solution but not the optimal (as long as I've waited)

so I think that 381 semi-continuous variables - report odd behavior happens...

if i change the Semi-continuous to using an "extra binary variable" as described on http://yetanothermathprogrammingconsultant.blogspot.com/2016/08/semi-continuous-variables.html

(unfortunately my sorting of the variables changes)

CBC will solve it:

Result - Optimal solution found

Objective value: 145817.32105125 Enumerated nodes: 14 Total iterations: 3263 Time (CPU seconds): 2.30 Time (Wallclock seconds): 2.30

Should or can I use semi-continuous with cbc or should I switch to using binary variables? Is my model badly designed? Cbc-releases.2.10.8 shows the same behavior.

Model.zip

Thank you

Ralf

raller09 avatar Mar 16 '23 10:03 raller09

Looks like a problem with preprocessing. With -preprocess off I get

Objective value: 145817.32105125

in a few seconds. Will have a look at preprocessing.

jjhforrest avatar Mar 18 '23 10:03 jjhforrest