Optimization 求解器中的线性优化二元约束公式
我正在做这个投资问题陈述,在制定约束方程方面面临着困难 让x1、x2、x3和x4表示 如果经纪人选择投资或不投资于投资选项1、2、3、4,则为二元变量。假设经纪人具有以下约束:Optimization 求解器中的线性优化二元约束公式,optimization,mathematical-optimization,linear-programming,solver,mixed-integer-programming,Optimization,Mathematical Optimization,Linear Programming,Solver,Mixed Integer Programming,我正在做这个投资问题陈述,在制定约束方程方面面临着困难 让x1、x2、x3和x4表示 如果经纪人选择投资或不投资于投资选项1、2、3、4,则为二元变量。假设经纪人具有以下约束: *如果x3+x4 ge 1,则x1+x2=1;如果x3+x4=0,则x1+x2 ge 0* 如何组合上述约束条件?我将让您进行最终检查,但基本上应该是这样: "The constraints is if X3 + X4 ge 1 Then x1 + X2 = 1." 这相当于: (x3 or x4)
*如果x3+x4 ge 1,则x1+x2=1;如果x3+x4=0,则x1+x2 ge 0*
如何组合上述约束条件?我将让您进行最终检查,但基本上应该是这样:
"The constraints is if X3 + X4 ge 1 Then x1 + X2 = 1."
这相当于:
(x3 or x4) implies ((x1 and not x2) or (not x1 and x2))
- (x3 or x4) captures the >= 1
- x1 + x2 = 1 is an XOR and captured by ((x1 and not x2) or (not x1 and x2))
- DNF of XOR
让我们要求做布尔最小化:->我们对CNF感兴趣!
- The CNF produced is ready to be mapped to ILP as it's a conjunction of ORs
- Each OR is a term of it's literals summing up to >= 1:
(1 - x1) + (1 - x2) + (1 - x3) >= 1
(1 - x1) + (1 - x2) + (1 - x4) >= 1
x1 + x2 + (1 - x3) >= 1
x1 + x2 + (1 - x4) >= 1
这应该是一个相当严密/有力的公式
我建议你再仔细检查一下