如何在Julia JuMP软件中进行严格限制? [英] How can I make strict constraint in the Julia JuMP software?
问题描述
如何在Julia JuMP中进行严格限制?( https://github.com/JuliaOpt/JuMP.jl ).
How can I make strict constraint in Julia JuMP?(https://github.com/JuliaOpt/JuMP.jl).
例如:
2x-3y>15
推荐答案
似乎没有一个解决者因为解决问题和避免某些问题的方式而接受严格的约束!
It seems that none of the solvers accept strict constraints because of the way they solve the problem and to avoid some issues!
古罗比说的是: Gurobi支持一组有限的比较器.具体来说,您可以将一个表达式限制为小于或等于,大于或等于或等于另一个.我们不支持严格小于,严格大于或不相等的比较器.尽管这些其他比较器似乎适合进行数学编程,但为了避免与数值公差相关的潜在混淆,我们将它们排除在外.考虑一个简单的示例,该示例对一对连续变量执行严格的不等式约束:$ x> y $.为了满足约束条件,需要多大的$ x-y $?与其尝试在处理程序中嵌入一种微妙的,可能引起混乱的策略来处理此类约束,我们选择不支持它们.
Here is what Gurobi says: Gurobi supports a limited set of comparators. Specifically, you can constrain an expression to be less-than-or-equal, greater-than-or-equal, or equal another. We do not support strict less-than, strict greater-than, or not-equal comparators. While these other comparators may seem appropriate for mathematical programming, we exclude them to avoid potential confusion related to numerical tolerances. Consider a simple example of a strict inequality constraint on a pair of continuous variables: $x > y$. How large would $x-y$ need to be in order to satisfy the constraint? Rather than trying to embed a subtle and potentially confusing strategy for handling such constraints into the solver, we've chosen not to support them instead.
http://www.gurobi.com/documentation/7.5/refman /constraints.html
真正需要的解决方案 尝试实施非严格约束,并放置一个松弛变量来管理此问题 例子: 2x-3y> 15变为2x-3y + slackvar> = 15
Solution if you really need Try to implement a non-strict constraint and put a slack variable to manage this issue Example: 2x-3y>15 Turns to 2x-3y+slackvar >=15
这篇关于如何在Julia JuMP软件中进行严格限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!