优化求解器 | Gurobi 数学启发式算法:参数类型与案例实现
作者:徐璐,清华大学,清华大学深圳国际研究生院,清华-伯克利深圳学院,硕士在读作者:刘兴禄,清华大学,清华大学深圳国际研究生院,清华-伯克利深圳学院,博士在读
审校&编辑:张瑞三,四川大学,硕士在读
初次完稿日期:2022.10.12
<hr/>启发式算法通常能够以巧妙、迅速的方式快速解决问题,在运筹学中有着不可取代的地位。今天我们着重探究其中的数学启发式算法,尤其是 Gurobi 求解器中提供的启发式,以及涉及到的重要参数。在本文的最后,我们以经典的 VRPTW 案例为例详细列举了8类参数的实际应用情况,提供真实完整的运行日志供大家参考。
本文的结构如下:
[*]Part1:数学启发式算法
[*]Part2:Gurobi 数学启发式算法的类型和特点
[*]Part3:Gurobi 数学启发式算法相关参数介绍
[*]Part4:实验:各参数取值和基于 VRPTW 的案例
数学启发式算法 Matheuristics
什么是启发式算法?在数学优化和计算机科学中,启发式 heuristic(来自希腊语ερσκω 「我发现,发现」)是一种旨在当经典方法太慢时用来更快解决问题的技术,或者无法通过经典方法找到精确解时用来获得近似解决方案的方法。它是通过用最优性、完整性、精确性换取速度来实现的。在某种程度上,可以被认为是一种捷径。(来自 wikipedia)
那么数学启发式 matheuristic 又是什么呢?正如其命名所言,它是数学规划算法和启发式或元启发式算法的有机结合,如下示意图所示:
图1-数学启发式 matheuristic
数学启发式算法相比元启发式算法,理论性更强。数学启发式往往会借助一部分数学规划提供的解,或者问题的特性等,来快速获得问题的可行解。本文主要聚焦于介绍在Gurobi求解器中,用于加速求解混合整数规划(Mixed integer programming, MIP)的数学启发式算法。
在 Gurobi 求解器中,整个算法依然是以数学规划为框架,仅在其中的某些环节采用了启发式算法,以达到更快获得初始可行解、更多或更优质的可行解等各种目的。Gurobi求解MIP的算法框架为 branch and cut,但是在 branch and cut tree 的探索中,在每个节点处,会调用30多种启发式算法,用于快速获得高质量的整数可行解,进而加速上界(min 问题)的更新Gap的收敛。此外,每个节点上也会调用二十多种 cutting plane 算法来生成割平面,收紧模型,逼近该节点的可行域的凸包,收紧下界。Branch and cut 算法框架中,启发式算法的调用时机如下面示意图所示,启发式算法一般是在红色虚线框部分被调用:
图2-Gurobi branch and cut算法框架(部分)
为了让读者看得清楚,我们把每个节点处的算法放大,如下图。
图3-Gurobi中的branch and cut算法框架中在单个节点的大致算法框架
Gurobi 数学启发式算法的类型和特点
启发式算法的类型概述
Gurobi 提供了超过30种启发式算法,包含以下多种类型:
- [ ] 基于非 LP(Non-LP based)\ Enumerate, search, greedy, ... - [ ] 基于 LP(LP based)\ Rounding, fixing & diving, ... - [ ] 模型改建(Reformulation)\ Zero-objective, min relaxation, ... - [ ] 改进型(Improvement)\ RINS - [ ] 子 MIP 和递归(SubMIP and recursive)\ Target heuristic, RINS, ... - [ ] 针对具体问题的启发式(Problem specific)\ Fixed charge network heuristic - [ ] 有助于启发式的功能(Featureshlpingheuristics)\ Pump reduce
[*]基于非 LP(Non-LP based)
Enumerate, search, greedy, ...
[*]基于 LP(LP based)
Rounding, fixing & diving, ...
[*]模型改建(Reformulation)
Zero-objective, min relaxation, ...
[*]改进型(Improvement)
RINS
[*] 子 MIP 和递归(SubMIP and recursive)
Target heuristic, RINS, ...
[*]针对具体问题的启发式(Problem specific)
Fixed charge network heuristic
[*]有助于启发式的功能(Featureshelpingheuristics)
Pump reduce
基于非 LP(Non-LP based)的启发式算法
[*]其中比较著名的算法包括:
最优的(Optimal):最短路径(shortest path),最小生成树(min spanning tree)\ 非最优的(Not optimal):0-1 Knapsack 0-1 背包问题
\\ \mbox{Max } 10 u + 8 v + 11 x + 7 y + 5 z \\ \mbox{s.t. } 3u+4v+6x+ 4y+3z≤14 \\ u, v, x, y, z\mbox{ 均为二元变量} \\根据目标系数和约束系数的比例对变量进行排序,已经排序的变量。 根据顺序将变量取值逐一设为1,直到产生不可行解。例如这里将 y设置为1是不可行的,所以解是 (u, v, x, y, z)=(1, 1, 1, 0, 0) ,目标值为29。 而最优解 (u, v, x, y, z) = (1,1,0,1,1) ,目标值为30。2. Gurobi 盲目启发式(这里的盲目意味着不使用 LP 松弛解)
这一类启发式算法的求解步骤通常如下:
[*]首先,基于某种度量对二进制/整数变量进行排序;
[*]接着,按贪婪顺序固定这些变量;
[*]然后,传播变量固定和收紧界值:
注意如果没有这一步,几乎不可能找到可行解。
最后如果有连续变量的话,解决剩余的 LP 模型。
3. 基于 LP 的贪婪算法(LP based greedy heuristics) 这类算法具有以下特点:
[*]用松弛解对变量排序通常更有效;
[*]有可能可以快速找到整数解;
[*]解的质量通常很差;
[*]一个差的解 就足够了, 差的解往往无法帮助整体优化;
[*]多核电脑和难以对根节点并行化是关注基于非LP的启发式算法的原因
基于 LP(LP based)的启发式算法
[*]取整法(Rounding)
基本思想:解 LP 松弛问题,将解值四舍五入到最接近的整数值。
举例说明:这里我们举和前文相同的 0-1背包例子:\\ \mbox{Max } 10 u + 8 v + 11 x + 7 y + 5 z \\ \mbox{s.t. } 3u+4v+6x+ 4y+3z≤14 \\ u, v, x, y, z\mbox{ 均为二元变量} \\最优的 LP 松弛解 (u, v, x, y, z) = (1, 1, 1, \frac{1}{4}, 0) ,利用取整法可得 (u, v, x, y, z) = (1, 1, 1, 0, 0) ,这是一个整数可行解,目标函数值为29。
值得注意的是,简单的取整法通常表现不是很好,特别是具有等式约束的模型。除此之外,往往需要考虑两边的整数值,取整时需要传播变量固定和收紧界值。Gurobi 求解器里有多种不同版本的取整启发式算法。
2. 大多数 Gurobi 启发式算法都是基于 LP 或需要 LP 松弛解
LP 松弛解对于启发式算法获取高质量解非常重要!
模型改建(Reformulation)的启发式算法
1.举例,原模型如下:
\mbox{Min} 3u+8v+3w+2x+7y+5z \\ \mbox{s.t.} 3u+4v -4w+8x+4y+3z≤9 \\5u + 2v + 4x + 7y + 9z = 15\\ \mbox{u, v, x, y, z} 均为非负整数变量,w 为二元变量 \\
2.去目标的启发式
首先删除目标函数并将其作为可行问题去求解,以期预优化可以使模型变的更小,并且最终的预优化模型更容易解。 这个启发式算法一般只在根结点使用。
对于上述例子,重新改建的模型是:
\mbox{Min} 0 \\ \mbox{s.t.} 3u+4v -4w+8x+4y+3z≤9 \\5u + 2v + 4x + 7y + 9z = 15\\ \mbox{u, v, x, y, z} 均为非负整数变量,w 为二元变量 \\变量 x 和 v 是平行的, x 可以被固定为0,变量 w 可以被固定为1,这有助于第一个约束的可行性。3.最小松弛启发式算法
算法步骤如下:
[*]首先,对于每个不等式,加一个违反约束的惩罚变量;
[*]接着,对于每个等式,加两个违反约束的惩罚变量, 两个方向各一个;
[*]然后对违反约束总和求最小化;
[*]如果最优总和为0, 那我们找到一个可行解; 否则原始模型是不可行的。
继续上述例子,重新改建的模型是:
\mbox{Min} r+s+t \\ \mbox{s.t.} 3u+4v -4w+8x+4y+3z-r≤9 \\5u + 2v + 4x + 7y + 9z +s-t= 15\\ \mbox{u, v, x, y, z} 均为非负整数变量,w 为二元变量 \\改进型的 RINS(松弛诱导邻域搜索)启发式算法
1.RINS 的求解过程 RINS 全称是 Relaxation induced neighborhood search,即松弛诱导邻域搜索。其求解的流程如下:
[*]首先,给定现任整数解(目前找到的最优整数解)和节点松弛的当前分数解;
[*]如果变量的整数解值和松弛解值一致,则固定变量;
[*]最后将部分固定的模型作为 subMIP 去解。
RINS 是一种改进型的启发式算法,是公认的最有效的一种启发式算法。
SubMIP 和递归
许多Gurobi启发式算法会这样做:
[*]首先,设一个目标来固定一定比例的变量,比如80%;
[*]接着,固定一个变量然后传播;
[*]重复固定和传播,直到达到目标或它变得不可行;
[*]然后将其为 subMIP 去求解;
[*]在子MIP中,它将以递归方式调用相同的启发式算法。
这种方法通常非常有效,可迅速找到可行解。
泵式缩减启发式(Feasibility Pump Heuristic)
泵式缩减启发式来源于 Fischetti,Glover 和 Lodi 在 2004 的研究成果,其求解步骤如下:
[*]首先,将目标函数换成到舍入整数解距离最小 (二次);
[*]接着,使用 L1 范数 (\mbox{sum}|x_j - x_j^*|) , 其中 x_j^* 是取整解(线性)
如果一个二元变量 x_j=0.3 ,那么 x_j^*=0 ,那么 x_j 的目标部分为|x_j-0|=x_j ,即目标函数系数为1;
如果一个二元变量 x_j=0.7 ,那么 x_j^*=1 ,那么目标函数系数将为 -1。
[*]解修改后的LP并重复;
[*]直到它达到一定限值或松弛解是整数可行的;
[*]例如将限值设为10, 则需解 LP 10 次, 这是一个很花费时间的过程,并且通常很难运气好。
泵式缩减(Pump Reduce)
泵式缩减法受泵式缩减启发式算法的启发,这种算法基于一个观察:大多数模型是对偶退化的,即松弛问题有多个的最优解。 泵式缩减法的目标是找到有较少整数变量取分数值的松弛解,其主要步骤如下:
[*]首先,解松弛问题, 固定非零递减成本的所有变量, 确保保持在最优空间;
[*]接着,舍入松弛解,目标换成到舍入整数解距离最小 (L1 范数);
[*]然后,解修改后的 LP 并重复;
[*]直到它达到一定限值或取小数值的整数变量的数量不下降。
Gurobi 数学启发式算法相关参数介绍
Gurobi 求解器主要包含以下四类参数:
[*]MIPFocus:主要 MIP 参数(Main MIP parameter)
2. Heuristics:主要启发式参数(Main heuristic parameter)
3. 个别启发式参数(Individual heuristic parameters)
[*]ZeroObjNodes:去目标启发式(Zero objective heuristic)
[*]PumpPasses:泵式缩减启发式(Feasibility pump heuristic)
[*]RINS:松弛诱导邻域搜索启发式(RINS heuristic)
[*]SubMIPNodes:限制基于MIP的启发式方法(如RINS)所探索的节点数量
[*]节点松弛启发式(Node relaxation heuristic):MinRelNodes:最小松弛启发式(Minimum relaxation heuristic),NoRelHeurTime::节点松弛启发式的运行时间和NoRelHeurWork:节点松弛启发式的计算量限制
[*]改进型的启发式参数(Improvement heuristic parameters): ImproveStartGap,ImproveStartNodes和ImproveStartTime
4. 影响可行解的其他参数(Other parameters affecting feasible solutions)
[*]BranchDir:分支方向的偏好。将这个参数设定为1,可能有助于 MIP 更迅速地找到可行解。
[*]TuneCriterion 调优准则。= 2 表示为目标函数值,即更专注于寻找好的可行解。
[*]PartitionPlace:分割位置。
下一节我们将结合具体的案例逐一详细介绍每一类参数的取值,通过运行日志比较运行结果。
实验:各参数取值介绍和基于 VRPTW 的案例
这一节中,我们将基于一个 VRPTW 案例来具体演示上述参数。
VRPTW的问题介绍和模型见往期推文(第一个即为VRPTW,其余两个为相关学拓展学习推文):
VRPTW 算例概览
有关带时间窗的车辆路径规划问题(VRPTW 问题),简单来说就是在传统的 VRP 问题上增加了时间窗的约束。网络中每个节点对车辆都有一个期望的最早抵达与最晚抵达的时间窗约束,车辆必须在规定的时间窗内到达每个节点,若违反时间窗约束会产生惩罚项。
其他部分则与普通VRP相同,目标函数都是最小化总成本,决策变量考虑的都是车辆的调度路径 。下文实验中我们放上了每个参数下 Gurobi 求解的完整运行日志,因此内容较长,读者朋友们可以按需阅读。
载入模型
from gurobipy import *
model = read(&#34;VRPTW_r102_20_5.mps&#34;)笔者注:如果大家想要查看这个 .mps 文件中 VRPTW 模型的细节(如目标函数和约束条件),可以将其导出为 .lp 格式:
model.write(&#34;vrp.lp&#34;)再用 NotePad++ 等软件打开查看,该模型文件共有 3960行,共 1796 个约束:
图4-输出模型
实验0:不人为添加任何参数,直接求解
我们首先不添加任何参数,直接让 Gurobi 按照所有默认的参数取值进行求解:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.optimize()运行日志如下:
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.02 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.10s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.03 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 59 -287.10000 - - 0s
0 0287.10000 0 64 -287.10000 - - 0s
0 0304.71668 0 83 -304.71668 - - 0s
0 0332.21792 0 82 -332.21792 - - 0s
0 0332.21792 0 85 -332.21792 - - 0s
0 0335.90452 0 80 -335.90452 - - 0s
0 0337.50589 0 95 -337.50589 - - 0s
0 0337.52434 0 92 -337.52434 - - 0s
0 0343.62317 0 95 -343.62317 - - 1s
0 0343.62317 0 95 -343.62317 - - 1s
0 0349.99973 0105 -349.99973 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0356.60000 0 73 -356.60000 - - 1s
0 0356.60000 0 98 -356.60000 - - 1s
0 0357.53333 0 61 -357.53333 - - 1s
H 0 0 461.2000000357.5333322.5% - 1s
0 0357.53333 0 59461.20000357.5333322.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.77309 0118461.20000357.7730922.4% - 1s
0 0357.77309 0109461.20000357.7730922.4% - 1s
0 2357.81724 0109461.20000357.8172422.4% - 1s
H 33 40 453.1000000358.1007521.0%51.6 1s
H111 104 449.3000000358.1007520.3%37.8 2s
H111 104 448.4000000358.1007520.1%37.8 2s
H139 147 439.2000000358.1007518.5%35.6 2s
H185 185 429.5000000358.1007516.6%31.2 2s
H221 219 421.8000000358.1007515.1%28.9 2s
H409 350 418.4000000358.1007514.4%28.7 3s
1046 764374.39071 10 38418.40000361.0518913.7%28.7 5s
1071 781378.36537 14 91418.40000365.4552412.7%28.0 10s
1741 943374.27072 38 80418.40000365.4552412.7%39.2 15s
46232069386.91601 42 76418.40000376.5467910.0%41.2 20s
67622820 cutoff 49 418.40000379.880089.21%42.4 25s
86753551 cutoff 32 418.40000383.240128.40%43.5 30s
*127154168 44 414.9000000388.348626.40%44.0 34s
127224277 cutoff 59 414.90000388.365146.40%44.0 35s
*127853950 44 412.3000000388.365145.81%44.1 35s
*135273546 57 409.7000000389.049445.04%44.3 36s
162912816 cutoff 73 409.70000394.843093.63%45.2 40s
Cutting planes:
Gomory: 8
Cover: 46
Implied bound: 25
Clique: 7
MIR: 14
StrongCG: 8
Flow cover: 45
Inf proof: 2
Zero half: 10
RLT: 121
Relax-and-lift: 7
Explored 21289 nodes (910378 simplex iterations) in 44.39 seconds
Thread count was 8 (of 8 available processors)
Solution count 10: 409.7 412.3 414.9 ... 453.1
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%日志的第一列中,若没有任何标注则表示在当前节点未找到新的整数可行解,标注 H 表示当前节点使用使用启发式算法找到了新的可行整数解,标注 * 的为使用经典割平面法且找到了新的可行整数解。可以发现,在 Gurobi 的默认求解过程其实就使用了很多次数学启发式。
日志显示,求解过程使用启发式算法在1s时找到了初始可行整数解,目标函数值为 461.2。在探索了 21289 个节点,共计耗时 44.9s 后找到了最优解,目标函数值为 409.7。
我们重复了3次试验,在这3次中分别使用了 44.4s, 39.1s,38.9s 找到最优解,目标函数值均为 409.7。
实验1:使用 MIPFocus 参数
MIPFocus 主要 MIP 参数介绍
MIPFocus 参数用于定义解的高层次策略,因为求解 MIP 问题主要有三个侧重点:侧重快速找到可行解、侧重证明最优、以及侧重界的提升。可以通过本参数设定 MIP 求解的侧重点。注意该参数只会影响 MIP 问题的求解:
图5-主要 MIP 参数
[*]默认值 = 0,为在找新的可行解和证明最优性之间取得平衡;
[*] = 1:更注重快速找到可行解(good feasible solution);
[*] = 2:更注重证明最优性(optimal solution),认为求解器在寻找高质量的解方面没有问题,希望将更多的注意力集中在证明最优性上;
[*]= 3:更注重目标界值(bound),如果最佳目标边界移动非常缓慢(或根本没有)。
接下来我们加入参数,先取 MIPFocus = 1,更注重快速找到可行解:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;MIPFocus&#34;, 1)
model.optimize()运行结果如下:
Using license file C:\Users\xuluz\gurobi.lic
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.02 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter MIPFocus to 1
Prev: 0Min: 0Max: 3Default: 0
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.08s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 55 -287.10000 - - 0s
0 0287.10000 0 51 -287.10000 - - 0s
0 0304.71668 0 68 -304.71668 - - 0s
0 0304.71668 0 68 -304.71668 - - 0s
0 0326.81008 0 91 -326.81008 - - 0s
0 0327.87089 0 92 -327.87089 - - 0s
0 0327.87089 0 92 -327.87089 - - 0s
0 0336.38464 0 90 -336.38464 - - 0s
0 0339.02500 0 79 -339.02500 - - 0s
0 0339.74664 0103 -339.74664 - - 0s
0 0339.74664 0103 -339.74664 - - 0s
0 0351.84850 0 94 -351.84850 - - 1s
H 0 0 728.3000000351.9000051.7% - 4s
H 0 0 674.1000000351.9000047.8% - 4s
0 2351.90000 0 89674.10000351.9000047.8% - 4s
11 16375.44052 4 82674.10000352.9985447.6% 102 5s
H 31 36 609.6000000352.9985442.1%83.3 5s
H 34 36 541.0000000352.9985434.8%83.4 5s
H 67 59 506.9000000352.9985430.4%65.0 5s
H 68 59 476.6000000352.9985425.9%64.2 5s
H110 73 467.9000000352.9985424.6%49.7 5s
H146 93 452.8000000353.4947021.9%46.3 5s
H148 93 450.3000000353.4947021.5%45.9 5s
H187 129 433.2000000353.4947018.4%43.2 6s
H215 141 427.5000000353.4947017.3%43.5 6s
H265 155 424.9000000356.2045416.2%42.8 7s
H340 198 418.1000000356.2546214.8%42.9 7s
H418 221 409.7000000356.3254413.0%44.5 7s
1500 676379.49853 10 41409.70000361.9361411.7%43.1 10s
3020 882369.59724 33 98409.70000362.8844311.4%43.4 15s
50481021 infeasible 34 409.70000376.051578.21%44.3 20s
81471986403.54507 48 65409.70000381.008497.00%44.2 25s
114792869404.56389 35 41409.70000383.181826.47%44.0 30s
156963644 infeasible 38 409.70000386.293755.71%43.5 36s
185874046 cutoff 57 409.70000388.319405.22%42.9 40s
236184640405.44765 44 57409.70000390.752544.62%41.9 45s
262075028 cutoff 48 409.70000391.807024.37%41.3 50s
298935354394.57034 49 75409.70000393.040754.07%40.8 55s
345695516 cutoff 30 409.70000394.672743.67%40.1 60s
368565455401.18344 49 56409.70000395.547573.45%39.8 66s
392495444 infeasible 59 409.70000396.329413.26%39.5 70s
446375039401.18362 40 75409.70000398.000002.86%38.8 75s
499994280401.65332 49 67409.70000399.622802.46%38.0 80s
529553530 cutoff 63 409.70000400.707172.19%37.5 85s
59530 508 cutoff 45 409.70000404.245871.33%36.3 90s
Cutting planes:
Learned: 3
Gomory: 2
Cover: 7
Implied bound: 13
Clique: 7
MIR: 10
StrongCG: 8
Flow cover: 38
Inf proof: 3
Zero half: 27
RLT: 140
Relax-and-lift: 4
Explored 61203 nodes (2191495 simplex iterations) in 90.81 seconds
Thread count was 8 (of 8 available processors)
Solution count 10: 409.7 418.1 424.9 ... 506.9
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%该求解过程用了 4s 找到初始可行解,共用了 90.81s 探索了 61203 个节点后找到了最优解。
可以发现在这个测试模型中使用 MIPFocus = 1 参数值后,可行解的求解速度不升反降,这也说明启发式参数未必都能在任何情况下都实现预期的效果,需要探索和经验。
再取 MIPFocus = 2,这个参数取值更注重证明最优性:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;MIPFocus&#34;, 2)
model.optimize()运行结果如下:求解器使用了 2s 找到第一个可行整数解,此时 Gap 为 27.6%。在 49.38s 找到最优解。
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.03 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter MIPFocus to 2
Prev: 0Min: 0Max: 3Default: 0
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.12s
Presolved: 1183 rows, 1519 columns, 17138 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Presolve removed 5 rows and 0 columns
Presolved: 1178 rows, 1519 columns, 16940 nonzeros
Root relaxation: objective 2.871000e+02, 452 iterations, 0.06 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 36 -287.10000 - - 0s
0 0288.85996 0 75 -288.85996 - - 0s
0 0297.37522 0 68 -297.37522 - - 0s
0 0310.32413 0103 -310.32413 - - 0s
0 0310.32413 0103 -310.32413 - - 0s
0 0334.24463 0 95 -334.24463 - - 1s
0 0337.42636 0 91 -337.42636 - - 1s
0 0341.02966 0106 -341.02966 - - 1s
0 0341.03147 0 85 -341.03147 - - 1s
0 0343.33133 0115 -343.33133 - - 1s
0 0345.49622 0115 -345.49622 - - 1s
0 0345.70350 0103 -345.70350 - - 1s
0 0355.47619 0 84 -355.47619 - - 1s
0 0355.47619 0 84 -355.47619 - - 1s
H 0 0 491.0000000355.4761927.6% - 2s
0 0357.06781 0 97491.00000357.0678127.3% - 2s
0 0358.00000 0 93491.00000358.0000027.1% - 2s
0 0358.00000 0 89491.00000358.0000027.1% - 2s
0 0358.00000 0 79491.00000358.0000027.1% - 2s
H 0 0 464.4000000358.0000022.9% - 3s
0 0358.03600 0118464.40000358.0360022.9% - 3s
0 0358.03600 0118464.40000358.0360022.9% - 3s
0 0358.12398 0117464.40000358.1239822.9% - 3s
0 0358.12398 0117464.40000358.1239822.9% - 3s
0 2359.17920 0117464.40000359.1792022.7% - 4s
H 35 37 443.9000000359.1792019.1%51.6 4s
H 64 69 429.3000000359.1792016.3%49.6 4s
91 97363.56589 20 83429.30000359.1792016.3%46.3 5s
H127 116 419.6000000359.1792014.4%42.3 5s
H157 144 416.2000000359.1792013.7%41.5 5s
1083 706390.32458101 37416.20000362.2434013.0%33.7 10s
1099 717399.43458 50 90416.20000362.2434013.0%33.2 15s
1945 833 cutoff 38 416.20000364.7661412.4%35.9 20s
H 28801020 411.0000000365.7961411.0%34.3 22s
42361785400.01845 31 79411.00000376.777618.33%33.7 25s
71393140408.60763100105411.00000382.927426.83%33.8 30s
98083821407.68257 77 92411.00000387.471535.72%34.9 35s
*103973819 34 409.7000000388.203405.25%34.9 35s
134963805403.66281 34 62409.70000392.687274.15%35.3 40s
169833258 cutoff 41 409.70000396.557503.21%35.1 45s
Cutting planes:
Gomory: 13
Cover: 32
Implied bound: 20
Projected implied bound: 1
Clique: 6
MIR: 7
StrongCG: 20
Flow cover: 40
Zero half: 55
Mod-K: 1
RLT: 129
Relax-and-lift: 3
Explored 23329 nodes (782255 simplex iterations) in 49.38 seconds
Thread count was 8 (of 8 available processors)
Solution count 8: 409.7 411 416.2 ... 491
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%MIPFocus = 3 的情况留给读者朋友们自行测试。
实验2:使用 Heuristics 参数
Heuristics 主要启发式参数介绍
Heuristics 参数的含义是我们在求解过程中花在启发式上的大致时间占比。
图6-Heuristics 主要启发式参数
[*]默认值 = 0.05,即约 5% 的算法使用启发式;
[*]> 0.05,意味着更激进地使用启发式,最大值为1;
[*]< 0.05,意味着更少地使用启式;
[*] = 0 表示几乎不使用启发式。
我们首先取 Heuristics = 0,即不使用数学启发式:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;Heuristics&#34;, 0)
model.optimize()求解日志如下: 发现设定后,除了找初始可行解以外,均无 H 标识,即未用到启发式算法。共使用了 49.27s 得到最优解。
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.03 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter Heuristics to 0.0
Prev: 0.05Min: 0.0Max: 1.0Default: 0.05
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.08s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 59 -287.10000 - - 0s
0 0287.10000 0 64 -287.10000 - - 0s
0 0304.71668 0 83 -304.71668 - - 0s
0 0332.21792 0 82 -332.21792 - - 0s
0 0332.21792 0 85 -332.21792 - - 0s
0 0335.90452 0 80 -335.90452 - - 0s
0 0337.50589 0 95 -337.50589 - - 0s
0 0337.52434 0 92 -337.52434 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0349.99973 0105 -349.99973 - - 0s
0 0350.21622 0108 -350.21622 - - 0s
0 0350.21622 0108 -350.21622 - - 0s
0 0355.94000 0114 -355.94000 - - 0s
0 0355.94000 0114 -355.94000 - - 0s
0 0356.60000 0 73 -356.60000 - - 0s
0 0356.60000 0 98 -356.60000 - - 0s
H 0 0 461.2000000356.6000022.7% - 1s
0 0357.53333 0 61461.20000357.5333322.5% - 1s
0 0357.53333 0 59461.20000357.5333322.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.77309 0118461.20000357.7730922.4% - 1s
0 0357.77309 0109461.20000357.7730922.4% - 1s
0 2357.77309 0109461.20000357.7730922.4% - 1s
1076 947406.28774 23 94461.20000359.7990322.0%30.3 5s
12741080407.78894 22 58461.20000366.6210520.5%36.5 10s
* 31131764 71 457.3000000366.6210519.8%39.6 13s
* 42181924 51 433.5000000366.6210515.4%38.0 14s
47962439425.64721141 79433.50000366.6210515.4%37.1 15s
95675481403.75695 60 88433.50000374.5564113.6%40.1 20s
141708497397.27875 42 59433.50000379.1751512.5%39.8 25s
*158155659 41 413.0000000380.400007.89%39.8 26s
186006429406.02711 51 85413.00000383.277557.20%40.7 30s
235977234408.83624 32 58413.00000388.208326.00%42.6 35s
*271336708 34 411.0000000391.927144.64%43.5 39s
277236637 cutoff 24 411.00000392.701734.45%43.6 40s
*288696136 46 409.7000000393.439713.97%43.9 41s
327474501 cutoff 27 409.70000398.711112.68%44.1 45s
Cutting planes:
Gomory: 11
Cover: 78
Implied bound: 37
Projected implied bound: 2
Clique: 5
MIR: 8
Flow cover: 32
Inf proof: 1
Zero half: 9
Mod-K: 4
RLT: 113
Relax-and-lift: 1
Explored 39241 nodes (1630810 simplex iterations) in 49.27 seconds
Thread count was 8 (of 8 available processors)
Solution count 6: 409.7 411 413 ... 461.2
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%接下来我们设 Heuristics = 0.5:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;Heuristics&#34;, 0.5)
model.optimize()日志如下:使用了更多的启发式算法来得到可行解,一共耗时 108.29s。
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.03 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter Heuristics to 0.5
Prev: 0.05Min: 0.0Max: 1.0Default: 0.05
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.12s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 59 -287.10000 - - 0s
0 0287.10000 0 64 -287.10000 - - 0s
0 0304.71668 0 83 -304.71668 - - 0s
0 0332.21792 0 82 -332.21792 - - 0s
0 0332.21792 0 85 -332.21792 - - 0s
0 0335.90452 0 80 -335.90452 - - 0s
0 0337.50589 0 95 -337.50589 - - 0s
0 0337.52434 0 92 -337.52434 - - 0s
0 0343.62317 0 95 -343.62317 - - 1s
0 0343.62317 0 95 -343.62317 - - 1s
0 0349.99973 0105 -349.99973 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0356.60000 0 73 -356.60000 - - 1s
0 0356.60000 0 98 -356.60000 - - 1s
0 0357.53333 0 61 -357.53333 - - 1s
0 0357.53333 0 59 -357.53333 - - 1s
0 0357.63085 0109 -357.63085 - - 1s
0 0357.63085 0109 -357.63085 - - 1s
0 0357.77309 0118 -357.77309 - - 1s
H 0 0 461.2000000357.7730922.4% - 1s
0 0357.77309 0113461.20000357.7730922.4% - 1s
0 2357.81724 0109461.20000357.8172422.4% - 1s
H 31 40 448.7000000357.9555620.2%74.5 2s
H 78 84 444.6000000357.9555619.5%48.3 2s
H156 150 419.4000000357.9555614.7%38.9 2s
H188 185 409.7000000357.9555612.6%36.8 2s
550 504382.67153110 90409.70000357.9555612.6%27.2 5s
1100 939401.13470202125409.70000362.6958311.5%26.3 10s
1252 973 infeasible 22 409.70000363.4182911.3%34.9 15s
14571003372.18694 31 97409.70000363.4182911.3%38.2 20s
22341186380.16481 51139409.70000363.4182911.3%40.5 25s
31201318392.96082 79113409.70000363.4182911.3%40.1 31s
38451374371.02073 35135409.70000363.4380411.3%40.6 35s
58982422394.76560102121409.70000376.258298.16%39.7 40s
66842718397.01624 40 75409.70000381.150096.97%40.2 47s
80353185402.99344 57 71409.70000383.415846.42%40.2 50s
89523490394.50306 60104409.70000385.036286.02%40.8 55s
108803830399.49653 25 81409.70000387.575195.40%40.4 60s
122973984397.11425 43 50409.70000389.354934.97%40.3 65s
135353918408.66372 44 63409.70000391.431344.46%40.7 70s
137343887398.17993 29 65409.70000391.787294.37%40.7 78s
144493780401.63961 48 80409.70000392.039544.31%40.7 81s
162303688 cutoff 76 409.70000394.336233.75%40.8 85s
176753257406.66117 45 45409.70000396.317953.27%40.7 92s
198042023 cutoff 82 409.70000399.166052.57%40.5 96s
206351608 cutoff 76 409.70000400.377322.28%40.3102s
22052 587 cutoff 49 409.70000403.159641.60%39.6105s
Cutting planes:
Gomory: 14
Cover: 35
Implied bound: 18
Clique: 6
MIR: 11
StrongCG: 3
Flow cover: 32
Inf proof: 1
Zero half: 13
RLT: 123
Relax-and-lift: 8
Explored 23061 nodes (894681 simplex iterations) in 108.29 seconds
Thread count was 8 (of 8 available processors)
Solution count 5: 409.7 419.4 444.6 ... 461.2
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%
model.optimize()
model.optimize()最后我们设到最最大值 Heuristics = 1:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;Heuristics&#34;, 1)
model.optimize()日志如下:求解过程中几乎都是靠以 H 标识的启发式算法得到的可行整数解,没有 * ,说明的确非常激进地使用了启发式算法。但是整个求解过程使用了 142.53s(2m 23s),是目前用时最久的,初始可行解求解得也慢和差。可见过于激进的启发式算法可能反而会降低求解效率。
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.02 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter Heuristics to 1.0
Prev: 0.05Min: 0.0Max: 1.0Default: 0.05
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.09s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 59 -287.10000 - - 0s
0 0287.10000 0 64 -287.10000 - - 0s
0 0304.71668 0 83 -304.71668 - - 0s
0 0332.21792 0 82 -332.21792 - - 0s
0 0332.21792 0 85 -332.21792 - - 0s
0 0335.90452 0 80 -335.90452 - - 0s
0 0337.50589 0 95 -337.50589 - - 0s
0 0337.52434 0 92 -337.52434 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0343.62317 0 95 -343.62317 - - 1s
0 0349.99973 0105 -349.99973 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0356.60000 0 73 -356.60000 - - 1s
0 0356.60000 0 98 -356.60000 - - 1s
0 0357.53333 0 61 -357.53333 - - 1s
0 0357.53333 0 59 -357.53333 - - 1s
0 0357.63085 0109 -357.63085 - - 1s
0 0357.63085 0109 -357.63085 - - 1s
0 0357.77309 0118 -357.77309 - - 1s
0 0357.77309 0113 -357.77309 - - 1s
H 0 0 728.3000000357.8172450.9% - 18s
0 2357.81724 0113728.30000357.8172450.9% - 18s
H 35 40 686.2000000358.1013647.8%53.7 18s
H 37 40 674.1000000358.1013646.9%52.6 18s
H 67 72 652.9000000358.1013645.2%56.1 18s
H 70 72 561.8000000358.1013636.3%54.8 18s
H 99 102 533.0000000358.1013632.8%48.3 19s
H131 133 516.7000000358.1013630.7%45.6 19s
H132 133 478.4000000358.1013625.1%45.3 19s
H161 161 460.2000000358.1013622.2%41.5 19s
196 183366.05430 48 77460.20000358.1013622.2%38.8 20s
H197 183 452.1000000358.1013620.8%38.6 20s
H233 213 444.3000000358.1013619.4%38.2 20s
H267 241 435.3000000358.1013617.7%40.0 20s
H276 235 418.2000000358.1013614.4%40.6 20s
657 508396.33508132 86418.20000358.1013614.4%33.3 26s
939 707377.47089 34 64418.20000361.3179513.6%32.6 30s
1059 758362.42000 13 88418.20000362.4200013.3%35.0 35s
1295 846364.11532 27 74418.20000362.4200013.3%39.2 40s
1455 897367.50000 33 49418.20000362.4200013.3%39.5 45s
H 1456 858 416.9000000362.4200013.1%39.5 45s
1683 912373.13009 41 81416.90000362.4200013.1%39.4 50s
1993 987366.69790 31115416.90000363.3619012.8%40.1 55s
22161000371.34337 40117416.90000363.3619012.8%39.6 60s
25661158393.18949 64 95416.90000363.3619012.8%39.4 65s
H 28021075 414.9000000368.9751411.1%39.3 68s
30211064397.10591 32 71414.90000368.9751411.1%39.7 70s
H 34261158 409.7000000372.069699.18%39.9 73s
34571241395.30163 57 85409.70000372.761679.02%40.0 75s
39271401395.64859 24 82409.70000373.480308.84%39.5 80s
44121537384.50904 31 80409.70000375.442388.36%39.4 86s
46951695387.65449 27 55409.70000376.246118.17%39.3 90s
53121940394.03866 39 67409.70000378.705667.57%39.5 95s
57992074403.96750 61 62409.70000378.963307.50%39.6100s
67082194403.39437 66 88409.70000380.761937.06%39.7105s
74452320 cutoff 75 409.70000383.774006.33%40.6110s
84212386 cutoff 36 409.70000385.971995.79%40.7115s
94162331 cutoff 57 409.70000387.734205.36%40.8120s
102062259 cutoff 60 409.70000389.869654.84%41.3125s
122141842 cutoff 39 409.70000394.309353.76%40.9131s
13649 952 cutoff 65 409.70000398.233802.80%40.3135s
15154 328 cutoff 31 409.70000400.562102.23%39.1140s
Cutting planes:
Gomory: 6
Cover: 48
Implied bound: 31
Projected implied bound: 1
Clique: 5
MIR: 13
StrongCG: 2
Flow cover: 24
Inf proof: 1
Zero half: 4
Mod-K: 3
RLT: 107
Relax-and-lift: 10
Explored 15713 nodes (604416 simplex iterations) in 142.53 seconds
Thread count was 8 (of 8 available processors)
Solution count 10: 409.7 414.9 416.9 ... 516.7
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%实验3:使用 ZeroObjNodes 参数
ZeroObjNodes:去目标启发式参数介绍(Zero objective heuristic)
通过该参数可以调整去目标启发式中要探索的节点数。请注意,这个启发式只在 MIP 问题的 Root 根节点使用,而且只在其他根启发式没有找到可行的解决方案时应用。
图7-ZeroObjNodes 参数
注意:应用这个启发式的代价很高,而且通常会产生质量很差的解。一般来说,只有在其他方法,包括用默认设置探索树,不能产生可行的解决方案时,才使用它。
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;ZeroObjNodes&#34;,100)
model.optimize()求解过程如下,总耗时 38.45s:
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.02 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter ZeroObjNodes to 100
Prev: -1Min: -1Max: 2000000000Default: -1
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.07s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 59 -287.10000 - - 0s
0 0287.10000 0 64 -287.10000 - - 0s
0 0304.71668 0 83 -304.71668 - - 0s
0 0332.21792 0 82 -332.21792 - - 0s
0 0332.21792 0 85 -332.21792 - - 0s
0 0335.90452 0 80 -335.90452 - - 0s
0 0337.50589 0 95 -337.50589 - - 0s
0 0337.52434 0 92 -337.52434 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0349.99973 0105 -349.99973 - - 0s
0 0350.21622 0108 -350.21622 - - 0s
0 0350.21622 0108 -350.21622 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0356.60000 0 73 -356.60000 - - 1s
0 0356.60000 0 98 -356.60000 - - 1s
0 0357.53333 0 61 -357.53333 - - 1s
H 0 0 461.2000000357.5333322.5% - 1s
0 0357.53333 0 59461.20000357.5333322.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.77309 0118461.20000357.7730922.4% - 1s
0 0357.77309 0109461.20000357.7730922.4% - 1s
0 2357.81724 0109461.20000357.8172422.4% - 1s
H 33 40 453.1000000358.1007521.0%51.6 1s
H111 104 449.3000000358.1007520.3%37.8 1s
H111 104 448.4000000358.1007520.1%37.8 1s
H139 147 439.2000000358.1007518.5%35.6 2s
H185 185 429.5000000358.1007516.6%31.2 2s
H221 219 421.8000000358.1007515.1%28.9 2s
H409 350 418.4000000358.1007514.4%28.7 2s
1055 770402.87441 11 46418.40000361.0518913.7%28.4 5s
1084 791365.45524 15111418.40000365.4552412.7%31.6 10s
33791505378.98296 49120418.40000372.2403711.0%40.9 15s
62482708391.75197 43 77418.40000378.910049.44%42.0 20s
79493345397.66128 55 80418.40000381.797968.75%43.1 25s
*127154168 44 414.9000000388.348626.40%44.0 29s
127224277 cutoff 59 414.90000388.365146.40%44.0 30s
*127853950 44 412.3000000388.365145.81%44.1 30s
*135273546 57 409.7000000389.049445.04%44.3 31s
170112483 infeasible 58 409.70000396.502843.22%45.2 35s
Cutting planes:
Gomory: 8
Cover: 46
Implied bound: 25
Clique: 7
MIR: 14
StrongCG: 8
Flow cover: 45
Inf proof: 2
Zero half: 10
RLT: 121
Relax-and-lift: 7
Explored 21289 nodes (910378 simplex iterations) in 38.45 seconds
Thread count was 8 (of 8 available processors)
Solution count 10: 409.7 412.3 414.9 ... 453.1
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%实验4:使用 PumpPasses 参数
PumpPasses:泵式缩减启发式(Feasibility pump heuristic)
这个参数定义了通过泵式缩减启发式的次数,与上面的去目标启发式很类似,在 Gurobi 求解中也是应用在根结点,用于快速找到整数可行解。
图8- PumpPasses 参数
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;PumpPasses&#34;,1000)
model.optimize()求解过程如下,总耗时 42.45s:
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.02 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter PumpPasses to 100
Prev: -1Min: -1Max: 2000000000Default: -1
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.07s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 59 -287.10000 - - 0s
0 0287.10000 0 64 -287.10000 - - 0s
0 0304.71668 0 83 -304.71668 - - 0s
0 0332.21792 0 82 -332.21792 - - 0s
0 0332.21792 0 85 -332.21792 - - 0s
0 0335.90452 0 80 -335.90452 - - 0s
0 0337.50589 0 95 -337.50589 - - 0s
0 0337.52434 0 92 -337.52434 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0349.99973 0105 -349.99973 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0356.60000 0 73 -356.60000 - - 1s
0 0356.60000 0 98 -356.60000 - - 1s
0 0357.53333 0 61 -357.53333 - - 1s
H 0 0 461.2000000357.5333322.5% - 1s
0 0357.53333 0 59461.20000357.5333322.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.77309 0118461.20000357.7730922.4% - 1s
0 0357.77309 0109461.20000357.7730922.4% - 1s
Feasibility pump: pass 1, min int violation 7.189, total elapsed time 2s
Feasibility pump: no solution found in 39 passes
0 2357.81724 0109461.20000357.8172422.4% - 2s
H 33 40 453.1000000358.1007521.0%51.6 2s
H111 104 449.3000000358.1007520.3%37.8 2s
H111 104 448.4000000358.1007520.1%37.8 2s
H139 147 439.2000000358.1007518.5%35.6 2s
H184 178 428.1000000358.1007516.4%31.2 3s
H218 211 418.4000000358.1007514.4%28.8 3s
1046 859416.57254 57109418.40000359.7373114.0%23.1 5s
1076 879372.62523 70111418.40000366.7749412.3%22.4 10s
21581153373.89471 49 76418.40000366.7749412.3%35.0 15s
50892285388.67922 49 70418.40000380.753579.00%36.7 20s
74233191403.96801 73 72418.40000384.302848.15%38.0 25s
127114775 cutoff 49 418.40000390.243776.73%39.0 30s
*141864684 63 413.0000000391.432595.22%39.2 33s
157124743402.70422 36102413.00000393.725554.67%39.5 35s
*174914308 87 411.0000000395.393553.80%39.7 37s
199553326 cutoff 45 411.00000399.470692.81%39.6 40s
*204772986 66 409.7000000399.559502.48%39.5 40s
Cutting planes:
Gomory: 9
Cover: 60
Implied bound: 26
Projected implied bound: 2
Clique: 6
MIR: 24
StrongCG: 1
Flow cover: 26
Inf proof: 1
Zero half: 6
Mod-K: 1
RLT: 112
Relax-and-lift: 4
Explored 24379 nodes (902690 simplex iterations) in 42.45 seconds
Thread count was 8 (of 8 available processors)
Solution count 10: 409.7 411 413 ... 461.2
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%实验5:使用 RINS 参数
RINS:松弛诱导邻域搜索启发式(RINS heuristic)
通过这个参数可以调整 RINS 启发式的频率。增加 RINS 启发式的频率,可以将MIP搜索的重点从证明最优性转移到寻找良好的可行方案上。但建议在试验这个参数之前,先试试 MIPFocus、ImproveStartGap 或 ImproveStartTime 参数。
图9- RINS 参数
[*] 默认值 = -1:自动选择;
[*] = 0:关闭RINS;
[*] = n:在 MIP 搜索树的每 n 个节点应用 RINS。
我们先尝试 RINS = 1000:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;RINS&#34;,1000)
model.optimize()求解过程日志如下,求解时间 37.96s:
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.02 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter RINS to 1000
Prev: -1Min: -1Max: 2000000000Default: -1
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.07s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 59 -287.10000 - - 0s
0 0287.10000 0 64 -287.10000 - - 0s
0 0304.71668 0 83 -304.71668 - - 0s
0 0332.21792 0 82 -332.21792 - - 0s
0 0332.21792 0 85 -332.21792 - - 0s
0 0335.90452 0 80 -335.90452 - - 0s
0 0337.50589 0 95 -337.50589 - - 0s
0 0337.52434 0 92 -337.52434 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0349.99973 0105 -349.99973 - - 0s
0 0350.21622 0108 -350.21622 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0356.60000 0 73 -356.60000 - - 1s
0 0356.60000 0 98 -356.60000 - - 1s
0 0357.53333 0 61 -357.53333 - - 1s
H 0 0 461.2000000357.5333322.5% - 1s
0 0357.53333 0 59461.20000357.5333322.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.77309 0118461.20000357.7730922.4% - 1s
0 0357.77309 0109461.20000357.7730922.4% - 1s
0 2357.81724 0109461.20000357.8172422.4% - 1s
H 1 4 448.7000000357.8172420.3%23.0 1s
H 67 72 439.0000000358.1007518.4%43.0 1s
H113 107 429.8000000358.1007516.7%40.0 2s
H138 145 425.7000000358.1007515.9%37.0 2s
H231 222 422.3000000358.1007515.2%30.9 3s
H453 366 409.7000000358.1007512.6%28.1 3s
1034 782399.49074 36109409.70000360.2730912.1%27.6 5s
1065 803394.38596 19 80409.70000367.5727810.3%26.8 10s
2171 945400.26688 51 65409.70000367.5727810.3%41.4 15s
53651603 cutoff 56 409.70000384.067416.26%42.8 20s
92942714406.93497 46 41409.70000390.000004.81%42.0 25s
107732889399.11126 53 45409.70000391.843894.36%42.0 30s
154872118406.12712 44 25409.70000397.512582.97%41.8 35s
Cutting planes:
Gomory: 21
Cover: 44
Implied bound: 28
Projected implied bound: 1
Clique: 8
MIR: 12
StrongCG: 8
Flow cover: 34
Inf proof: 2
Zero half: 9
RLT: 140
Relax-and-lift: 8
Explored 19744 nodes (781978 simplex iterations) in 37.96 seconds
Thread count was 8 (of 8 available processors)
Solution count 7: 409.7 422.3 425.7 ... 461.2
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%最后我们再尝试关闭 RINS:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;RINS&#34;,0)
model.optimize()运行结果如下:发现对于这个测试用例,不打开 RINS 求解也是很快,仅用了 33.88s。
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.02 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter RINS to 0
Prev: -1Min: -1Max: 2000000000Default: -1
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.10s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 59 -287.10000 - - 0s
0 0287.10000 0 64 -287.10000 - - 0s
0 0304.71668 0 83 -304.71668 - - 0s
0 0332.21792 0 82 -332.21792 - - 0s
0 0332.21792 0 85 -332.21792 - - 0s
0 0335.90452 0 80 -335.90452 - - 0s
0 0337.50589 0 95 -337.50589 - - 0s
0 0337.52434 0 92 -337.52434 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0349.99973 0105 -349.99973 - - 0s
0 0350.21622 0108 -350.21622 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0356.60000 0 73 -356.60000 - - 1s
0 0356.60000 0 98 -356.60000 - - 1s
0 0357.53333 0 61 -357.53333 - - 1s
H 0 0 461.2000000357.5333322.5% - 1s
0 0357.53333 0 59461.20000357.5333322.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.77309 0118461.20000357.7730922.4% - 1s
0 0357.77309 0113461.20000357.7730922.4% - 1s
0 2357.77309 0113461.20000357.7730922.4% - 1s
1043 894434.74922 48 91461.20000358.5322722.3%30.3 5s
* 23331399 30 448.6000000362.0046719.3%39.2 9s
27771612388.80519 28 49448.60000363.8444018.9%40.5 10s
* 40632090 35 439.4000000367.4099716.4%40.6 11s
53013072421.37952 35 74439.40000370.9406515.6%39.9 15s
H 59663154 432.6000000372.3692813.9%39.8 15s
* 83764775 45 432.0000000377.7455412.6%40.3 18s
100115853417.64539 41 71432.00000379.2661212.2%39.5 20s
*113953611 28 412.3000000380.298187.76%39.4 21s
*120973214 43 409.7000000381.968076.77%39.7 22s
146593598 infeasible 44 409.70000386.998335.54%40.4 25s
200213031 cutoff 42 409.70000396.280473.28%41.1 30s
Cutting planes:
Gomory: 11
Cover: 59
Implied bound: 30
Projected implied bound: 3
Clique: 9
MIR: 21
StrongCG: 2
Flow cover: 53
Zero half: 10
RLT: 132
Relax-and-lift: 2
Explored 25489 nodes (998017 simplex iterations) in 33.88 seconds
Thread count was 8 (of 8 available processors)
Solution count 7: 409.7 412.3 432 ... 461.2
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%实验6:使用 SubMIPNodes 参数
SubMIPNodes:参数介绍
限制基于MIP的启发式方法(如RINS)所探索的节点数量,可以和 RINS 等方法的参数组合使用。探索更多的节点可以产生更好的解,但通常需要更长的时间。
图10- SubMIPNodes 参数
首先,我们尝试设置 SubMIPNodes = 0,即不允许启发式方法探索节点:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;SubMIPNodes&#34;,0)
model.optimize()日志结果如下,总耗时 43.10s:
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.02 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter SubMIPNodes to 0
Prev: 500Min: 0Max: 2000000000Default: 500
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.07s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 59 -287.10000 - - 0s
0 0287.10000 0 64 -287.10000 - - 0s
0 0304.71668 0 83 -304.71668 - - 0s
0 0332.21792 0 82 -332.21792 - - 0s
0 0332.21792 0 85 -332.21792 - - 0s
0 0335.90452 0 80 -335.90452 - - 0s
0 0337.50589 0 95 -337.50589 - - 0s
0 0337.52434 0 92 -337.52434 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0349.99973 0105 -349.99973 - - 0s
0 0350.21622 0108 -350.21622 - - 0s
0 0350.21622 0108 -350.21622 - - 0s
0 0355.94000 0114 -355.94000 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0356.60000 0 73 -356.60000 - - 1s
0 0356.60000 0 98 -356.60000 - - 1s
0 0357.53333 0 61 -357.53333 - - 1s
H 0 0 461.2000000357.5333322.5% - 1s
0 0357.53333 0 59461.20000357.5333322.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.77309 0118461.20000357.7730922.4% - 1s
0 0357.77309 0109461.20000357.7730922.4% - 1s
0 2357.81724 0109461.20000357.8172422.4% - 1s
H 74 79 448.7000000358.1007520.2%42.6 1s
H898 850 444.6000000358.1081519.5%24.1 3s
H989 863 440.5000000359.6055618.4%23.9 3s
1046 906402.21270 15 60440.50000359.6055618.4%24.1 5s
H 1050 863 427.9000000359.6055616.0%24.0 5s
1262 929360.69620 21102427.90000360.6962015.7%30.3 10s
40881981412.14870 70 53427.90000372.6295112.9%35.7 15s
76934214 cutoff 52 427.90000379.5154411.3%36.3 20s
* 89254820 58 427.1000000380.6038210.9%36.5 21s
120836605426.21735110 63427.10000384.1441010.1%37.1 25s
*161597079 85 417.3000000387.306727.19%37.7 29s
167467174414.12607 62 44417.30000387.447917.15%37.7 30s
H195276664 414.3000000390.694815.70%38.7 32s
216276915407.88216 87 59414.30000393.599845.00%39.3 35s
*238205727 65 411.0000000395.478963.78%39.5 37s
*249704965 98 409.7000000396.602673.20%39.6 38s
269373724 cutoff 59 409.70000400.302032.29%39.5 40s
Cutting planes:
Gomory: 9
Cover: 68
Implied bound: 28
Projected implied bound: 1
Clique: 5
MIR: 15
StrongCG: 1
Flow cover: 46
Inf proof: 1
Zero half: 10
Mod-K: 3
RLT: 103
Explored 32039 nodes (1192216 simplex iterations) in 43.10 seconds
Thread count was 8 (of 8 available processors)
Solution count 10: 409.7 411 414.3 ... 461.2
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%接下来我们尝试将该参数值调到最大:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;SubMIPNodes&#34;,2000000000)
model.optimize()运行结果如下,共45.70s,性能上差异不大:
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.02 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter SubMIPNodes to 2000000000
Prev: 500Min: 0Max: 2000000000Default: 500
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.07s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 59 -287.10000 - - 0s
0 0287.10000 0 64 -287.10000 - - 0s
0 0304.71668 0 83 -304.71668 - - 0s
0 0332.21792 0 82 -332.21792 - - 0s
0 0332.21792 0 85 -332.21792 - - 0s
0 0335.90452 0 80 -335.90452 - - 0s
0 0337.50589 0 95 -337.50589 - - 0s
0 0337.52434 0 92 -337.52434 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0349.99973 0105 -349.99973 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0356.60000 0 73 -356.60000 - - 1s
0 0356.60000 0 98 -356.60000 - - 1s
0 0357.53333 0 61 -357.53333 - - 1s
H 0 0 461.2000000357.5333322.5% - 1s
0 0357.53333 0 59461.20000357.5333322.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.63085 0109461.20000357.6308522.5% - 1s
0 0357.77309 0118461.20000357.7730922.4% - 1s
0 0357.77309 0109461.20000357.7730922.4% - 1s
0 2357.81724 0109461.20000357.8172422.4% - 1s
H 33 40 453.1000000358.1007521.0%51.6 1s
H111 104 449.3000000358.1007520.3%37.8 1s
H111 104 448.4000000358.1007520.1%37.8 1s
H139 147 439.2000000358.1007518.5%35.6 2s
H184 186 429.5000000358.1007516.6%31.2 2s
H219 216 426.1000000358.1007516.0%28.9 2s
H313 300 418.4000000358.1007514.4%24.4 2s
1087 824400.46989 26114418.40000360.4775913.8%25.7 5s
1110 839381.55491 73104418.40000370.1614811.5%25.1 10s
H 1223 843 409.7000000370.161489.65%32.2 12s
25081046 cutoff 32 409.70000371.523609.32%38.7 15s
52372287 infeasible 43 409.70000380.852107.04%39.4 20s
68712666401.35740 41 65409.70000383.708246.34%39.9 27s
92723429 cutoff 57 409.70000386.666845.62%39.7 30s
135844072408.74545 60 49409.70000391.471944.45%40.1 35s
177423670 infeasible 35 409.70000395.827423.39%40.2 40s
23102 997 cutoff 84 409.70000401.952711.89%39.3 45s
Cutting planes:
Gomory: 15
Cover: 61
Implied bound: 30
Projected implied bound: 1
Clique: 5
MIR: 19
Flow cover: 12
Inf proof: 1
Zero half: 6
Mod-K: 5
RLT: 116
Relax-and-lift: 2
Explored 25105 nodes (950444 simplex iterations) in 45.70 seconds
Thread count was 8 (of 8 available processors)
Solution count 9: 409.7 418.4 426.1 ... 461.2
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%实验7:使用 MinRelNodes, NoRelHeurTime, NoRelHeurWork 参数
节点松弛启发式(Node relaxation heuristic)参数介绍
下面的三个参数可以同时使用,都是控制节点松弛启发式(NoRel):
[*]MinRelNodes:最小松弛启发式(Minimum relaxation heuristic)
这个参数定义了在最小松弛启发式中要探索的节点数。请注意,这个启发式也只在 MIP 的根节点应用,而且只在其他根启发式没有找到可行的解决方案时才用。
图11- MinRelNodes参数
图12- NoRelHeurTime参数
[*]NoRelHeurTime:节点松弛启发式的运行时间
这个参数限制 NoRel 启发式花费的时间(秒)。这个启发式是在解决根松弛之前搜索高质量的可行方案。在根松弛特别昂贵的模型上,它可能相当有用。
注意这个参数将引入非确定性 —— 不同的运行可能采取不同的路径。使用 NoRelHeurWork 参数可以得到确定性的结果。
这个参数中使用的工作度量很难精确定义。一个单位大约对应于一秒钟,但这取决于机器、核心数,在某些情况下还取决于模型。可能需要进行试验,为你的模型找到一个好的参数设置。
图13-NoRelHeurWork 参数
下面我们设定了一组参数:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;MinRelNodes&#34;,100)
model.setParam(&#34;NoRelHeurTime&#34;,20)
model.setParam(&#34;NoRelHeurWork&#34;,20)
model.optimize()优化过程和结果如下,总耗时 59.33s,期间使用了 NoRel heuristic 节点松弛启发式:
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.02 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter MinRelNodes to 100
Prev: -1Min: -1Max: 2000000000Default: -1
Changed value of parameter NoRelHeurTime to 20.0
Prev: 0.0Min: 0.0Max: infDefault: 0.0
Changed value of parameter NoRelHeurWork to 20.0
Prev: 0.0Min: 0.0Max: infDefault: 0.0
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.09s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Starting NoRel heuristic
Found phase-1 solution: relaxation 116.2
Found phase-1 solution: relaxation 107.5
Found phase-1 solution: relaxation 104.5
Found phase-1 solution: relaxation 14
Found phase-1 solution: relaxation 11
Found phase-1 solution: relaxation 8
Found phase-1 solution: relaxation 7
Found phase-1 solution: relaxation 6
Found phase-1 solution: relaxation 4
Found phase-1 solution: relaxation 2
Found phase-1 solution: relaxation 1
Found phase-1 solution: relaxation 2.84217e-14
Found heuristic solution: objective 596.5000000
Transition to phase 2
Found heuristic solution: objective 590.6000000
Found heuristic solution: objective 583.2000000
Found heuristic solution: objective 577.3000000
Found heuristic solution: objective 571.1000000
Found heuristic solution: objective 554.1000000
Found heuristic solution: objective 547.9000000
Found heuristic solution: objective 515.3000000
Found heuristic solution: objective 497.0000000
Found heuristic solution: objective 481.6000000
Found heuristic solution: objective 451.3000000
Found heuristic solution: objective 441.6000000
Found heuristic solution: objective 439.1000000
Found heuristic solution: objective 426.9000000
Found heuristic solution: objective 418.5000000
Elapsed time for NoRel heuristic: 5s (best bound 287.1)
Found heuristic solution: objective 418.3000000
Elapsed time for NoRel heuristic: 11s (best bound 287.1)
Found heuristic solution: objective 411.7000000
Elapsed time for NoRel heuristic: 17s (best bound 287.1)
Root simplex log...
Iteration Objective Primal Inf. Dual Inf. Time
0 0.0000000e+00 5.900000e+01 0.000000e+00 21s
410 2.8710000e+02 0.000000e+00 0.000000e+00 21s
Root relaxation: objective 2.871000e+02, 410 iterations, 0.03 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37411.70000287.1000030.3% - 20s
0 0287.10000 0 59411.70000287.1000030.3% - 20s
0 0287.10000 0 58411.70000287.1000030.3% - 20s
0 0315.46053 0 64411.70000315.4605323.4% - 20s
0 0317.00000 0 53411.70000317.0000023.0% - 20s
0 0325.07451 0100411.70000325.0745121.0% - 20s
0 0339.58000 0 97411.70000339.5800017.5% - 21s
0 0339.58000 0 87411.70000339.5800017.5% - 21s
0 0342.81925 0111411.70000342.8192516.7% - 21s
0 0344.46400 0104411.70000344.4640016.3% - 21s
0 0344.46400 0 97411.70000344.4640016.3% - 21s
0 0352.13492 0100411.70000352.1349214.5% - 21s
0 0352.27994 0100411.70000352.2799414.4% - 21s
0 0352.27994 0100411.70000352.2799414.4% - 21s
0 0354.80909 0 99411.70000354.8090913.8% - 21s
0 0355.23303 0103411.70000355.2330313.7% - 21s
0 0355.24175 0106411.70000355.2417513.7% - 21s
0 0356.73412 0 97411.70000356.7341213.4% - 21s
0 0356.79709 0109411.70000356.7970913.3% - 21s
0 0356.79709 0109411.70000356.7970913.3% - 21s
0 0357.20248 0122411.70000357.2024813.2% - 21s
0 0357.31707 0130411.70000357.3170713.2% - 21s
0 0357.45069 0120411.70000357.4506913.2% - 21s
0 0357.45069 0120411.70000357.4506913.2% - 21s
0 0357.45069 0124411.70000357.4506913.2% - 21s
0 0357.45069 0124411.70000357.4506913.2% - 21s
0 0357.45208 0114411.70000357.4520813.2% - 21s
0 0357.45208 0114411.70000357.4520813.2% - 21s
0 2357.53094 0114411.70000357.5309413.2% - 22s
996 850393.99451 56 83411.70000358.7277312.9%33.1 25s
1077 869384.57811 71 92411.70000365.4268811.2%31.9 30s
1108 890378.57357 16 95411.70000374.505839.03%31.0 35s
1145 916392.24865 10158411.70000375.829258.71%33.6 40s
18831039377.28568 48 77411.70000375.829258.71%38.2 45s
49231657401.80816 57 90411.70000387.692375.83%39.6 50s
80301994 infeasible 80 411.70000393.806874.35%39.6 55s
* 83501944 67 409.7000000394.034373.82%39.5 55s
Cutting planes:
Gomory: 14
Cover: 28
Implied bound: 16
Projected implied bound: 3
Clique: 3
MIR: 9
StrongCG: 8
Flow cover: 46
Zero half: 17
RLT: 114
Relax-and-lift: 4
Explored 12710 nodes (468602 simplex iterations) in 59.33 seconds
Thread count was 8 (of 8 available processors)
Solution count 10: 409.7 411.7 418.3 ... 497
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%实验8:使用 ImproveStartGap, ImproveStartNodes, ImproveStartTime
改进型的启发式参数(Improvement heuristic parameters)
MIP 求解器可以在搜索过程中改变参数设置,以便采用一种放弃移动最佳边界的策略,而将全部精力用于寻找更好的可行方案。有以下三个参数可以进行设置:
[*]ImproveStartGap
这个参数允许你指定一个优化 gap%,当求解过程达到了这个 gap% 上,MIP 求解器会切换到一个改进策略。例如,将此参数设置为 0.1 将导致 MIP 求解器在相对最优性差距小于 10% 时切换策略。
图14- ImproveStartGap
图15- ImproveStartGap参数
[*]ImproveStartNodes
这个参数允许你指定 MIP 求解器切换到改进策略的节点数。例如,将此参数设置为 10 将导致MIP求解器在节点数大于 10 时切换策略。
图16- ImproveStartNodes
[*] ImproveStartTime
这个参数允许你指定 MIP 求解器切换改进策略的时间。例如,将此参数设置为10将导致MIP求解器在开始优化后 10 秒内切换策略。
图17- ImproveStartTime
下面我们设定了一组参数:
model = read(&#34;VRPTW_r102_20_5.mps&#34;)
model.setParam(&#34;ImproveStartGap&#34;,10)
model.setParam(&#34;ImproveStartNodes&#34;,3000)
model.setParam(&#34;ImproveStartTime&#34;,20)
model.optimize()优化过程和结果如下,期间自动使用了(Heuristics=0.5 and RINS=10) 优化参数。但发现求解速度非常慢,总耗时达到 927.98s(15m 28s):
Read MPS format model from file VRPTW_r102_20_5.mps
Reading time = 0.02 seconds
VRPTW: 1797 rows, 1525 columns, 14416 nonzeros
Changed value of parameter ImproveStartGap to 10.0
Prev: 0.0Min: 0.0Max: infDefault: 0.0
Changed value of parameter ImproveStartNodes to 3000.0
Prev: infMin: 0.0Max: infDefault: inf
Changed value of parameter ImproveStartTime to 20.0
Prev: infMin: 0.0Max: infDefault: inf
Gurobi Optimizer version 9.1.0 build v9.1.0rc0 (win64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1797 rows, 1525 columns and 14416 nonzeros
Model fingerprint: 0x4a4bba28
Variable types: 110 continuous, 1415 integer (1415 binary)
Coefficient statistics:
Matrix range
Objective range
Bounds range
RHS range
Presolve removed 614 rows and 6 columns
Presolve time: 0.09s
Presolved: 1183 rows, 1519 columns, 16772 nonzeros
Variable types: 100 continuous, 1419 integer (1415 binary)
Root relaxation: objective 2.871000e+02, 410 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl |ObjDepth IntInf | Incumbent BestBd Gap | It/Node Time
0 0287.10000 0 37 -287.10000 - - 0s
0 0287.10000 0 59 -287.10000 - - 0s
0 0287.10000 0 64 -287.10000 - - 0s
0 0304.71668 0 83 -304.71668 - - 0s
0 0332.21792 0 82 -332.21792 - - 0s
0 0332.21792 0 85 -332.21792 - - 0s
0 0335.90452 0 80 -335.90452 - - 0s
0 0337.50589 0 95 -337.50589 - - 0s
0 0337.52434 0 92 -337.52434 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0343.62317 0 95 -343.62317 - - 0s
0 0349.99973 0105 -349.99973 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0350.21622 0108 -350.21622 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0355.94000 0114 -355.94000 - - 1s
0 0356.60000 0 73 -356.60000 - - 1s
0 0356.60000 0 98 -356.60000 - - 1s
0 0357.53333 0 61 -357.53333 - - 1s
H 0 0 461.2000000357.5333322.5% - 1s
0 0357.53333 0 59461.20000357.5333322.5% - 1s
Resetting heuristic parameters to focus on improving solution
(using Heuristics=0.5 and RINS=10)...
H 3 4 451.5000000357.8500020.7%81.3 1s
H 11 12 439.0000000357.8500018.5% 120 2s
H 13 14 422.3000000357.8500015.3% 108 2s
H 16 17 409.7000000357.8500012.7%98.1 2s
72 15403.86858 12 56409.70000357.8500012.7%52.4 5s
115 18 cutoff 17 409.70000357.8500012.7%45.7 10s
183 30370.10000 7 50409.70000358.0590912.6%47.0 15s
225 41405.26226 10 54409.70000358.3176512.5%46.0 20s
285 55395.63333 14 20409.70000358.3176512.5%42.8 25s
368 77399.61273 27 16409.70000358.3176512.5%40.8 30s
431 100 cutoff 17 409.70000358.8333312.4%42.9 35s
485 111 cutoff 21 409.70000358.8333312.4%42.2 40s
561 125404.95689 34 59409.70000358.8333312.4%41.7 45s
634 141400.04932 16 67409.70000359.2500012.3%42.9 50s
725 166395.39709 21 62409.70000359.2500012.3%42.6 56s
771 186398.97650 25 32409.70000359.3302812.3%43.6 60s
863 203401.00927 20 55409.70000359.3302812.3%42.4 66s
922 225402.04470 26 51409.70000359.3302812.3%41.7 71s
1049 253369.42982 18 65409.70000360.7803311.9%41.3 75s
1102 269 cutoff 23 409.70000360.7803311.9%42.3 80s
1209 298385.94144 20 87409.70000360.7803311.9%42.5 86s
1311 326388.07853 26 87409.70000360.7803311.9%42.9 91s
1407 354 cutoff 38 409.70000361.0761911.9%43.0 97s
1462 370394.09537 25 70409.70000361.4481111.8%42.6100s
1610 413362.05714 25 98409.70000362.0000011.6%43.6107s
1681 433376.14483 28 88409.70000362.0000011.6%44.0110s
1806 459 cutoff 29 409.70000362.0571411.6%43.7116s
1854 463 cutoff 30 409.70000362.5029411.5%43.7120s
1984 508385.38974 33 80409.70000363.5562511.3%43.4128s
2073 519387.51076 37 67409.70000363.5562511.3%43.6133s
2138 553369.24570 41105409.70000363.5562511.3%43.5137s
2230 573 infeasible 56 409.70000363.8135911.2%43.5142s
2318 595393.37500 30 57409.70000364.5807511.0%43.4147s
2426 626 infeasible 34 409.70000364.7428611.0%42.9152s
2575 641401.32573 49 64409.70000365.0694410.9%42.5157s
2682 665 infeasible 47 409.70000365.8500010.7%42.5163s
2737 688 cutoff 50 409.70000367.9437510.2%42.8169s
2854 706403.12941 57 41409.70000369.759039.75%42.5176s
2959 730 cutoff 55 409.70000369.759039.75%42.2182s
3122 742396.97684 9 99409.70000369.770099.75%41.7186s
3186 754369.77009 17114409.70000369.770099.75%42.9191s
3230 743406.01299 18 75409.70000369.770099.75%43.1196s
3257 734384.27257 18 88409.70000369.770099.75%43.1200s
3288 735369.77009 18 67409.70000369.770099.75%43.2205s
3354 719403.40475 21 40409.70000369.770099.75%43.5211s
3412 719394.89398 26 99409.70000369.770099.75%43.5216s
3492 710405.60354 29 32409.70000369.770099.75%43.5221s
3532 709400.94094 28 70409.70000369.770099.75%43.5225s
3587 708369.77009 19 78409.70000369.770099.75%43.9230s
3660 693407.73068 21 47409.70000369.770099.75%44.3236s
3795 673375.38056 23 72409.70000369.770099.75%44.7242s
3896 668 cutoff 27 409.70000369.770099.75%44.8246s
4004 655369.77009 25 88409.70000369.770099.75%45.0251s
4082 661403.98528 27 26409.70000369.770099.75%44.6255s
4256 632398.97533 30 87409.70000369.770099.75%44.9261s
4362 616 cutoff 38 409.70000369.770099.75%45.1266s
4427 600405.50000 41 42409.70000369.770099.75%45.1271s
4474 595393.22879 28 92409.70000369.770099.75%45.1278s
4501 617388.20651 29 94409.70000369.770099.75%45.3281s
4573 606 infeasible 31 409.70000369.770099.75%45.3285s
4723 577377.09549 32 67409.70000369.770099.75%45.3292s
4844 552403.02258 36 57409.70000369.770099.75%45.4295s
5043 511405.84995 39 85409.70000369.770099.75%45.6303s
5125 507 infeasible 43 409.70000369.770099.75%45.5307s
5225 478388.63598 36 84409.70000369.770099.75%45.5311s
5299 488393.59892 40 85409.70000369.770099.75%45.5316s
5461 497400.11808 49 86409.70000371.627169.29%45.4320s
5524 525 cutoff 37 409.70000371.627169.29%45.4325s
5666 551408.18806 43 67409.70000371.920519.22%45.2330s
5864 557372.68492 41120409.70000372.684929.03%44.8335s
5951 577387.19397 45 67409.70000373.350008.87%44.7340s
6080 609376.01202 43121409.70000373.352768.87%44.9346s
6242 624375.11823 45 92409.70000373.439168.85%44.7351s
6344 639382.82587 47 83409.70000373.439168.85%44.7357s
6408 651399.18985 50 64409.70000373.439168.85%44.7363s
6488 688 cutoff 38 409.70000375.164298.43%44.6369s
6781 711 cutoff 33 409.70000376.912908.00%44.5376s
6883 746 cutoff 39 409.70000377.066047.97%44.4382s
7096 792 cutoff 49 409.70000377.980567.74%44.3389s
7268 808397.12805 60 79409.70000377.980567.74%44.6396s
7399 853405.60375 66 38409.70000378.464797.62%44.4403s
7717 903 cutoff 31 409.70000381.700426.83%44.4411s
7939 915403.80535 58 62409.70000381.700426.83%44.3418s
8052 942 cutoff 54 409.70000382.500006.64%44.2425s
8302 966408.66035 45 86409.70000383.286906.45%44.1432s
8499 971 cutoff 42 409.70000383.584086.37%43.8442s
8569 980404.98586 31 44409.70000383.688676.35%43.7451s
86451013 infeasible 42 409.70000383.704526.35%43.6460s
88971054404.33574 50 48409.70000384.104926.25%43.4469s
92651074 cutoff 38 409.70000384.413666.17%43.2479s
94071117 cutoff 47 409.70000384.596466.13%43.1488s
98321148407.79126 49 59409.70000385.170925.99%42.9497s
101391136 cutoff 68 409.70000385.170925.99%42.8509s
102131143406.19803 70 15409.70000385.858415.82%42.7521s
103161159404.49828 45 72409.70000386.059065.77%42.6533s
105271282389.05903 39 69409.70000386.326355.71%42.4544s
116661297397.40000 32 12409.70000387.582265.40%41.8556s
118751344404.22375 39 27409.70000387.624285.39%41.7569s
123481377 infeasible 62 409.70000388.214505.24%41.5583s
126711418 cutoff 63 409.70000388.658655.14%41.4598s
133231421 cutoff 50 409.70000389.189275.01%41.1612s
135351429 cutoff 73 409.70000389.445224.94%41.0626s
140751440408.02361 53 52409.70000389.964184.82%40.6641s
147601445 infeasible 51 409.70000390.529944.68%40.3658s
150481480393.09352 49 84409.70000390.786194.62%40.2673s
157821441400.17823 69 55409.70000391.405484.47%40.0691s
174511441 cutoff 59 409.70000392.988094.08%39.4700s
175551469 cutoff 69 409.70000393.085024.06%39.3708s
177451468406.23138 84 68409.70000393.326834.00%39.3717s
180221428403.46050 82 74409.70000393.673493.91%39.2726s
186991422 cutoff 46 409.70000394.617123.68%39.0736s
190281413 cutoff 74 409.70000394.888603.62%38.9748s
191761373 cutoff 56 409.70000395.233493.53%38.8760s
197061379397.71322 53 97409.70000395.763443.40%38.6773s
199561333401.78059 44 62409.70000396.061903.33%38.5788s
204031233 cutoff 31 409.70000396.534593.21%38.4802s
213031238 cutoff 34 409.70000397.229743.04%38.0818s
217371162 cutoff 35 409.70000397.761372.91%37.8831s
226651115404.35087 94 55409.70000398.943332.63%37.4847s
230441050402.33474 54 57409.70000399.351042.53%37.3864s
23481 950404.74992 59 73409.70000400.096862.34%37.1883s
24153 618 cutoff 91 409.70000400.811972.17%36.7902s
25535 307 infeasible 86 409.70000403.334171.55%35.7918s
26276 0 cutoff 54 409.70000405.200011.10%35.2927s
Cutting planes:
Gomory: 10
Cover: 23
Implied bound: 54
Clique: 9
MIR: 13
StrongCG: 6
Flow cover: 39
Inf proof: 5
Zero half: 16
RLT: 150
Relax-and-lift: 11
Explored 26748 nodes (932512 simplex iterations) in 927.98 seconds
Thread count was 8 (of 8 available processors)
Solution count 5: 409.7 422.3 439 ... 461.2
Optimal solution found (tolerance 1.00e-04)
Best objective 4.097000000000e+02, best bound 4.097000000000e+02, gap 0.0000%我们将以上测试结果进行汇总,如下表所示。可知各个启发式算法的参数设置对求解结果的影响有时候是很大的,以及,并没有明确的证据表明,在特定的参数下,求解效果就一定好。因此需要用户自行进行调优和测试,具体问题具体分析。
图18- 实验结果对比
总结
以上就是本文的全部内容,在本文中,我们首先介绍了什么是数学启发式 Matheuristics,然后分类介绍了 Gurobi 求解器里提供的启发式算法类别以及大致思想,并列举了涉及到的重要参数。在最后的案例实验中,我们依次添加了各类参数,并通过日志分别查看参数对求解性能的影响。但正如天下没有免费的午餐,启发式其实未必总能提高效率,在实际应用中,依然需要使用者对研究的问题领域以及每类启发式算法的原理有足够的理解才能用好这些工具。希望本文的内容能够对大家使用数学启发式有所帮助。
<hr/>新一期月刊发布
280页运小筹优化理论教程发布(2022年3月--2022年6月)
可以从下方链接详细阅览:
月刊主题
获取方式
<hr/>关注我们运小筹公众号
运小筹公众号致力于分享运筹优化(LP、MIP、NLP、随机规划、鲁棒优化)、凸优化、强化学习等研究领域的内容以及涉及到的算法的代码实现。编程语言和工具包括Java、Python、Matlab、CPLEX、Gurobi、SCIP 等。欢迎广大同行投稿!欢迎大家关注我们的公众号“运小筹”以及粉丝群!
如果群满加不进去,可以加本文作者微信,然后备注姓名+机构+专业,然后拉您入群。
<hr/>往期推文合集
第114篇:重磅硬货!280页运小筹优化理论教程发布(2022年3月--2022年6月)!
第113篇:优化 | 分支定界算法案例实战:Python调用COPT实现
第112篇:优化 | 分支定界算法案例实战:Python调用COPT实现
第111篇:优化 | 五个经典设施选址模型的详解及其实践:Python调用Gurobi实现
第110篇:始于初心,回馈教育:运筹与智能决策教学平台——杉数CORIDM全新升级上线!
第109篇:求解器COPT实践详解丨数学规划视角下的分货优化解题思路
第108篇:论文代码复现 | 考虑客户位置移动的车辆路径规划问题:MIP模型详解及Java调用CPLEX求解的完整代码
第107篇:求解器COPT实践丨地铁乘务排班问题如何优化求解
第106篇:优化求解器 | 求解器加速的高级技能包:MIP模型初始解设置相关操作的超详细解读
第105篇:OR Talk Pool:【8月26日-9月3日】近期讲座、课程和研讨会
第104篇:OR Talk Pool:【8月17日-8月31日】近期研讨会、论坛和培训
第103篇:进展 | 清华大学SIGS戚铭尧及其合作者在顶级期刊Operations Research上发表竞争性设施选址问题的最新研究进展
第102篇:启发式算法和优化算法设计及调试技巧 | AIRS in the AIR“运筹优化”系列讲座
第101篇:OR Talk Pool【8月9日-8月31号】:近期研讨会、论坛和培训
第100篇:理论算法与精确算法 | AIRS in the AIR”运筹优化“系列讲座
第99篇:OR Talk Pool【7月27日-8月】:近期研讨会、论坛和培训
第98篇:优化求解器|Solution Pool用法的超详细解读(Gurobi):最优解与多个可行解的获取与分析(案例与代码实现)
第97篇:新书推荐《整数规划:模型、应用及求解》
第96篇:OR Talk Pool【7月6日-7月13日】:近期研讨会、论坛和培训
第95篇:从大规模的复杂应用,来解析杉数求解器的硬核能力
第94篇:优化 | 手把手教你用C++调用Gurobi求解CVRP:环境配置、数学模型及完整代码
第93篇:OR Talk Pool:近期研讨会、暑期学校和学术报告推荐
第92篇:优化求解器 | Gurobi的MVar类:矩阵建模利器、求解对偶问题的备选方案 (附详细案例+代码)
第91篇:【求解器】Gurobi中非线性约束的对偶值的获取:QCP、QCQP、SOCP | 以及求解器最优性理论证明
第90篇:优化 | 二部图最大匹配问题的精确算法详解(HK算法和匈牙利算法):一份让您满意的【理论介绍+代码实现】学习笔记
第89篇:优化算法 | Benders Decomposition: 一份让你满意的【入门-编程实战-深入理解】的学习笔记
第88篇:优化 | 史上最【皮】数学题求解的新尝试:一种求解器的视角 (Python调用Gurobi实现)
第87篇:优化 | 寻找新的建模视角——从直观解释对偶问题入手:以Cutting Stock Problem的对偶问题为例
第86篇:ORers‘ Bling Chat【03】 | 【高光聊天记录集锦】:运小筹读者群里那些热烈的讨论
第85篇:非线性优化 | 非线性问题线性化以及求解的详细案例及Python+Gurobi求解
第84篇:ORers&#39; Bling Chat | 【高光聊天记录集锦-02】:运小筹读者群里那些热烈的讨论
第83篇:Machine-Learning–Based Column Selection for Column Generation
第82篇:最新!205页运小筹优化理论学习笔记发布(2021年9月--2022年3月)!
第81篇:【鲁棒优化】| 补充证明:为什么最优解一定满足取值等于绝对值(论文笔记:The Price of Robustness)
第80篇:【鲁棒优化】| 论文笔记:The Price of Robustness - 列不确定性模型部分的推导和一些思考
第79篇:ORers&#39; Bling Chat | 【高光聊天记录集锦-01】:运小筹读者群里那些热烈的讨论
第78篇:优化| 手把手教你学会杉数求解器(COPT)的安装、配置与测试
第77篇:【教学视频】优化 | 线性化(2):连续变量 * 0-1变量的线性化
第76篇:【教学视频】优化 | 线性化:两个0-1变量相乘的线性化
第75篇:强化学习实战 | DQN和Double DQN保姆级教程:以Cart-Pole为例
第74篇:强化学习| 概念梳理:强化学习、马尔科夫决策过程与动态规划
第73篇:强化学习实战 | Q-learning求解最短路(SPP)问题
第72篇:鲁棒优化 | 以Coding入门鲁棒优化:以一个例子引入(二)
第71篇:鲁棒优化|基于ROME编程入门鲁棒优化:以一个例子引入(一)
第70篇:优化|含分式的非线性规划求解: 基于Outer Approximation的Branch-and-cut 算法及其Java实现
第69篇:科研工具 | 手把手教你玩转文献管理神器:Endnote
第68篇:相约深圳 | 2022 INFORMS 服务科学国际会议·征稿通知
第67篇:鲁棒优化| 利用rome求解鲁棒优化简单案例:以CVaR不确定性集为例
第66篇:机器学习 | 交通流特征工程小技巧和思考
第65篇:最新!145页运小筹优化理论学习笔记发布(2021年4月--9月)!
第64篇:优化 | 手把手教你用Python调用SCIP求解最优化模型
第63篇:优化 | 随机规划案例:The value of the stochastic solution
第62篇:工具 | draw.io: 科研流程示意图必备大杀器
第61篇:优化 | 开源求解器SCIP的安装与入门教程(Windows+Python)
第60篇:优化|Gurobi处理非线性目标函数和约束的详细案例
第59篇:让出租车更“懂”您的出行
第58篇:测试算例下载:《运筹优化常用模型、算法及案例实战:代码手册》
第57篇:鲁棒优化|分布式鲁棒优化转化为SOCP案例及代码实现(Python+RSOME)
第56篇:鲁棒优化 | 分布式鲁棒优化简单案例及实战(RSOME+Gurobi)
第55篇:【尾款+发货】|【代码手册】 《运筹优化常用模型、算法及案例实战:Python+Java
第54篇:深度强化学习之:PPO训练红白机1942
第53篇:简单装配线平衡问题
第52篇:【视频讲解】CPLEX的OPL语言:可视化的优化模型求解解决方案
第51篇:算法 | 基于英雄联盟寻路背景的A星算法及python实现
第50篇:【转发】清华大学深圳国际研究生院2021年物流工程与管理项目优秀大学生夏令营报名通知
第49篇:优化 | 精确算法之分支定界介绍和实现(附Python代码)
第48篇:【顶刊论文速递】综述:服务科学视角下的金融科技
第47篇:【重新发布】|《运筹优化常用模型、算法及案例实战:Python+Java实现》 【代码手册】 开始预购啦!!!
第46篇:智慧交通可视化:手把手教你用Python做出行数据可视化-osmnx 包入门教程
第45篇:优化 | Pick and delivery problem的介绍与建模实现(二)
第44篇:推一个知乎学弱猹的公众号
第43篇:元启发式算法 | 遗传算法(GA)解决TSP问题(Python实现)
第42篇:优化|视频详解Python调用Gurobi的应用案例:TSP
第41篇:最新!213页运小筹优化理论系列笔记发布!
第40篇:运小筹第四期月刊发布!
第39篇:开源交通仿真平台SimMobility的安装教程
第38篇:浅谈 | P问题、NP问题、NPC问题、NP-Hard问题
第37篇:一份掏心掏肺的信息素养笔记分享
第36篇:强化学习|Q-learning (王者荣耀视角)
第35篇:优化|高级建模方法(Gurobi):线性化表达小技巧
第34篇:深度强化学习介绍 | Deep Q Network——理论与代码实现
第33篇:优化 | 列生成算法及Java调用cplex实现
第32篇:优化 | Pick and delivery problem的简介与建模实现(一)
第31篇:最新!运小筹月刊-1月份发布!
第30篇:“Learn to Improve”(L2I):ICLR文章分享 | 运用RL解决VRP问题
第29篇:线性规划求解小程序 | 基于Python 的Cplex 求解器图形化界面
第28篇:运筹学与管理科学TOP期刊揭秘 —TR系列
第27篇:Julia安装与配置Jupyter Notebook
第26篇:期刊征文| IEEE TRANSACTIONS应对COVID-19的特刊征文消息速递
第25篇:两阶段随机规划(Two-stage Stochastic Programming):一个详细的例子
第24篇:最新!运小筹月刊-12月份发布!
第23篇:Python调用Gurobi:Assignment Problem简单案例
第22篇:初识随机规划:一个小小例子
第21篇:机器学习运用到VRP的若干小知识
第20篇:运筹学与管理科学TOP期刊揭秘 —Service Science
第19篇:手把手教你用Python实现Dijkstra算法(伪代码+Python实现)
第18篇:运筹学与管理科学大揭秘—TOP期刊主编及研究方向一览
第17篇:优化 | 手把手教你用Python实现动态规划Labeling算法求解SPPRC问题
第16篇:代码 | 运小筹GitHub项目上线啦,快来标星收藏吧!!
第15篇:最新!运小筹月刊首次发布!
第14篇:优化| 手把手教你用Python实现Dijkstra算法(附Python代码和可视化)
第13篇:优化|手把手教你用Python调用Gurobi求解最短路问题
第12篇:优化| 手把手教你用Java实现单纯形法
第11篇:优化| 手把手教你用Python调用Gurobi求解VRPTW
第10篇:优化 | 两阶段启发式算法求解带时间窗车辆路径问题(附Java代码)
第9篇:Java调用cplex求解运输问题
第8篇:优化 | 如何优雅地写出大规模线性规划的对偶
第7篇:优化 | TSP中两种不同消除子环路的方法及Callback实现(Python调用Gurobi求解)
第6篇:元启发式算法 | 禁忌搜索(Tabu Search)解决TSP问题(Python代码实现)
第5篇:论文代码复现 | 无人机与卡车联合配送(Python+Gurobi)
第4篇:优化|Shortest Path Problem及其对偶问题的一些探讨(附Python调用Gurobi实现)
第3篇:可视化|Python+OpenStreetMap的交通数据可视化(二):OpenStreetMap+Python画城市交通路网图
第2篇:优化|最速下降法:详细案例+Python实现
第1篇:Python+networkX+OpenStreetMap实现交通数据可视化(一):用OpenStreetMap下载地图数据
<hr/>作者:徐璐,清华大学,清华大学深圳国际研究生院,清华-伯克利深圳学院,硕士在读
作者:刘兴禄,清华大学,清华大学深圳国际研究生院,清华-伯克利深圳学院,博士在读
审校&编辑:张瑞三,四川大学,硕士在读
初次完稿日期:2022.10.12
编辑于 2022-10-13 月刊信息和读者群可以关注公众号咨询,也可以咨询我 很棒
页:
[1]