Decision Optimization

 View Only
  • 1.  getCplexStatus=3 when run via CPLEX Optimization Studio

    Posted Wed April 29, 2020 02:27 AM

    Hi All,


    I have issue when try to import model (.lp file) and run configuration. The CPLEX cannot solve the problem. So, there is no solution for all of my .lp files.

     getCplexStatus() = 3 which mean model is proved infeasible, right?

    • But when I try to run via Gurobi. It is working normally with solution.
    • Therefore, could anyone please suggest on this issue or give and example of syntax for solve the LP files.

     

    This is my code when run via IBM ILOG CPLEX Optimization Studio or you can see in attached image.

    main {

      cplex.importModel("C:\\Path to LP file\\xxx.lp");

      if (cplex.solve()) {

         writeln("Objective Value = " + cplex.getObjValue());

         writeln("Best Obj Value = " + cplex.getBestObjValue());

         writeln("Solved Time = " + cplex.getSolvedTime());

      } else {

         writeln("No solution");

         writeln("Cplex Status = " + cplex.getCplexStatus());

      }

    }

    Thank you in advance.



    ------------------------------
    Noppawat Samdangdech
    ------------------------------

    #DecisionOptimization


  • 2.  RE: getCplexStatus=3 when run via CPLEX Optimization Studio

    Posted Wed April 29, 2020 04:39 AM
    Ideally, you would attach the LP file so that we can try ourselves.  If you can't you should at least provide the CPLEX log (from the Engine Log tab) in addition to the information that you already provided.  Thanks!

    ------------------------------
    Xavier Nodet
    Program Manager, Development
    CPLEX Optimization Studio
    ------------------------------



  • 3.  RE: getCplexStatus=3 when run via CPLEX Optimization Studio

    Posted Wed April 29, 2020 06:01 AM
    Thank you for feedback!


    The above image is shown in Engine log tab.

    For the LP files, please see attachment.

    Thank you in advance.



    ------------------------------
    Noppawat Samdangdech
    ------------------------------



  • 4.  RE: getCplexStatus=3 when run via CPLEX Optimization Studio

    Posted Wed April 29, 2020 09:33 AM
    This is a new forum and I may be mistaken, but I don't see the LP file attachment. Did you forget to attach the LP file?

    From the log we can see that CPLEX thinks row 'c495' is infeasible. Did you take a close look at that? Did you happen to try turning presolve off?

    ------------------------------
    Ryan Kersh
    ------------------------------



  • 5.  RE: getCplexStatus=3 when run via CPLEX Optimization Studio

    Posted Wed April 29, 2020 10:01 AM
    Sorry, I just attached LP file again. (Previously, I did not compress LP files before uploaded, so the attachment system did not support LP files.)

    and how to turning presolve off?

    ------------------------------
    Noppawat Samdangdech
    ------------------------------



  • 6.  RE: getCplexStatus=3 when run via CPLEX Optimization Studio

    Posted Wed April 29, 2020 10:18 AM
    Edited by System Test Fri January 20, 2023 04:31 PM
    You have this constraint:
    c495: p11_4 + p13_4 + p15_4 + p17_4 + p19_4 + p21_4 + p23_4 + p25_4 + p27_4
    + p29_4 + p31_4 + p33_4 + p35_4 + p37_4 + p39_4 + p41_4 + p43_4 + p45_4
    + p47_4 + p49_4 = 368
    All variables in this constraint are binary. Since there are only 20 variables, there is no way these can sum up to 368. Something is wrong with your model. You have to go back to the code that creates the model and figure out what is wrong there.

    PS: Are you sure these are the models that you were able to solve with another solver? I doubt that other solvers find a solution that satisfies this constraint. That would look like a bug in that solver.

    EDIT: I think I know what is wrong: your LP file format does not satisfy the specification: For defining your integer variables you define a section called "Integer" in your LP file. However, as you can see here  the keyword to define integer variables is "General". If you replace "Integer" in the file by "General" then things work as expected. What your original file does is declaring a new binary variable called "Integer" that is not used anywhere.

    ------------------------------
    Daniel Junglas
    ------------------------------



  • 7.  RE: getCplexStatus=3 when run via CPLEX Optimization Studio

    Posted Thu April 30, 2020 06:49 AM
    Many Thanks!

    CPLEX run as usual after I have changed "Integer" to "Gerneral". 

    This is not detected in Gurobi, so this format (MIP integer variables) is only used for CPLEX, right?

    By the way, I will change "Integer" to "Gerneral" and try to run again on Gurobi to see the output will change or not.

    Thank you in advance.


    ------------------------------
    Noppawat Samdangdech
    ------------------------------



  • 8.  RE: getCplexStatus=3 when run via CPLEX Optimization Studio

    Posted Thu April 30, 2020 08:05 AM
    It seems that different solvers interpret the "Integer" section differently. I checked again and found that actually CPLEX interprets variables as integer variables with default bounds [0,1]. I.e., if you don't give explicit bounds in the "Bounds" section then the bounds for variables in the "Integer" section will be 0 and 1. Other solvers appear to have the same interpretation, see http://lpsolve.sourceforge.net/5.5/Xpress-format.htm
    And from what you report it seems that Gurobi just treats "General" and "Integer" as synonyms. From this research I would say that the "Integer" keyword is best avoided :-)

    ------------------------------
    Daniel Junglas
    ------------------------------



  • 9.  RE: getCplexStatus=3 when run via CPLEX Optimization Studio

    Posted Sun May 03, 2020 11:38 PM
    Thank you for your clear explanation.

    I will continue testing and report the results again if there are any problems.

    This board is really helpful. 

    :)

    ------------------------------
    Noppawat Samdangdech
    ------------------------------