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

Dual Sign Changes Explanations #431

Closed
andrewrosemberg opened this issue Aug 30, 2024 · 2 comments
Closed

Dual Sign Changes Explanations #431

andrewrosemberg opened this issue Aug 30, 2024 · 2 comments

Comments

@andrewrosemberg
Copy link

andrewrosemberg commented Aug 30, 2024

We are trying to understand the dual sign changes in the Ipopt wrapper.

I.e., How the dual multiplier

_dual_multiplier(model::Optimizer) = model.sense == MOI.MIN_SENSE ? 1.0 : -1.0

is used depending on each constraint / bound type: e.g.,

s = -_dual_multiplier(model)

Can we have some line comments for each case explaining the reasoning?

@odow
Copy link
Member

odow commented Aug 31, 2024

All MOI.AbstractOptimizers implement the same dual convention: https://jump.dev/MathOptInterface.jl/stable/background/duality/

  • The dual of a >= (MOI.GreaterThan / MOI.Nonnegatives) constraint is non-negative, because the dual cone of MOI.Nonnegatives is MOI.Nonnegatives.
  • The dual of a <= (MOI.LessThan / MOI.Nonpositives) constraint is non-positive, because the dual cone of MOI.Nonpositives is MOI.Nonpositives
  • The dual of a == constraint is free, and the sign depends on which "side" of the equality is binding (see two points above)

It has been a while since I needed to remember the details of Ipopt, but from memory, the dual of the constraint rows (.mult_g) had the opposite convention to the variable bounds (.mult_x_L and .mult_x_U)?

I remember it being confusing.

@odow
Copy link
Member

odow commented Sep 1, 2024

Closing because this is not a bug in Ipopt. (But please comment if you have an example of a bug where the above doesn't hold.)

@odow odow closed this as completed Sep 1, 2024
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

2 participants