Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Size of Cplex Model

    Posted 09/08/14 02:11 PM

    Originally posted by: Nodame


    I am calling Cplex from C# to solve an LP Optimization problem. The problem I have is that it takes too long for the solver to find a solution.

    I am thinking that maybe my problem is too large. I would like to know how large the problem is (Number of variables and total number of constraints).

     

    I know I can have an idea of what the problem looks like by using:

    cplex.ExportModel("MYmodel.lp"); 

     

    However, when I open the file MYModel.lp (using Notepad for instance), it seems like some of the constraints are omitted, and I don't see a way to know the exact number of variables and constraints.

     

    My question is, is there an easy way to have these information: for instance a report that says:

    Number of variables = blah

    number of Constraints = blah2


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Size of Cplex Model

    Posted 09/08/14 04:28 PM

    Originally posted by: T_O


    Hmm, I'm not an expert for all the APIs, but why not export the model as sav-file and read it into the interactive optimizer? Then dis prob stat should give you enough information.

    Just out of curiosity: Is it LP or MIP?

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Size of Cplex Model

    Posted 09/08/14 05:03 PM

    Originally posted by: Nodame


    Thanks for your answer T_O. I am not sure but it is my understanding that a .sav file can be opened using SPSS software. i don't have SPSS installed on my computer. I created the 'MYModel.sav' file. When I try opening it using Visual studio, it appears there is no readable information.

    How do I open this file using the 'interactive optimizer'? Is it an IBM feature that uses the OPL Language? I guess I haven't used this feature yet and I am not sure how to go about it. I am calling Cplex from C#.

    My model is supposed to be a MIP .


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Size of Cplex Model

    Posted 09/08/14 05:10 PM

    Originally posted by: T_O


    Typically, just open a command prompt in the folder where your .sav-file is. Then start CPLEX by entering cplex

    In CPLEX type

    r MYModel.sav
    dis prob stat

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Size of Cplex Model

    Posted 09/15/14 09:52 AM

    It may help to look at the reference documentation. The Cplex class has properties Ncols and Nrows that give the number of columns (variables) and rows (constraints) in the extracted model.


    #CPLEXOptimizers
    #DecisionOptimization