我想在找到一个解决方案时终止解决,我该怎么做?
现在它返回如下内容:
* 62: obj = -8.419980000e+05 inf = 0.000e+00 (0)
OPTIMAL LP SOLUTION FOUND
Integer optimization begins...
+ 62: mip = not found yet >= -inf (1; 0)
+ 149: >>>>> -1.370260000e+05 >= -7.939630000e+05 479.4% (26; 0)
+ 1390: >>>>> -1.375090000e+05 >= -4.261680000e+05 209.9% (264; 27)
+ 28323: mip = -1.375090000e+05 >= -1.921510000e+05 39.7% (2232; 1534)
+ 52571: mip = -1.375090000e+05 >= -1.781890000e+05 29.6% (2983; 3596)
答案 0 :(得分:1)
我认为没有很好的方式这样做。
这些高级用法通常通过对解算器的更多直接访问来完成(与此类包装器相反;我假设您仍在使用cvxopt,就像在其他问题中一样)
一些评论:
setMaximumSolutions
支持此功能,但我认为cvxopt中没有包装器)objll
或objul
docs objul (default: +DBL_MAX)
Upper limit of the objective function. If the objective function reaches this limit and continues increasing, the solver stops the search. This parameter is used in the dual simplex only.
objll (default: -DBL_MAX)
Lower limit of the objective function. If the objective function reaches this limit and continues decreasing, the solver stops the search. This parameter is used in the dual simplex method only.
objll
设置为巨大值(或更好:预期的最差解决方案值=最大值)objul
设置为微小值(可能为负;或者更好:预期的最差解决方案值=最小值)