Logging infeasibility constraints when using MindtPy

565 views
Skip to first unread message

Mateus

unread,
Nov 21, 2021, 12:06:14 PM11/21/21
to Pyomo Forum
Hi,
I am new to Pyomo. I use the MindtPy to solve a MINLP problem. I call the solver as below:

SolverFactory('mindtpy').solve(self.model, mip_solver='glpk', nlp_solver='ipopt', tee=True) During the resolution, I get this output:
INFO: ---Starting MindtPy--- INFO: Original model has 2492 constraints (0 nonlinear) and 0 disjunctions, with 1600 variables, of which 400 are binary, 0 are integer, and 1200 are continuous. INFO: Objective is nonlinear. Moving it to constraint set. INFO: rNLP is the initial strategy being used. INFO: Relaxed NLP: Solve relaxed integrality WARNING: Loading a SolverResults object with a warning status into model.name="network"; - termination condition: infeasible - message from solver: Ipopt 3.11.1\x3a Converged to a locally infeasible point. Problem may be infeasible. INFO: Initial relaxed NLP problem is infeasible. Problem may be infeasible. INFO: ---MindtPy main Iteration 1--- INFO: MIP 1: Solve main problem. WARNING: main MILP was unbounded. Resolving with arbitrary bound values of (-1e+15, 1e+15) on the objective. You can change this bound with the option obj_bound.

To get the infeasible constraints, I tried using the following:
from pyomo.util.infeasible import log_infeasible_constraints
print(log_infeasible_constraints(self.model))

but the log_infeasible_constraints function returns 'None'.

Is there a MindtPy specific function to print the infeasible constraints? Or any function that logs this information?

Many thanks in advance!
Mateus

berna...@gmail.com

unread,
Nov 21, 2021, 1:18:59 PM11/21/21
to Pyomo Forum
Mateus,
hi.
I think that your problem might be easier to understand if you consider that the constraints of your problem are entirely linear. In this case, verifying infeasibility is easier than considering an MINLP problem. 
I would suggest you replace the current objective with a linear one (it could even be trivial as being a constant) and solve the resulting MILP problem.
What currently happens is that the problem that you are solving first relaxes the discrete conditions on the binary variables and tries to solve it with an NLP solver (IPOPT) which results in infeasibility.
The causes of this issue might be:
1. The constraint set is indeed infeasible, to which changing the objective function will not make any difference and you will be able to use MILP solvers with guarantees on infeasibility (in that case the discrete relaxed problem is going to be an LP).
2. IPOPT is unable to converge to a feasible solution given the initialization, to which you could provide the solution of the problem without any objective as a feasible initial point to IPOPT within MindtPy.
You seem to be incapable of printing the infeasible constraints because MindtPy keeps iterating and is able to find a feasible point. If you want to log the infeasible constraints of the relaxed NLP problem, reduce the total number of iterations of MindtPy for it to stop right after solving the relaxed NLP.
Cheers,
David

Mateus

unread,
Nov 21, 2021, 1:38:54 PM11/21/21
to Pyomo Forum
Thanks for your reply David.

Actually the MINLP resolution output I pasted before was meant to be infeasible, the solvers are working as expected. Sorry I wasn't clear before, but I am interested in showing the user the reason why the problem is infeasible, as a way of studying the model constraints.

You suggested a way of logging the infeasible constraints by reducing MindtPy number of iterations. Since I don't have much experience with Pyomo, how exactly can I do this?

Best regards,
Mateus
Reply all
Reply to author
Forward
0 new messages