CPLEX Python API 中的 Benders 分解点削减

Benders Decomposition Point Cuts in CPLEX's Python API

我正在尝试使用 CPLEX 公开的 python API 将 Benders 分解实现为混合整数线性规划。它附带的教程文件 (bendersatsp.py) 展示了当内部子问题无界时,我们如何实现 "ray" 切割。然而,它并没有说明实现切点的过程。 Paul Robin 在 JAVA API 上的 blog 提到 "When the LP subproblem is feasible, we can get the dual values directly with a function named getDuals"。 python 的过程是否相同?是否有示例说明如何执行此操作?

还有,为什么cplex自带的示例代码不这样做呢?在这种情况下,当内部问题可行时会发生什么?

据我所知,

bendersatsp.py 是针对结构化问题的。如果我对你的理解正确,你需要找到一个最优切割(Benders 的 LP 有两种切割:可行性和最优切割)因为你需要找到对偶(用于你的 MIP 的 LP 松弛)。随着 Python API:

subproblem = cplex.Cplex()
## construct your subproblems
.....
## find variables' names:
con_names = subproblem.linear_constraints.get_names()
subproblem.solve()
## get the duals to cunstruct the cut:
duals = subproblem.solution.get_dual_values(con_names)

还有一点,get_dual_values() returns要么是双极点,要么是射线,这取决于你的问题的解决状态(虽然方法的名称有点模糊)。