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