How can I make strict constraint in the Julia JuMP software?

北城以北 提交于 2019-12-08 09:06:46

问题


How can I make strict constraint in Julia JuMP?(https://github.com/JuliaOpt/JuMP.jl).

For example:

2x-3y>15

回答1:


It seems that none of the solvers accept strict constraints because of the way they solve the problem and to avoid some issues!

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

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



来源:https://stackoverflow.com/questions/48743136/how-can-i-make-strict-constraint-in-the-julia-jump-software

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!