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

Custom Linear relaxations for feasibility pump #254

Open
this-josh opened this issue Nov 3, 2022 · 2 comments
Open

Custom Linear relaxations for feasibility pump #254

this-josh opened this issue Nov 3, 2022 · 2 comments

Comments

@this-josh
Copy link

I have a non-linear program

juniper_opt = optimizer_with_attributes(Juniper.Optimizer, "nl_solver" => Ipopt.Optimizer, "mip_solver" => Gurobi.Optimizer)
model = Model(juniper_opt)
@variable(model, a)
@NLconstraint(model, a * abs(a) >=3)
@objective(model, Min, a)
optimize!(model)

Now when Juniper creates a MILP to do the feasibility pump it's my understanding it uses everything but the non-linear constraints. In my instance I have a linear relaxation of the non-linear constraints. So I've made it so that Juniper can accept an mip model for the feasibility pump.

mip = Model(juniper_opt)
@variable(mip, a)
@constraint(mip, a * a >=3)
@objective(mip, Min, a)
set_optimizer_attribute(model, "mip_model", mip)

optimize!(model)

Essentially all that changes is in the fpump code I pass the mip model, perhaps there's more that could be done. For my use case this is helpful as my linear relaxation won't remove any valid solutions and it can quickly show a lot to be infeasible.

Is this code of interest? If so, I can open a PR.

@Wikunia
Copy link
Member

Wikunia commented Nov 3, 2022

Yes that would be a nice addition. It currently removes all non linear constraints and changes the objective such that it minimizes the difference to the NLP relaxation.
Looking forward to your PR 😊

@this-josh
Copy link
Author

After reviewing my current implementation I think I need to better understand MOI before I can do a good job of this. For now I'll have to put this on pause, but it is still on my lists of things to do.

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

No branches or pull requests

2 participants