在 YALMIP 中应用 CPLEX,错误 1001:内存不足



YALMIP:求解器中的未知问题(在sdpsettings中打开"调试"( (使用cplexmilp时出错(第328行(CPLEX Error 1001: Out of memory.(
我在yalmip中应用了复合求解器,但模型无法求解。我认为默认内存设置会导致此错误。在 yalmip 中不能使用 cplex 设置代码。

cplex.setParam(IloCplex::WorkDir ,"c:/cplex/"(;
cplex.setParam(IloCplex::NodeFileInd ,2(; 那么如何正确设置内存。谢谢。

This is error information
There may be further error information in the clone logs.
Flow cuts applied:  116
Mixed integer rounding cuts applied:  299
Lift and project cuts applied:  75
Gomory fractional cuts applied:  60
Warning: MIP starts not constructed because of out-of-memory status.
Root node processing (before b&c):
Real time             =    5.02 sec. (945.62 ticks)
Parallel b&c, 4 threads:
Real time             =  957.66 sec. (874133.10 ticks)
Sync time (average)   =   36.04 sec.
Wait time (average)   =    0.05 sec.
------------
Total (root+branch&cut) =  962.67 sec. (875078.72 ticks)
result = 
yalmiptime: NaN
solvertime: NaN
info: [1x128 char]
problem: 9

您的计算机没有足够的 RAM 来运行您的问题。

你可以做一些技巧

  • 将 MIPEmphasis 参数设置为 1。这将使CPLEX强调寻找可行的解决方案,这可能导致较小的B&B树大小。
  • 将节点文件输入参数设置为 3。它将强制您的B&B树以压缩文件的形式存储在HD中。但是,这会大大减慢求解器的速度。
  • 使用工作记忆参数。将其设置为可由RAM处理的软限制。超过此限制后,CPLEX 将查看自己使用的其他内存策略。
  • 仅将 CPLEX 与一个线程一起使用。因此,不会将任何变量或状态从一个线程复制到另一个线程。

如果这些策略都不起作用,那么我们就无能为力。您需要重新调整模型或更换为具有更多 RAM 的 PC。

最新更新