3

I'm trying to solve the following problem in pyomo:

x

For that, I've defined the following model, which I solve with MindtPy:

import pyomo.environ as pyo

model = pyo.ConcreteModel()
model.x = pyo.Var(domain=pyo.NonNegativeIntegers)
model.y = pyo.Var(domain=pyo.Binary)
model.constraint = pyo.Constraint(expr = model.x * model.y <= 10)
model.objective = pyo.Objective(expr = model.x * model.y - model.y, sense = pyo.maximize)
res = pyo.SolverFactory('mindtpy').solve(model)

The solution returned is x=0, y=0, which is obviously suboptimal (x=10, y=1 being the optimal solution). I'm at a loss why the solver fails to give the correct result for such an (apparently) simple problem, so I'm suspecting a mistake somewhere in my model. Any idea of what's going on here?

res traceback below:

{
   "Problem":[
      {
         "Name":"unknown",
         "Lower bound":7.494096406374967e-09,
         "Upper bound":-5.2559467146445e-09,
         "Number of objectives":1,
         "Number of constraints":1,
         "Number of variables":2,
         "Number of binary variables":1,
         "Number of integer variables":1,
         "Number of continuous variables":0,
         "Number of nonzeros":"None",
         "Sense":"maximize",
         "Number of disjunctions":0
      }
   ],
   "Solver":[
      {
         "Name":"MindtPyOA",
         "Status":"ok",
         "Message":"None",
         "User time":0.07270376699943881,
         "System time":"None",
         "Wallclock time":0.07270376699943881,
         "Termination condition":"optimal",
         "Termination message":"None",
         "Timing":Bunch(Call after main solve = 6.144000508356839e-06,
         Call after subproblem solve = 2.660000063769985e-06,
         OA cut generation = 0.0005902640004933346,
         fixed subproblem = 0.01827019400025165,
         initialization = 0.037425839999741584,
         main = 0.005608348999885493,
         main loop = 0.02800907599976199,
         main_timer_start_time = 5267.784403186,
         total = 0.07270376699943881),
         "Iterations":1,
         "Num infeasible nlp subproblem":0,
         "Best solution found time":0.07225401699997747
      }
   ]
}
Seon
  • 3,332
  • 8
  • 27
  • I used Gurobi to solve the problem and the solution is ok (```x=10, y=1, obj=9```). I don't know if this is a ```mindtpy``` bug or maybe the ```mindtpy``` solver does not support this kind of problem. Can you try to openning an issue in Pyomo Github about this problem? I'm interested about it. I will follow this problem. Thank you – pybegginer Oct 24 '21 at 15:39
  • Hadn't tried Gurobi, thanks for the tip! Opened an issue [here](https://github.com/Pyomo/pyomo/issues/2165#issue-1034835531) – Seon Oct 25 '21 at 08:31
  • I don't think MindtPy is a global solver. So this can happen. On the other hand, Gurobi is a global quadratic solver. – Erwin Kalvelagen Nov 04 '21 at 01:43
  • In the [published paper](https://doi.org/10.1016/B978-0-444-64241-7.50144-0) about `Mindtpy` they claim that, in fact, `MIndtpy` is is able to find the global optimum applying the decomposition algorithms cited. `...The methods implemented in this toolbox are designed to find the global optimal solution of convex MINLP problems.... — (Bernal et all, 2018)` – pybegginer Nov 05 '21 at 15:24
  • 3
    " of **convex** MINLP problems". Global solvers are needed for non-convex problems. The poster presented a non-convex problem. – Erwin Kalvelagen Nov 05 '21 at 18:09

1 Answers1

1

Solvers can not guarantee you a global optimum if a problem is non-convex. The optimization problem is convex if: the objective function is convex, the inequality constraints are convex, the equality constraints are linear.

Most of the solvers use "gradient-decent" methods, so if they generate cuts and will go down on the first optimum, then they stop, even if it is a local optimum.

In your case, objective function and constraint have bi-linear term x*y which is non-convex. (You can check the convexity by finding Hessian matrix, which has to be positive semidefinite (or negative in case of concave)). Therefore the global optimum can not be mathematically guaranteed by the solvers.

  • Global solvers are designed to attack non-convex problems. They exist, So "Solvers can not guarantee you a global optimum if a problem is non-convex. " is not correct. Global solvers include Baron, Couenne, Antigone and Gurobi (quadratic only). – Erwin Kalvelagen Nov 10 '21 at 18:38