Decision Optimization

Decision Optimization

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

 View Only
  • 1.  How to save the MIP obtained from CPLEX presolve?

    Posted Thu November 12, 2009 09:17 AM

    Originally posted by: SystemAdmin


    [ilovetoyota said:]

    Is there anyway in CPLEX Callable library to call the CPLEX presolve, and save the reduced MIP formulation obtained from CPLEX presolve? (say to a file?)
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How to save the MIP obtained from CPLEX presolve?

    Posted Thu November 12, 2009 10:13 AM

    Originally posted by: SystemAdmin


    [DanielJunglas said:]

    Yes, there is:

    CPXCLPptr presolved;

    CPXpresolve(env, lp, ...);
    CPXgetredlp(env, lp, &presolved);
    CPXwriteprob(env, presolved, ...);

    Beware of two things:
    [list]
    [li]If CPLEX solves the problem during presolve then CPXgetredlp() will return NULL[/li]
    [li]The model returned by CPXgetredlp() must/cannot be modified. If you want to modify that problem then you first have to do a CPXcloneprob().[/li]
    [/list]
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: How to save the MIP obtained from CPLEX presolve?

    Posted Thu November 12, 2009 10:16 AM

    Originally posted by: SystemAdmin


    [DanielJunglas said:]

    Another way would be to call CPXpreslvwrite() but the output of this is binary.
    See the documentation of that function.

    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: How to save the MIP obtained from CPLEX presolve?

    Posted Mon November 16, 2009 02:56 PM

    Originally posted by: SystemAdmin


    [achterberg said:]

    [quote author=dju link=topic=1459.msg4134#msg4134 date=1258010172]
    Another way would be to call CPXpreslvwrite() but the output of this is binary.
    See the documentation of that function.

    The standard trick is to call CPXpreslvwrite(), then read in the problem and call CPXwriteprob() with your favorite file format.

    In the interactive, you would do:

    read myproblem.lp
    write presolved.pre
    read presolved.pre
    write presolved.lp


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: How to save the MIP obtained from CPLEX presolve?

    Posted Thu March 13, 2014 10:55 AM

    Originally posted by: hllsen


    I know that concert technology does not have this kind of function. Is there any other way to obtain this [presolved/reduced] MIP information in the C++ API?
    Thank you!


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: How to save the MIP obtained from CPLEX presolve?

    Posted Mon March 17, 2014 02:36 AM

    No. Access to the presolved model is just not available in Concert. In some callbacks you can figure out which variables were removed/fixed by presolve but that is as close as you can get.

    You could of course write out the problem to a SAV file via IloCplex::exportModel(), load this into the callable library or the interactive, write out the presolved model from there and load it back into another IloCplex instance. However, it may become difficult to map back the information in this model to the original model.


    #CPLEXOptimizers
    #DecisionOptimization