Skip to main content

infeasible model om gurobi python while it is feasible on AMPL

Awaiting user input

Comments

2 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Eli Towle
    Gurobi Staff Gurobi Staff

    The model you posted is infeasible. If we compute an irreducible inconsistent subsystem (IIS), we obtain the following three constraints:

    $$\begin{alignat*}{2}u_1 - u_2 &\leq -1 \qquad &&(\texttt{fifth1,2}) \\ -u_1 + u_{36} &\leq -1 &&(\texttt{fifth36,1}) \\ u_2 - u_{36} &\leq -1 &&(\texttt{fifth2,36})\end{alignat*}$$

    All solutions to the problem satisfy the inequalities \( \texttt{fifth1,2} \), \( \texttt{fifth36,1} \), and \( \texttt{fifth2,36} \). Therefore, all solutions will also satisfy an aggregation of these three inequalities:

    $$\begin{align*}(u_1 - u_2) + (-u_1 + u_{36}) + (u_2 - u_{36}) &\leq (-1) + (-1) + (-1) \\ 0 &\leq -3.\end{align*}$$

    This constraint is not satisfied by any solution, so the model is infeasible.

    Can you double-check that your AMPL implementation exactly matches the Python implementation? Although I'm not convinced it's relevant, note that variables added to a Python Model with Model.addVar() or Model.addVars() have a lower bound of \( 0 \) by default.

    0

Post is closed for comments.