-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bug for Dualization of Maximization Problems #142
Comments
Just to clarify, the problem is the sign switch on the dual value? The objective values coincide. @blegat is the authority on what our dual conventions are, so I don't know whether this was intentional or not. julia> solution_summary(MaxModel; verbose = true)
* Solver : Ipopt
* Status
Termination status : LOCALLY_SOLVED
Primal status : FEASIBLE_POINT
Dual status : FEASIBLE_POINT
Result count : 1
Has duals : true
Message from the solver:
"Solve_Succeeded"
* Candidate solution
Objective value : 2.50000e-01
Dual objective value : 0.00000e+00
Primal solution :
Q : 5.00000e-01
Dual solution :
C : 5.02681e-09
* Work counters
Solve time (sec) : 4.70781e-03
julia> solution_summary(DualMaxModel; verbose = true)
* Solver : Ipopt
* Status
Termination status : LOCALLY_SOLVED
Primal status : FEASIBLE_POINT
Dual status : FEASIBLE_POINT
Result count : 1
Has duals : true
Message from the solver:
"Solve_Succeeded"
* Candidate solution
Objective value : 2.50000e-01
Dual objective value : 5.00000e-01
Primal solution :
dualC_1 : -4.97293e-09
quadslack_Q : -5.00000e-01
Dual solution :
Q : -5.00000e-01
* Work counters
Solve time (sec) : 2.80129e-01 julia> solution_summary(MinModel; verbose = true)
* Solver : Ipopt
* Status
Termination status : LOCALLY_SOLVED
Primal status : FEASIBLE_POINT
Dual status : FEASIBLE_POINT
Result count : 1
Has duals : true
Message from the solver:
"Solve_Succeeded"
* Candidate solution
Objective value : -2.50000e-01
Dual objective value : 0.00000e+00
Primal solution :
Q : 5.00000e-01
Dual solution :
C : 5.02681e-09
* Work counters
Solve time (sec) : 7.67708e-03
julia> solution_summary(DualMinModel; verbose = true)
* Solver : Ipopt
* Status
Termination status : LOCALLY_SOLVED
Primal status : FEASIBLE_POINT
Dual status : FEASIBLE_POINT
Result count : 1
Has duals : true
Message from the solver:
"Solve_Succeeded"
* Candidate solution
Objective value : -2.50000e-01
Dual objective value : -5.00000e-01
Primal solution :
dualC_1 : -4.97293e-09
quadslack_Q : 5.00000e-01
Dual solution :
Q : -5.00000e-01
* Work counters
Solve time (sec) : 6.70195e-03 |
IMO, the sign flip between quadslack_Q and Q was the problem, there are two reasons why:
The second reason is what initially caused me to say "the DualMaxModel cannot be correct". However, I later realized that this may be a convention/definition thing and I might be completely wrong :D |
You might be correct. We don't have the Max dualization written for quadratic programs: Note that the sign in front of |
This is the first part (theory): #149 So, for simply dualization, the sign change of quadslack's is irrelevant, however that makes a difference in KKT conditions. |
In my understanding (coming from a Lagrangian duality definition), dual constraints are used to make the minimum/infimum (or vice versa for maximization) over primal variables in the Lagrange dual function explicit. This implies that the dual constraint above should be stationarity of the Lagrangean over primal variables. |
We might be talking about the same thing. |
Ah yes, that was a misunderstanding :D |
About fixes: I remember from checking earlier that there is a lot of sign flipping going on. Would this be a good point to take a look at that as well? |
Fantastic. Now we can fix. |
I guess this is the same as #70 and linked issues. |
Feeling too inexperienced to take a look at all of the other sign flipping, but I do have a quick fix for this: #150. |
Thanks for the fix @LukasBarner ! |
I think this might be a general thing, please see the example below:
The DualMaxModel cannot be correct; the problem also persists for other settings...
This issue came up when checking for the reason behind joaquimg/BilevelJuMP.jl#182
The text was updated successfully, but these errors were encountered: