如何在 Julia JuMP 软件中进行严格约束? [英] How can I make strict constraint in the Julia JuMP software?

查看:14
本文介绍了如何在 Julia JuMP 软件中进行严格约束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 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 是这样说的: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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆