CBC无法解决可以在glpk中解决的优化问题

问题描述

我正在研究一些混合整数线性规划优化问题,并且已经在使用Pyomo测试了多个求解器。这些模型中的两种具有某些特殊性:在其中一种中,CBC返回错误(张贴在下面),而GLPK通常可以解决问题。另一个模型CBC返回了相同的错误,而GLPK从未完成其计算。错误如下:

command line - /usr/bin/cbc -printingOptions all -import
/tmp/tmpdw1ufytm.pyomo.lp -stat=1 -solve -solu /tmp/tmpdw1ufytm.pyomo.soln
(default strategy 1) Option for printingOptions changed from normal to all
Presolve is modifying 25 integer bounds and re-presolving Presolve 66
(-121) rows,64 (-65) columns and 198 (-271) elements Statistics for
presolved model Original problem has 92 integers (56 of which binary)
Presolved problem has 64 integers (41 of which binary) ==== 39 zero
objective 25 different ==== absolute objective values 25 different ====
for integers 39 zero objective 25 different ==== for integers absolute
objective values 25 different ===== end objective counts


Problem has 66 rows,64 columns (25 with objective) and 198 elements
Column breakdown: 21 of type 0.0->inf,2 of type 0.0->up,0 of type
lo->inf,0 of type lo->up,0 of type free,0 of type fixed,0 of type
-inf->0.0,0 of type -inf->up,41 of type 0.0->1.0 Row breakdown: 0 of
type E 0.0,0 of type E 1.0,0 of type E -1.0,0 of type E other,0 of
type G 0.0,0 of type G 1.0,0 of type G other,64 of type L 0.0,2 of
type L 1.0,0 of type L other,0 of type Range 0.0->1.0,0 of type Range
other,0 of type Free Continuous objective value is 679.2 - 0.00 seconds
Cgl0003I 0 fixed,0 tightened bounds,1 strengthened rows,0 substitutions
Cgl0003I 0 fixed,0 substitutions
Cgl0004I processed model has 60 rows,58 columns (58 integer (37 of which
binary)) and 182 elements Cbc0038I Initial state - 4 integers unsatisfied
sum - 1.33333 Cbc0038I Pass   1: suminf.    0.09013 (1) obj. 989.7
iterations 6 Cbc0038I Solution found of 989.7 Cbc0038I Branch and bound
needed to clear up 1 general integers Cbc0038I Full problem 60 rows 58
columns,reduced to 0 rows 0 columns Cbc0038I Cleaned solution of 859.801
Cbc0038I Before mini branch and bound,52 integers at bound fixed and 0
continuous Cbc0038I Full problem 60 rows 58 columns,reduced to 0 rows 0
columns Cbc0038I Mini branch and bound did not improve solution (0.04
seconds) Cbc0038I Round again with cutoff of 841.741 Cbc0038I Reduced cost
fixing fixed 2 variables on major pass 2 Cbc0038I Pass   2: suminf.
0.32881 (2) obj. 841.741 iterations 4 Cbc0038I Pass   3: suminf.
0.33333 (1) obj. 809.1 iterations 27 Cbc0038I Pass   4: suminf.    0.67606
(2) obj. 841.741 iterations 22 Cbc0038I Solution found of 841.741 Cbc0038I
Branch and bound needed to clear up 1 general integers Cbc0038I Full
problem 61 rows 58 columns,reduced to 0 rows 0 columns Cbc0038I Cleaned
solution of 787.2 Cbc0038I Before mini branch and bound,49 integers at
bound fixed and 0 continuous Cbc0038I Full problem 60 rows 58 columns,reduced to 9 rows 6 columns Cbc0038I Mini branch and bound did not improve
solution (0.05 seconds) Cbc0038I Round again with cutoff of 765.6 Cbc0038I
Reduced cost fixing fixed 2 variables on major pass 3 Cbc0038I Pass   5:
suminf.    0.64312 (2) obj. 765.6 iterations 0 Cbc0038I Pass   6: suminf.
0.60293 (2) obj. 765.6 iterations 26 Cbc0038I Pass   7: suminf.    3.31283
(12) obj. 765.6 iterations 37 Cbc0038I Pass   8: suminf.    1.85625 (8)
obj. 765.6 iterations 11 Cbc0038I Pass   9: suminf.    1.67074 (8) obj.
765.6 iterations 6 Cbc0038I Pass  10: suminf.    0.96045 (5) obj. 762.21
iterations 30 Cbc0038I Pass  11: suminf.    0.87163 (5) obj. 765.6
iterations 10 Cbc0038I Pass  12: suminf.    1.73342 (4) obj. 765.6
iterations 8 Cbc0038I Pass  13: suminf.    2.87639 (12) obj. 765.6
iterations 11 Cbc0038I Pass  14: suminf.    1.09610 (7) obj. 765.6
iterations 14 Cbc0038I Pass  15: suminf.    2.00065 (11) obj. 765.6
iterations 12 Cbc0038I Pass  16: suminf.    1.64878 (11) obj. 765.6
iterations 3 Cbc0038I Pass  17: suminf.    1.92295 (9) obj. 765.6
iterations 20 Cbc0038I Pass  18: suminf.    2.86644 (10) obj. 765.6
iterations 20 Cbc0038I Pass  19: suminf.    0.68155 (5) obj. 765.6
iterations 8 Cbc0038I Pass  20: suminf.    1.25037 (5) obj. 765.6
iterations 10 Cbc0038I Pass  21: suminf.    0.89615 (5) obj. 724.882
iterations 32 Cbc0038I Pass  22: suminf.    3.96250 (17) obj. 765.6
iterations 22 Cbc0038I Pass  23: suminf.    2.58543 (11) obj. 765.6
iterations 10 Cbc0038I Pass  24: suminf.    2.25210 (11) obj. 765.6
iterations 2 Cbc0038I Pass  25: suminf.    3.64849 (11) obj. 765.6
iterations 12 Cbc0038I Pass  26: suminf.    2.91877 (11) obj. 765.6
iterations 4 Cbc0038I Pass  27: suminf.    4.71178 (17) obj. 765.6
iterations 12 Cbc0038I Pass  28: suminf.    1.76220 (12) obj. 765.6
iterations 14 Cbc0038I Pass  29: suminf.    3.09125 (12) obj. 765.6
iterations 8 Cbc0038I Pass  30: suminf.    1.09610 (7) obj. 765.6
iterations 13 Cbc0038I Pass  31: suminf.    2.00065 (11) obj. 765.6
iterations 9 Cbc0038I Pass  32: suminf.    1.64878 (11) obj. 765.6
iterations 1 Cbc0038I Pass  33: suminf.    1.92295 (9) obj. 765.6
iterations 13 Cbc0038I Pass  34: suminf.    4.10393 (14) obj. 765.6
iterations 11 Cbc0038I No solution found this major pass Cbc0038I Before
mini branch and bound,22 integers at bound fixed and 0 continuous
Cbc0038I Full problem 60 rows 58 columns,reduced to 39 rows 33 columns
Cbc0038I Mini branch and bound improved solution from 787.2 to 703.4 (0.11
seconds) Cbc0038I Round again with cutoff of 696.14 Cbc0038I Reduced cost
fixing fixed 4 variables on major pass 4 Cbc0038I Pass  34: suminf.
0.73385 (2) obj. 696.14 iterations 0 Cbc0038I Pass  35: suminf.    0.33333
(1) obj. 679.2 iterations 26 Cbc0038I Pass  36: suminf.    2.23417 (9)
obj. 696.14 iterations 22 Cbc0038I Pass  37: suminf.    2.23417 (8) obj.
696.14 iterations 4 Cbc0038I Pass  38: suminf.    2.83901 (8) obj. 696.14
iterations 19 Cbc0038I Pass  39: suminf.    3.19843 (10) obj. 696.14
iterations 7 Cbc0038I Pass  40: suminf.    1.86510 (7) obj. 696.14
iterations 4 Cbc0038I Pass  41: suminf.    1.54490 (7) obj. 696.14
iterations 18 Cbc0038I Pass  42: suminf.    0.87824 (5) obj. 696.14
iterations 3 Cbc0038I Pass  43: suminf.    1.29317 (6) obj. 696.14
iterations 7 Cbc0038I Pass  44: suminf.    0.73385 (2) obj. 696.14
iterations 1 Cbc0038I Pass  45: suminf.    0.33333 (1) obj. 679.2
iterations 13 Cbc0038I Pass  46: suminf.    2.03706 (9) obj. 696.14
iterations 11 Cbc0038I Pass  47: suminf.    3.23076 (10) obj. 696.14
iterations 4 Cbc0038I Pass  48: suminf.    1.86510 (7) obj. 696.14
iterations 5 Cbc0038I Pass  49: suminf.    1.54490 (7) obj. 696.14
iterations 12 Cbc0038I Pass  50: suminf.    0.87824 (5) obj. 696.14
iterations 3 Cbc0038I Pass  51: suminf.    1.29317 (6) obj. 696.14
iterations 8 Cbc0038I Pass  52: suminf.    0.73385 (2) obj. 696.14
iterations 1 Cbc0038I Pass  53: suminf.    0.33333 (1) obj. 679.2
iterations 10 Cbc0038I Pass  54: suminf.    2.21157 (9) obj. 696.14
iterations 14 Cbc0038I Pass  55: suminf.    2.72014 (11) obj. 696.14
iterations 9 Cbc0038I Pass  56: suminf.    2.15911 (8) obj. 696.14
iterations 18 Cbc0038I Pass  57: suminf.    1.15911 (5) obj. 696.14
iterations 8 Cbc0038I Pass  58: suminf.    1.34667 (4) obj. 696.14
iterations 5 Cbc0038I Pass  59: suminf.    1.44933 (5) obj. 696.14
iterations 16 Cbc0038I Pass  60: suminf.    1.44933 (5) obj. 696.14
iterations 1 Cbc0038I Pass  61: suminf.    0.73385 (2) obj. 696.14
iterations 4 Cbc0038I Pass  62: suminf.    0.33333 (1) obj. 679.2
iterations 9 Cbc0038I Pass  63: suminf.    2.96146 (11) obj. 696.14
iterations 15 Cbc0038I No solution found this major pass Cbc0038I Before
mini branch and bound,29 integers at bound fixed and 0 continuous
Cbc0038I Full problem 60 rows 58 columns,reduced to 28 rows 22 columns
Cbc0038I Mini branch and bound did not improve solution (0.26 seconds)
Cbc0038I After 0.26 seconds - Feasibility pump exiting with objective of
703.4 - took 0.23 seconds Cbc0012I Integer solution of 703.4 found by
feasibility pump after 0 iterations and 0 nodes (0.26 seconds) Cbc0006I
The LP relaxation is infeasible or too expensive Cbc0013I At root node,0
cuts changed objective from 679.2 to 679.2 in 1 passes Cbc0014I Cut
generator 0 (Probing) - 1 row cuts average 0.0 elements,4 column cuts (4
active)  in 0.001 seconds - new frequency is 1 Cbc0014I Cut generator 1
(Gomorycbc: ClpNonLinearCost.cpp:1035: void
ClpNonLinearCost::checkInfeasibilities(double): Assertion
`lowerValue<=upperValue' failed.```

我已经解决了一个类似的问题,它具有以下限制:

    def rule1(model,i,j):
        return model.x[i,j] <= (1+model.flex[j])*model.Q[j]
    def rule2(model,j] >= model.Q[j]    
 

其中变量x[i,j]必须在[Q[j],(1+flex[j])*Q[j]]范围内。返回CBC中的错误的问题是相同的,但是没有rule1约束,即唯一条件是x[i,j] >= Q[j],这很奇怪,因为CBC正确解决的问题显然比它解决的问题难。无法解决(如果先解决这个问题,这个问题就不可能解决)。如何解决此错误?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...