gurobi - Gurobi 警告和最优值不一致 [一些整数变量的值大于最大支持值 (2000000000)]
问题描述
我正在使用 Gurobi 8.1.0 版和 Python API 3.6 版来解决 MIP 问题。我有两个模型,我相信它们的全局最优值是相等的。但是,我发现它们在我的一个模拟中并不相等。然后,我尝试使用另一个模型(模型 2)的解决方案来热启动我认为解决方案不正确的模型(模型 1)。也就是说,问题是最大化目标函数,model-1的目标值为42.3333,但我认为应该是42.8333。因此,我使用目标值为 42.8333 的模型 2 的解决方案来热启动模型 1。
奇怪的是,模型 2 的解决方案对模型 1 不可行,因为目标值大于 42.3333,问题是最大化。然而,事实证明这是一个可行的热启动,现在模型 1 的最佳值为 42.8333。同一个模型怎么会有多个最优值?
Changed value of parameter timeLimit to 10800.0
Prev: 1e+100 Min: 0.0 Max: 1e+100 Default: 1e+100
Changed value of parameter LogFile to output/inconsistent_Model-1.log
Prev: gurobi.log Default:
Optimize a model with 11277 rows, 15150 columns and 165637 nonzeros
Model has 5050 general constraints
Variable types: 0 continuous, 15150 integer (5050 binary)
Coefficient statistics:
Matrix range [1e+00, 1e+00]
Objective range [1e-02, 1e+00]
Bounds range [1e+00, 1e+00]
RHS range [1e+00, 5e+01]
Presolve removed 6167 rows and 7008 columns
Presolve time: 0.95s
Presolved: 5110 rows, 8142 columns, 37608 nonzeros
Presolved model has 3058 SOS constraint(s)
Variable types: 0 continuous, 8142 integer (4403 binary)
Warning: Markowitz tolerance tightened to 0.0625
Warning: Markowitz tolerance tightened to 0.125
Warning: Markowitz tolerance tightened to 0.25
Warning: Markowitz tolerance tightened to 0.5
Root relaxation: objective 4.333333e+01, 4856 iterations, 2.15 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 43.33333 0 587 - 43.33333 - - 3s
0 0 43.26667 0 243 - 43.26667 - - 4s
0 0 43.20000 0 1282 - 43.20000 - - 4s
0 0 43.20000 0 567 - 43.20000 - - 4s
0 0 43.18333 0 1114 - 43.18333 - - 5s
0 0 43.16543 0 2419 - 43.16543 - - 5s
0 0 43.15556 0 1575 - 43.15556 - - 5s
0 0 43.15333 0 2271 - 43.15333 - - 5s
0 0 43.13333 0 727 - 43.13333 - - 5s
0 0 43.12778 0 1698 - 43.12778 - - 5s
0 0 43.12500 0 1146 - 43.12500 - - 5s
0 0 43.12500 0 1911 - 43.12500 - - 6s
0 0 43.11927 0 1859 - 43.11927 - - 6s
0 0 43.11845 0 2609 - 43.11845 - - 7s
0 0 43.11845 0 2631 - 43.11845 - - 7s
0 0 43.11845 0 2642 - 43.11845 - - 7s
0 0 43.11845 0 2462 - 43.11845 - - 8s
0 0 43.11845 0 2529 - 43.11845 - - 8s
0 0 43.11845 0 2529 - 43.11845 - - 9s
0 2 43.11845 0 2531 - 43.11845 - - 14s
41 35 43.09874 17 957 - 43.09874 - 29.4 15s
94 84 42.93207 33 716 - 43.09874 - 22.1 31s
117 101 42.91940 40 2568 - 43.09874 - 213 37s
264 175 infeasible 92 - 43.09874 - 133 73s
273 181 infeasible 97 - 43.09874 - 277 77s
293 191 42.42424 17 1828 - 43.09874 - 280 90s
369 249 42.40111 52 2633 - 43.09874 - 311 105s
383 257 42.39608 59 3062 - 43.09874 - 329 152s
408 265 42.39259 65 2819 - 43.09874 - 386 162s
419 274 41.51399 66 2989 - 43.09874 - 401 170s
454 282 41.29938 71 3000 - 43.09874 - 390 182s
462 280 infeasible 74 - 43.09874 - 423 192s
479 287 infeasible 78 - 43.09874 - 419 204s
498 293 40.51287 81 2564 - 43.09874 - 435 207s
526 307 40.16638 86 2619 - 43.09874 - 419 227s
584 330 42.63100 33 621 - 43.09874 - 404 236s
628 333 infeasible 37 - 43.09874 - 394 252s
661 345 42.37500 26 25 - 43.09874 - 396 288s
684 353 infeasible 30 - 43.09874 - 426 290s
842 370 infeasible 69 - 43.09874 - 348 306s
944 379 infeasible 86 - 43.09874 - 321 370s
1009 395 42.36667 22 25 - 43.09874 - 350 409s
* 1031 243 3 42.3333333 43.09874 1.81% 343 409s
1056 203 43.00000 19 141 42.33333 43.09874 1.81% 362 411s
1194 222 cutoff 23 42.33333 43.00000 1.57% 325 430s
1199 219 cutoff 25 42.33333 43.00000 1.57% 349 450s
1202 212 cutoff 29 42.33333 43.00000 1.57% 361 472s
1211 200 infeasible 47 42.33333 42.91851 1.38% 380 498s
1226 169 infeasible 43 42.33333 42.91471 1.37% 395 511s
Cutting planes:
Gomory: 2
Cover: 15
Implied bound: 1
Clique: 26
MIR: 17
Inf proof: 1
Zero half: 8
Explored 1426 nodes (502432 simplex iterations) in 512.68 seconds
Thread count was 4 (of 4 available processors)
Solution count 1: 42.3333
Optimal solution found (tolerance 1.00e-04)
Warning: some integer variables take values larger than the maximum
supported value (2000000000)
Best objective 4.233333333333e+01, best bound 4.233333333333e+01, gap 0.0000%
除了上述之外,我还收到了这个警告:“找到了最佳解决方案(公差 1.00e-04)警告:某些整数变量的值大于最大支持值(2000000000)”。这是什么意思?太感谢了!
解决方案
看起来您遇到了一些数字问题。根松弛需要增加 Markowitz 容差,这表明矩阵是病态的。正如您在两种不同的“最佳”解决方案中观察到的那样,这可能会导致不一致。
关于值太大的警告意味着存在解值太大的整数变量,以至于无法再可靠地检查整数可行性容差。如果您有一个解值在 1e+9 范围内的变量,那么它们是否为整数可能不再重要。因此,您可能还可以通过使它们成为连续变量来简化模型。
您应该检查两种模型的两个解决方案中的违规行为(请参阅此处),以了解这些解决方案实际可行的程度。
推荐阅读
- html - SVG 和 div 之间的空白
- c# - 使用 linq 在字符串中连接字典的每个键和值
- sql - Ecto - 表 B 或 C 的表 A 上的外键约束,但不是 B 和 C
- java - SceneBuilder 不会加载通过 FXML 引用另一个自定义控件的自定义控件
- c# - 如何在 ASP.NET CORE 中将文件路径转换为 IFormFIle?
- performance - 更改 Julia DEPOT_PATH 时,包加载时间显着增加
- java - 我的代码到达一个循环然后停止工作
- r - 使用 R 中的 ANESRAKE 包对加权值进行汇总统计
- java - 寻找减少重复的方法
- html - 取决于值的条件表格单元格背景颜色