I am struggling with solving a MIP model formulated using Pyomo within a Python program. For some sets of problem parameters, CPLEX, HiGHS, and SCIP are sometimes failing to solve the problem and instead declare it to be infeasible. In this problem it is easy to come up with a non-optimal initial feasible point, but I have not been able to make use of such an initial point because I have not yet figured out how to initialize the auxiliary variables used in the Piecewise linear constraints.

Is there any API for initializing auxiliary variables in Piecewise components in pyomo.environ models?

  • $\begingroup$ If the solver says the problem is infeasible (as opposed to hitting a time limit before finding a first feasible solution), setting an initial solution likely will not help -- the solver will probably reject it. You should explore finding an irreducible infeasible subset (IIS) of the constraints and variable bounds, and then figure out which of those constraints/bounds is in error (say, by plugging in a known feasible solution). $\endgroup$
    – prubin
    May 14 at 20:14
  • $\begingroup$ @prubin Thanks for the suggestion. In this project, I have definitely gone some rounds tracking down true infeasibilities. In this case (now that those are worked out as far as I can tell), when a known feasible solution is plugged in for a warm start (for the solvers that can take an initial candidate solution), the exact same formulation goes from being "infeasible" to quickly being solved to optimality. I believe it is a numerical issue causing the solvers to declare it infeasible at the presolve stage even though I believe the problem is not actually infeasible. $\endgroup$
    – pdb5627
    May 15 at 16:03
  • $\begingroup$ Sometimes setting an option asking CPLEX to skip the pre-solve also leads to solving the problem successfully, albeit much slower. Sometimes CPLEX running the same problem on different hardware (an old laptop rather than HPC) also results in solving to optimality. These lead me to believe it is a numerical issue rather than conflicting constraints. $\endgroup$
    – pdb5627
    May 15 at 16:04
  • $\begingroup$ I agree that it sounds like a numerical issue. If you can find a more stable reformulation, that would probably be best. If not, hopefully someone familiar with Pyomo (I'm not) can help you set the starting solution. $\endgroup$
    – prubin
    May 15 at 16:21
  • $\begingroup$ Make the model elastic (use soft constraints) to have more control on this. $\endgroup$ May 15 at 17:49


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.