coin-or / SHOT

A solver for mixed-integer nonlinear optimization problems
https://shotsolver.dev
Eclipse Public License 2.0
117 stars 25 forks source link

Constant Objective Function Cause ASL Error #145

Closed chemrgineer closed 2 years ago

chemrgineer commented 2 years ago

Hi, I have a problem with SHOT. I created sample code for generation of this error:

from pyomo.environ import m = ConcreteModel() m.x = Var(bounds=(-5, 5)) m.y = Var(bounds=(-5, 5)) m.cons1 = Constraint(expr=2 m.x+3 * m.y<=3) m.cons2 = Constraint(expr=m.x-m.y==1) m.obj = Objective(expr=1) solver = SolverFactory("SHOT") results = solver.solve(m, tee=True)

When I run with constant objective, I get:

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland. See documentation for full list of contributors and utilized software libraries.

Version: 1.1. Git hash: 62f31ee7. Released: Jan 13 2022.

For more information visit https://shotsolver.dev

╶ Modeling system ────────────────────────────────────────────────────────────────────────────────────────────────────╴

Modeling system: AMPL Problem read from file: /tmp/tmp0rm5p_ub.pyomo.nl

ERROR: Solver (asl) returned non-zero return code (-11) ERROR: See the solver log above for diagnostic information.

Same problem can be solved IPOPT without any problem.

andreaslundell commented 2 years ago

Hi, thanks for noticing this.

This should be fixed in https://github.com/coin-or/SHOT/commit/464047791aade788ec32e0f0282380f931d709a5.

Can you verify?

andreaslundell commented 2 years ago

Hi, thanks for noticing this.

This should be fixed in 4640477.

Can you verify?

This introduced another bug. This should work https://github.com/coin-or/SHOT/commit/ff7fd68484c70382aaaf5d371e0d61b1131d4b9f.

chemrgineer commented 2 years ago

Hi, thanks for noticing this.

This should be fixed in 4640477.

Can you verify?

Hi, Its working with both versions. I had no error with 4640477. Thank you for your attention such a short time.