Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Cplex presolve

    Posted 10/15/12 04:06 PM

    Originally posted by: Bogdan_Tanasa


    Hi guys,

    Is there any way to retrieve the A matrix after calling presolve. I would like to compare it with the initial matrix and see how big the differences are but I couldn't find any method for this task.

    Thanks,
    Bogdan.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cplex presolve

    Posted 10/15/12 05:46 PM

    Originally posted by: SystemAdmin


    This can only be done in the C API or the interactive optimizer. In the C API use function CPXgetredlp to obtain the presolved problem.
    In the interactive use something like this:
    CPLEX> read problem.sav
    CPLEX> write presolved.pre
    CPLEX> read presolved.pre
    

    After this sequence of commands the problem loaded into the interactive is the presolved problem. You can save it to a file or inspect in the interactive.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Cplex presolve

    Posted 10/16/12 01:41 AM

    Originally posted by: Bogdan_Tanasa


    Thanks,

    How it can be done in the interactive optimizer?

    Bogdan,
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Cplex presolve

    Posted 10/16/12 04:40 AM

    Originally posted by: SystemAdmin


    But Daniel already explained it. Assuming that you have specified your problem as a file called "yourproblem.lp", you would launch the interactive CPLEX and enter:
    read yourproblem.lp
    write presolved.pre
    read presolved.pre
    write presolved.lp
    

    This yields a file called "presolved.lp", which you can look at in your favorite text viewer/editor and compare it to "yourproblem.lp".
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Cplex presolve

    Posted 10/16/12 06:28 AM

    Originally posted by: Bogdan_Tanasa


    Ah, ... I was thinking in the OPL IDE.

    Thanks,
    Bogdan.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Cplex presolve

    Posted 10/16/12 01:03 PM

    Originally posted by: SystemAdmin


    Sorry, there is no way of getting an OPL model of the presolved problem.

    When OPL invokes CPLEX, it constructs a flat model (i.e., unrolls the forall statements and so on). This flat CPLEX model is then subject to presolve. To get back a useful OPL model from the presolved problem would mean that you have to recover the structure and turn the flat set of constraints back to nested forall statements and the like. This is not implemented, and in some cases I doubt that this would be possible.

    Of course, it would be possible to just get a flat model in OPL (without any forall or other advanced language constructs), but this would not be very useful. Looking at the LP file yields basically the same.
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization