好啊因此,我发布(删除)的第一个答案有点仓促,对于所描述的关系来说,逻辑是错误的.这(希望)是正确的!;)
max()
和min()
是非线性的,因此我们需要以某种方式将它们线性化(使用辅助变量)和一些逻辑来关联2极小值,这(下文)可以使用二进制辅助变量和大M约束.
在伪代码中:
a, b, x, y : real-valued variables
ab_min : real-valued variable
x_lt_y : binary variable, 1 implies x <= y, 0 else
M = some suitably large constant, depending on the max range of a, b, x, y
新约束:
ab_min <= a
ab_min <= b
ab_min >= x - (1 - x_lt_y) * M
ab_min >= y - (x_lt_y) * M
逻辑:
ab_min
.