Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Does exitflag = -2 mean no feasible solution exists?

    Posted 05/07/12 03:49 PM

    Originally posted by: PaulBerglund


    I have a fairly large mixed-integer program (about 8000 variables and 6000 constraints). It has many feasible solutions. However when I run CPLEX I get back exitflag -2, which if I understand correctly means that no feasible solution was found. Does exitflag = -2 mean no feasible solution exists, or perhaps that CPLEX gave up because it reached some limit (nodes explored or something) while failing to find a feasible solution. I think this unlikely, because it terminates rather quickly. It is not impossible that the problem as I have handed it to CPLEX is in fact infeasible due to some coding error on my part, but for what it's worth for some instances I do get a solution, and it's one that makes sense.

    Any ideas?

    Paul Berglund
    SUNY University at Buffalo
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Does exitflag = -2 mean no feasible solution exists?

    Posted 05/07/12 05:41 PM

    Originally posted by: EdKlotz


    > PaulBerglund wrote:
    > I have a fairly large mixed-integer program (about 8000 variables and 6000 constraints). It has many feasible solutions. However when I run CPLEX I get back exitflag -2, which if I understand correctly means that no feasible solution was found. Does exitflag = -2 mean no feasible solution exists, or perhaps that CPLEX gave up because it reached some limit (nodes explored or something) while failing to find a feasible solution. I think this unlikely, because it terminates rather quickly. It is not impossible that the problem as I have handed it to CPLEX is in fact infeasible due to some coding error on my part, but for what it's worth for some instances I do get a solution, and it's one that makes sense.
    >
    > Any ideas?
    >
    > Paul Berglund
    > SUNY University at Buffalo

    Based on the context, I presume you are using the cplexmilp() function on the toolkit version of CPLEX's MATLAB Interface. -2 can mean either CPLEX concluded
    the model was infeasible, or it had no feasible solution at the point when a limit was hit. If CPLEX returns quickly and you didn't set any limits, the former is much more likely. Regardless, you can get more precise information than this. First, you can call cplexmilp() so that you get CPLEX's output
    structure back:

    
    [x,fval,exitflag,output] = cplexmilp(...)
    


    The output structure allows you to get more information regarding why CPLEX
    stopped, include

    
    cplexstatus  Status code of the solution cplexstatusstring  Status string of the solution
    


    That should tell you whether CPLEX hit a limit or concluded the model is
    infeasible. Also, the CPLEX node log should appear on the screen in the
    MATLAB IDE, which should also help you determine what happened.

    If you discover that this particular model instances is infeasible, you can
    get an explanation of the infeasibility by running CPLEX's conflict refiner.
    I don't believe this is available through the toolkit API, but if you use CPLEX's
    Class API for matlab, the Cplex.refineConflict() method will do the job. Or, you
    can export the model to a SAV file, then run it in interactive CPLEX to obtain
    the conflict.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Does exitflag = -2 mean no feasible solution exists?

    Posted 05/08/12 02:00 PM

    Originally posted by: PaulBerglund


    You were correct to guess that the problem was infeasible. There was a bug in the code that generated the problem definition which sometimes resulted in an infeasible problem being created.

    Thank you for your help.

    Paul Berglund
    SUNY University at Buffalo
    #CPLEXOptimizers
    #DecisionOptimization