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?
相关问题
- Most efficient way to turn factor matrix into bina
- HTML5 - Canvas - Optimization for large images
- Need help fixing an algorithm that approximates pi
- Improving performance of a function in python
- Cast some light on population count algorithm
相关文章
- Optimization techniques for backtracking regex imp
- Logging Django SQL queries with DEBUG set to False
- How to get path of the php binary on server where
- Unsigned char c = 255 is “11111111” or not?
- Optimising this C (AVR) code
- Pointer dereferencing overhead vs branching / cond
- What's the best way to minify the ASP.NET gene
- JavaScript replace with callback - performance que
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.
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.