Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  initial Relaxation

    Posted 07/01/08 03:00 PM

    Originally posted by: SystemAdmin


    [rewers said:]

    Hello,

    I am quite new to CPLEX. I would like to add some special kind of cuts to the problem that I'd like to solve. Therefore I need an initial relaxation of the problem to calculate these cuts. Is it somehow possible to get this relaxation without callbacks? In another thread somebody mentioned that I could just set the amount of iterations in the branch and cut to 0 to get only the root relaxation. Is this really the only possibility?

    thanks in advance,
    rewers
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: initial Relaxation

    Posted 07/01/08 07:35 PM

    Originally posted by: SystemAdmin


    [leo said:]

    [quote author=rewers link=topic=374.msg1063#msg1063 date=1214906398]
    Hello,

    I am quite new to CPLEX. I would like to add some special kind of cuts to the problem that I'd like to solve. Therefore I need an initial relaxation of the problem to calculate these cuts. Is it somehow possible to get this relaxation without callbacks? In another thread somebody mentioned that I could just set the amount of iterations in the branch and cut to 0 to get only the root relaxation. Is this really the only possibility?

    thanks in advance,
    rewers


    Do you mean that you want a LP solution? The most easy way is to solve the relaxation LP separately and you can get the solution.

    Another way is to clone the model to a clonelp and change the model type. You can solve clonelp and get the solution. Based on thes solution, you can produce your own cuts.

    Leo
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: initial Relaxation

    Posted 07/01/08 08:32 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    If you are using Concert, you can add an IloConversion object that relaxes your integer variables to floats, solve the model (which is now an LP), then remove the conversion to get back to the original problem.  If you have more than one integer variable (or more than one array of integer variables), you'll have to add multiple conversions.  For instance (using Java, and skipping the throw/catch stuff):

    IloCplex myModel = new IloCplex();
    IloIntVar[] x = myModel.intVarArray(...);  // general integer variables
    IloBoolVar[] y = myModel.boolVarArray(...);  // binary variables
    IloNumVar[] z = myModel.numVarArray(...);  // real variables
    // build the model
    IloConversion xconv = myModel.conversion(x, IloNumVarType.Float);  // relax the general integers
    IloConversion yconv = myModel.conversion(y, IloNumVarType.Float);  // and the binaries
    myModel.add(xconv);
    myModel.add(yconv);
    myModel.solve();  // solving the LP relaxation
    // get the solution and do perverse things with it
    myModel.remove(xconv);  // unrelax the model
    myModel.remove(yconv);

    Note that you need to hang onto the conversion objects (by assigning them to variables) so that you can zap them when you're through with the LP relaxation.

    In <shudder>C++</shudder>, I think you would use the IloConversion's end() method to get rid of it, although I suspect the remove method would also work.

    /Paul
    #CPLEXOptimizers
    #DecisionOptimization