为什么缩放和几何是相关的

为什么缩放和几何是相关的

本节提供了一个简单的例子,即缩放问题如何减慢问题解决,并且在极端情况下,导致意外答案。考虑问题:

\ begin {displaymath}(p)\ max \ {cx:ax = b,l \ leq x \ lequ \} \ neat {displaymath}

and let<span> $ </ span> d <span> $ </ span>是一个对角线矩阵在哪里 <span> $ </ span> d_ {ii}> 0,\ forall i <span> $ </ span>。In theory, solving<span> $ </ span>(p)<span> $ </ span>应该等同于解决相关问题<span>$</span>(P_D)<span>$</span>

\begin{displaymath}(P_D) \max \{cD x': AD x' = b, D^{-1} l \leq x' \leq D^{-1} u\}\end{displaymath}

然而,在实践中,这两个模型的行为方式非常不同。要演示这一点,我们使用简单的脚本rescale.py随机重新分配模型的列。让我们考虑重建对问题的影响pilotnov.mps.bz2.。解决原始问题提供以下输出:
Optimize a model with 975 rows, 2172 columns and 13057 nonzeros Coefficient statistics: Matrix range [3e-06, 9e+06] Objective range [3e-03, 1e+00] Bounds range [6e-06, 7e+04] RHS range [1e-05, 4e+04] Warning: Model contains large matrix coefficient range Consider reformulating model or setting NumericFocus parameter to avoid numerical issues. Presolve removed 254 rows and 513 columns Presolve time: 0.01s Presolved: 721 rows, 1659 columns, 11454 nonzeros Iteration Objective Primal Inf. Dual Inf. Time 0 -3.2008682e+05 1.435603e+05 0.000000e+00 0s 1137 -4.4972762e+03 0.000000e+00 0.000000e+00 0s Solved in 1137 iterations and 0.13 seconds Optimal objective -4.497276188e+03 Kappa: 1.949838e+06

Note the log message regarding the matrix coefficient range in the log (which in this case shows a range of [3e-06, 9e+06]).

If we runRescale.py -f pilotnov.mps.bz2 -s 1e3(随机重新分配柱子上或按下<span> $ </ span> 10 ^ 3 <span> $ </ span>), 我们获得:

Optimize a model with 975 rows, 2172 columns and 13057 nonzeros Coefficient statistics: Matrix range [5e-09, 1e+10] Objective range [2e-06, 1e+03] Bounds range [5e-09, 6e+07] RHS range [1e-05, 4e+04] Warning: Model contains large matrix coefficient range Consider reformulating model or setting NumericFocus parameter to avoid numerical issues. Presolve removed 100 rows and 255 columns Presolve time: 0.00s Presolved: 875 rows, 1917 columns, 11899 nonzeros Iteration Objective Primal Inf. Dual Inf. Time 0 -6.2117921e+32 7.026405e+31 6.211792e+02 0s Extra 2 simplex iterations after uncrush 1166 -4.4972762e+03 0.000000e+00 0.000000e+00 0s Solved in 1166 iterations and 0.15 seconds Optimal objective -4.497276188e+03 Kappa: 2.341493e+18

这次,优化过程需要更多的迭代,也可以获得额外的警告:


堵塞后额外的2个单纯形迭代


这表明在未验证的模型上执行额外的单纯性迭代。另外,请注意非常大的价值kappa.;它的含义将被讨论this部分。

If we runRescale.py -f pilotnov.mps.bz2 -s 1e6, 我们获得:

优化具有975行,2172列和13057非系统系数统计的模型:矩阵范围[5e-12,12]物镜范围[5e-12,5e + 10] Rhs范围[5e-09,1e + 06] Rhs范围[1E-05,4E + 04]警告:模型包含大矩阵系数范围警告:模型包含大型界限考虑重新编辑模型或设置NumericFocus参数以避免数值问题。预定删除了103行和252列预定时间:0.01s预定:872行,1920列,11900非销售客观原始INF。双伊米。时间0 -6.4093202E + 34 7.254491C + 31 6.409320E + 04 0s额外的151个单纯乳头迭代在Uncrush 1903 -4972762E + 03 0.000000E + 00 0.000000E + 00 0s在1903年迭代和0.23秒最佳目标-4.497276188e +03警告:未划算的原始违规= 0.171778和剩余= 0.00142752κ:5.729068E + 12

现在我们获得了更大的额外单纯次迭代,更令人困难,我们就产生了结果解决方案的质量:


警告:未划算的原始违规= 0.171778和剩余= 0.00142752


此消息表示求解器无法找到满足默认公差的解决方案。手机万博登录

最后,如果我们跑了Rescale.py -f pilotnov.mps.bz2 -s 1e8, 我们获得:

优化具有975行,2172列和13054非系统系数统计的模型:矩阵范围[3e-13,7e + 14]物镜范围[2e-11,1e + 08]界限范围[5e-14,1e + 13] RHS范围[1E-05,4E + 04]警告:模型包含大矩阵系数范围警告:模型包含大型界限考虑重新编辑模型或设置NumericFocus参数以避免数值问题。预定删除了79行和242列预定时间:0.00s在0次迭代中解决,0.00秒不可行的模型
In this case, the optimization run terminates almost instantly, but with the unexpectedInfeasibleresult.

正如您所看到的,正如我们所表现更大且更大的重立,我们继续获得相同的最佳价值,但是求解器挣扎的明确标志。手机万博登录我们看到警告消息,同时增加迭代计数,运行时间和kappa.values. However, once we pass a certain rescaling value, the solver is no longer able to solve the model and instead reports that it isInfeasible

请注意,这不是Gurobi中的错误。根据其范围,使用固定公差以及由于缩放而导致的问题的改变几何形状,它与更改数字的含义有关。我们将进一步讨论这个主题a later section