The Mixed-Integer Nonlinear Decomposition Toolbox in Pyomo (MindtPy) solver allows users to solve Mixed-Integer Nonlinear Programs (MINLP) using decomposition algorithms. These decomposition algorithms usually rely on the solution of Mixed-Intger 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:
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.x-4.0)**2 - model.x <= 50.0*(1-model.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()
When troubleshooting, it can often be helpful to turn on verbose
output using the
>>> 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.
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 CPLEX-Python 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.x-4.0)**2 - model.x <= 50.0*(1-model.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¶
MindtPy optional arguments should be considered beta code and are subject to change.
A decomposition-based MINLP solver.
Check if solver is available. TODO: For now, it is always available. However, sub-solvers may not always be available, and so this should reflect that possibility.
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
Return a 3-tuple describing the solver version.