Skip to content
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

KKT conditions using Dualization #61

Open
matbesancon opened this issue Oct 14, 2019 · 5 comments
Open

KKT conditions using Dualization #61

matbesancon opened this issue Oct 14, 2019 · 5 comments

Comments

@matbesancon
Copy link
Contributor

Specifying KKT conditions of a problem using Dualization could be interesting, we have most of the bricks already in place. Given a primal:

min <c, x>
A x = b
x in K

Yielding a dual:

max <b, y>
A^T y + s = c
s in dual(K)

The KKT can be expressed with primal feasibility, dual feasibility and complementarity. The first two parts can be expressed with standard convex constraints. The last one being less trivial, two options would be:

@odow
Copy link
Member

odow commented Oct 14, 2019

💯 for this.

The last one being less trivial, two options would be:

Vote for Complementarity constraints.

I talked to M. Ferris about this and we're super keen to be able to solve KKT's with PATH.

But we have to be a little careful about how we do the formulation. Take a read of the pitfalls section.

Essentially, we need to make sure to write

[Ax - b; s] in Complements()

instead of

[b - Ax; s] in Complements()

In addition, while it makes sense to convert to the standard form Ax = b before constructing the KKT's, it might be better to keep as much model structure as possible, and derive the KKT's directly from the user's model without normalizing first. This gives PATH more information since otherwise it has s free which is hard.

@matbesancon
Copy link
Contributor Author

In some cases (if you know bounds on your primal and dual expression), rewriting using big Ms & binaries can be a decent option, for which having the two expressions can be easier.

for i in eachindex(kkt_results.complementarity_pairs)
    (primal_expr, dual_expr) = kkt_results.complementarity_pairs[i]
    (Mp, Md) = bounds[i]
    z[i] = @variable(m, Bin)
    @constraint(m, 0 <= primal_expr <= Mp * z[i])
    @constraint(m, 0 <= dual_expr <= Md * (1 - z[i]))
end

@joaquimg
Copy link
Member

Some of it was done in: https://github.com/joaquimg/BilevelJuMP.jl

@matbesancon
Copy link
Contributor Author

Considered handled by #67 or do we leave this open?

@guilhermebodin
Copy link
Collaborator

Don't know if it is interesting to have a function kkt that receives an MOI problem and returns the kkt conditions as MOI constraints with Complements(). For now BilevelJuMP.jl builds the kkt conditions internally, and the way to define the complementarity depends on the mode chosen by the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants