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

Simple Presolver #87

Open
ccoffrin opened this issue Jan 28, 2018 · 4 comments
Open

Simple Presolver #87

ccoffrin opened this issue Jan 28, 2018 · 4 comments

Comments

@ccoffrin
Copy link
Member

See if adding a simple presolver will improve performance.

@ccoffrin ccoffrin added this to the v0.2.0 milestone Jan 28, 2018
@jac0320
Copy link

jac0320 commented Feb 2, 2018

It would be awesome if this can be a presolver API that connects to Juniper (or any other julia-based solvers). @ccoffrin what do you think?

@ccoffrin
Copy link
Member Author

ccoffrin commented Feb 2, 2018

Different solvers will have very different needs for pre-solving, so I am not quite sure if this can be abstracted outside of the specific solvers, but it is worth investigating once more than one solver has a good presolver.

One thing that I know for sure would be valuable to many solvers would be an NLP-specific pre-solver, which does some trivial replacements; for example replacing fixed variables with constant values. These simple changes often improve IPOPTs performance quite a bit.

@Wikunia
Copy link
Member

Wikunia commented Mar 1, 2018

I've tried fixing variables in the root node by using if x < 0.8 and x binary then x = 0 this helps for some blending problems but is actually worse in some cases which I don't understand yet. I'll try to figure it out the next days.

@Wikunia Wikunia removed this from the v0.4.1 milestone Sep 2, 2019
@ccoffrin
Copy link
Member Author

ccoffrin commented Mar 6, 2022

On this topic, a nice example was provided in #156

Removing obviously redundant constraints is needed pre-solve feature.

Example working with Julia v1.7, JuMP v0.23, Juniper v0.9, Ipopt v1.0

using JuMP, Ipopt, HiGHS, Juniper

import LinearAlgebra: dot

m = Model(Juniper.Optimizer)
set_optimizer_attribute(m, "nl_solver", optimizer_with_attributes(Ipopt.Optimizer, "print_level"=>0))
set_optimizer_attribute(m, "mip_solver", optimizer_with_attributes(HiGHS.Optimizer, "output_flag"=>false))

v = [10,20,12,23,42]
w = [12,45,12,22,21]
x = @variable(m, x[1:5], Bin)

@objective(m, Max, dot(v,x))

@constraint(m, sum(w[i]*x[i]^2 for i=1:5) <= 45)

@constraint(m, x[1] + x[2] == 1)

# adding a sufficient number of redundant constraints breaks the solver
for i=1:10
    @constraint(m, x[1] + x[2] == 1)
end

optimize!(m)

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

No branches or pull requests

3 participants