使用 PYOMO 在 CPLEX 日志上获取约束标签(非索引)

Get Constraint Label (not index) on CPLEX Log using PYOMO

我是 运行 PYOMO 上的 MIP 模型,调用 CPLEX 作为求解器。

我收到以下日志:

  Implied bounds make row 'c_e_x1835719_' infeasible.

我想知道我的约束 c_e_x1835719 代表的是哪个。我应该如何在 PYOMO 中完成此操作?

下面是我的求解器调用:

 results = SolverFactory.solve(model, 
                               tee = True,
                               logfile = "model.log")

我试图通过 option_string 模仿来自 OPL 的线程设置更大的 BigMAPthreshold 但它失败了(CPLEX 没有将 BigMAPthreshold 识别为有效参数)。

 results = SolverFactory.solve(model, 
                               tee = True,
                               logfile = "model.log",
                               option_string='bigMapTheshold=1000000')

我声明我的限制如下:

    model.profit=Constraint(model.T, name='profit', rule=_profit)

编辑:

作为对问题的第一条评论,presolve 更改了约束配置,因此尝试在日志中获取原始约束名称是没有意义的。

但是...

是否可以打印这个全新的不可行约束以调查不可行的根本原因?

谢谢

正如丹尼尔所说,您应该使用冲突精炼器。我不知道 Pyomo 是否提供了此 CPLEX 功能的接口。如果没有,您可以将模型另存为 .lp.sav 文件并使用 CPLEX Interactive:

cplex -c "read file.sav" "tools conflict"

有关该功能的文档位于 https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/CPLEX/UsrMan/topics/infeas_unbd/conflict_refiner/06_Interactive_title_synopsis.html