-
Notifications
You must be signed in to change notification settings - Fork 604
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
Provide API to compute Lagrange multipliers #405
Comments
No, the C API doesn't provide this. Note that, given a local optimum (i.e. the NLopt result), you can easily compute Lagrange multipliers simply by solving a small least-squares problem. See e.g. https://discourse.julialang.org/t/lagrangian-function/38287/19?u=stevengj |
@stevengj Thank you for your answer! When you mentioned local optimum, does the type of solver relevant here? Can it be a local optimum found by solvers (say MMA) other than the AUGLAG solver? |
The type of solver doesn't matter. For any solver that returns a local optimum, the KKT equations tell you how to compute Lagrange multipliers. |
I've renamed this issue and marked it as an "enhancement", as it would be nice to have a built-in API for this. |
@stevengj I have a quick question on lagrangian optimisation and hope you could share some insights. Let's say we have a maximisation problem with one inequality constraint. Instead of solving it as a constraint problem, is there any problem of solving this as a non-constraint problem (i.e. max objective_function + lambda * constraint_function)? We solve this multiple times with different lambda values and at the end pick a lambda that suits our needs? The reason I asked this is because solving a non-constraint problem is usually much faster than a constraint problem. |
I am using the package mainly via python API, I am wondering if there is a way I could get the Lagrangian multiplier from the
auglag()
.The text was updated successfully, but these errors were encountered: