-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sensitivity analysis #468
Comments
Pinging @mdhaber so he can follow this query if desired |
I would call these "dual variables." Another common term is "shadow price." JuMP does this by looking at the sign of the dual. If minimizing, the dual applies to the lower bound if it is positive, and the upper bound if it is negative. When maximizing, the dual applies to the lower bound if it is negative, and the upper bound if it is positive. Here's the code, but there is a p.s. Off-topic: I was just poking the linked scipy PRs. Does scipy have a python implementation of simplex?!?! What was the motivation for that? Why not wrap Clp/GLPK? I guess HiGHS is the replacement? |
In SciPy we're planning on calling the attribute of the result object |
I don't want to derail the conversation here, but a few thoughts: |
The only argument against sensitivity is that it is a term-of-art for the question "how far can the RHS change while the solution remains optimal." See https://jump.dev/JuMP.jl/stable/solutions/#Sensitivity-analysis-for-LP, Gurobi uses the same term: https://www.gurobi.com/documentation/9.0/refman/attributes.html It probably makes the most sense for more general users, however. Thanks for the background. The binary dependency story of Julia used to be a problem for us, but it is now excellent thanks to https://github.com/JuliaPackaging/Yggdrasil. HiGHS has automated builds for every platform: https://github.com/JuliaBinaryWrappers/HiGHS_jll.jl (binaries https://github.com/JuliaBinaryWrappers/HiGHS_jll.jl/releases/tag/HiGHS-v0.2.1%2B0) |
"Sensitivity" is a reasonable term for what you want, assuming that you only want the "rate of change" data provided by what are variously termed "shadow prices", "dual values", and "Lagrange multipliers". However, as @odow says, there is a bigger picture, since some users want full sensitivity analysis that includes values for "how far can this cost/bound value change and the basis remain optimal". These are provided by what Gurobi calls "sensitivity information". I don't like this term, preferring to call them "range values", as Xpress does |
Indeed, I meant to comment. @odow 's approach to use the sign of the dual to identify whether a (boxed) variable is at its lower or upper bound is unreliable. When (near) dual degenerate, duals will have (near) zero values which, if nonzero and less than the dual feasibility tolerance in magnitude, may be positive or negative for a variable at either bound. |
Re: ranging information - great! We'll want to include that in |
Okay, I think since all the other statuses deal with basic columns, I think this issue can be closed. Thanks all! |
No HighsBasisStatus::ZERO relates to free variables that are nonbasic. They have primal value of zero and should have zero dual. Note that I have decided to negate the row duals so that they are mathematically correct, and consistent with Gurobi. They were negated before for historical compatibility. This won't happen until the first formal release. Naturally I will let you know when his happens. |
@jajhall
We are currently working on including sensitivity analysis for HiGHS' results in SciPy (see mckib2/scipy#10 for the working PR).
The plan right now is to mimic the MATLAB style "lambda" result object that has the Lagrange multipliers for the inequality, equality, and bound constraints. Here's a quick sketch of what I'm doing to get this information (not intended to be running code):
The question is if this correctly extracts the Lagrange multipliers (in variables
lambda
,lower
, andupper
) and if there is other interesting information that the user might want to have? The thing that makes me nervous is that onlyUPPER
andLOWER
HighsBasisStatus
es are considered, all the others are essentially thrown away.Additionally, we'd be curious to know if you have any opinions about what to call this result. MATLAB names the results struct "lambda", but we can't do that in Python because
lambda
is a reserved keyword. Instead we are calling it "sensitivity". Other places refer to these results as "duals" , "shadow prices", or "Lagrange multipliers", but "sensitivity" seemed like the best choice to us.The text was updated successfully, but these errors were encountered: