LPsolveAPI中的或非约束 [英] Either-Or constraints in LPsolveAPI
问题描述
我目前正在R中的LPsolveAPI中编写MIP.该程序本身很简单,但是我无法找到一种写或非约束的方法,而不能直接调用新的二进制变量或二进制值在lhs上. LPsolveAPI是否不支持此功能,或者我是否缺少明显的功能?
I'm currently writing a MIP in LPsolveAPI in R. The program itself is straightforward, but I can't find a way to write an either-or constraint without being able to directly call a new binary variable or the binary values on the lhs. Does LPsolveAPI not support this or am I missing something obvious?
推荐答案
使用新的二进制变量是在lp_solve中建模或"或约束"的标准方法. ( LpSolveAPI 基于
The use of new binary variables is the standard way to model either-or-constraints in lp_solve. (LpSolveAPI is based on the lp_solve solver.). So you are not missing anything obvious.
也就是说,根据您的限制,可能会帮助您的一件事是使用SOS(特殊顺序集).在lp_Solve中查看对SOS的引用.
That said, one thing that might help you, depending on your constraints is the use of SOS (Special Ordered Sets). Check out the reference to SOS in lp_Solve.
这篇关于LPsolveAPI中的或非约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!