MindtPy solver¶
The MixedInteger Nonlinear Decomposition Toolbox in Pyomo (MindtPy) solver allows users to solve MixedInteger Nonlinear Programs (MINLP) using decomposition algorithms. These decomposition algorithms usually rely on the solution of MixedIntger Linear Programs (MILP) and Nonlinear Programs (NLP).
MindtPy currently implements the Outer Approximation (OA) algorithm originally described in Duran & Grossmann, 1986 and the Extended Cutting Plane (ECP) algorithm originally described in Westerlund & Petterson, 1995. Usage and implementation details for MindtPy can be found in the PSE 2018 paper Bernal et al., (ref, preprint).
Usage of MindtPy to solve a Pyomo concrete model involves:
>>> SolverFactory('mindtpy').solve(model)
An example which includes the modeling approach may be found below.
Required imports
>>> from pyomo.environ import *
Create a simple model
>>> model = ConcreteModel()
>>> model.x = Var(bounds=(1.0,10.0),initialize=5.0)
>>> model.y = Var(within=Binary)
>>> model.c1 = Constraint(expr=(model.x4.0)**2  model.x <= 50.0*(1model.y))
>>> model.c2 = Constraint(expr=model.x*log(model.x)+5.0 <= 50.0*(model.y))
>>> model.objective = Objective(expr=model.x, sense=minimize)
Solve the model using MindtPy
>>> SolverFactory('mindtpy').solve(model, mip_solver='glpk', nlp_solver='ipopt')
The solution may then be displayed by using the commands
>>> model.objective.display()
>>> model.display()
>>> model.pprint()
Note
When troubleshooting, it can often be helpful to turn on verbose
output using the tee
flag.
>>> SolverFactory('mindtpy').solve(model, mip_solver='glpk', nlp_solver='ipopt', tee=True)
MindtPy also supports setting options for mip solver and nlp solver.
>>> SolverFactory('mindtpy').solve(model,
strategy='OA',
time_limit=3600,
mip_solver='gams',
mip_solver_args=dict(solver='cplex', warmstart=True),
nlp_solver='ipopt',
tee=True)
There are three initialization strategies in MindtPy: rNLP, initial_binary, max_binary. In OA and GOA strategies, the default initialization strategy is rNLP. In ECP strategy, the default initialization strategy is max_binary.
Single tree implementation¶
MindtPy also supports single tree implementation of Outer Approximation (OA) algorithm, which is known as LP/NLP algorithm originally described in Quesada & Grossmann. The LP/NLP algorithm in MindtPy is implemeted based on the LazyCallback function in commercial solvers.
Note
The single tree implementation currently only works with CPLEX. To use LazyCallback function of CPLEX from Pyomo, the CPLEX Python API is required. This means both IBM ILOG CPLEX Optimization Studio and the CPLEXPython modules should be installed on your computer.
A usage example for single tree is as follows:
>>> import pyomo.environ as pyo
>>> model = pyo.ConcreteModel()
>>> model.x = pyo.Var(bounds=(1.0, 10.0), initialize=5.0)
>>> model.y = pyo.Var(within=Binary)
>>> model.c1 = Constraint(expr=(model.x4.0)**2  model.x <= 50.0*(1model.y))
>>> model.c2 = pyo.Constraint(expr=model.x*log(model.x)+5.0 <= 50.0*(model.y))
>>> model.objective = pyo.Objective(expr=model.x, sense=pyo.minimize)
Solve the model using single tree implementation in MindtPy
>>> pyo.SolverFactory('mindtpy').solve(
... model, strategy='OA',
... mip_solver='cplex_persistent', nlp_solver='ipopt', single_tree=True)
>>> model.objective.display()
MindtPy implementation and optional arguments¶
Warning
MindtPy optional arguments should be considered beta code and are subject to change.

class
pyomo.contrib.mindtpy.MindtPy.
MindtPySolver
[source]¶ A decompositionbased MINLP solver.

available
(exception_flag=True)[source]¶ Check if solver is available. TODO: For now, it is always available. However, subsolvers may not always be available, and so this should reflect that possibility.

solve
(model, **kwds)[source]¶ Solve the model. Warning: this solver is still in beta. Keyword arguments subject to change. Undocumented keyword arguments definitely subject to change. Warning: at this point in time, if you try to use PSC or GBD with anything other than IPOPT as the NLP solver, bad things will happen. This is because the suffixes are not in place to extract dual values from the variable bounds for any other solver. TODO: fix needed with the GBD implementation. :param model: a Pyomo model or block to be solved :type model: Block
