GUROBI 参数设置

本文介绍了Gurobi求解连续模型和MIP问题时的参数设置,包括Method、BarConvTol、OptimalityTol等。讲解了不同算法如 Barrier、Simplex 和 Concurrent 的适用场景和效果。默认设置通常能提供良好性能,但在特定难题上可以尝试调整参数以提高效率。同时提到了针对内存紧张情况的选择和MIP问题的优化策略。
摘要由CSDN通过智能技术生成

Method
Algorithm used to solve continuous models 求解LP问题或MIP问题的根节点时采用的算法
Type: int
Default value: -1
Minimum value: -1
Maximum value: 5
Algorithm used to solve continuous models or the root node of a MIP model. Options are: -1=automatic, 0=primal simplex, 1=dual simplex, 2=barrier, 3=concurrent, 4=deterministic concurrent, 5=deterministic concurrent simplex.

In the current release, the default Automatic (-1) setting will typically choose non-deterministic concurrent (Method=3) for an LP, barrier (Method=2) for a QP or QCP, and dual (Method=1) for the MIP root node. Only the simplex and barrier algorithms are available for continuous QP models. Only primal and dual simplex are available for solving the root of an MIQP model. Only barrier is available for continuous QCP models.

Concurrent optimizers run multiple solvers on multiple threads simultaneously, and choose the one that finishes first. Method=3 and Method=4 will run dual simplex, barrier, and sometimes primal simplex (depending on the number of available threads). Method=5 will run both primal and dual simplex. The deterministic options (Method=4 and Method=5) give the exact same result each time, while Method=3 is often faster but can produce different optimal bases when run multiple times.

The default setting is rarely significantly slower than the best possible setting, so you generally won’t see a big gain from changing this parameter. There are classes of models where one particular algorithm is consistently fastest, though, so you may want to experiment with different options when confronted with a particularly difficult model.

Note that if memory is tight on an LP model, you should consider using the dual simplex method (Method=1). The concurrent optimizer, which is typically chosen when using the default setting, consumes a lot more memory than dual simplex alone.

BarConvTol
Barrier convergence tolerance 约束收敛误差
Type: double
Default value: 1e-8
Minimum value: 0.0
Maximum value: 1.0
The barrier solver terminates when the relative difference between the primal and dual objective values is less than the specified tolerance (with a GRB_OPTIMAL status). Tightening this tolerance often produces a more accurate solution, which can sometimes reduce the time spent in crossover. Loosening it causes the barrier algorithm to terminate with a less accurate solution, which can be useful when barrier is making very slow progress in later iterations.

Note: Barrier only

OptimalityTol
Dual feasibility tolerance 最优性误差
Type: double
Default value: 1e-6
Minimum value: 1e-9
Maximum value: 1e-2
Reduced costs must all be smaller than OptimalityTol in the improving direction in order for a model to be declared optimal.

MIPGap
Relative MIP optimality gap 求MIP问题得到的最优解的最优性相对误差
Type: double
Default value: 1e-4
Minimum value: 0
Maximum value: Infinity
The MIP solver will terminate (with an optimal result) when the gap between the lower and upper objective bound is less than MIPGap times the absolute value of the incumbent objective value. More precisely, if Z P Z_P ZP is the primal objective bound (i.e., the incumbent objective value, which is the upper bound for minimization problems), and Z D Z_D ZD is the dual objective bound (i.e., the lower bound for minimization problems), then the MIP gap is defined as
Z P = ∣ Z P − Z D ∣ / Z P

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值