Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Cplex.SolveFixed() for OPL Script ?

    Posted 10/19/16 08:07 AM

    Originally posted by: ouaigooo


    Hi,

    Is there an equivalent of Cplex.SolveFixed() for OPL Script ?

    I'm looking for dual costs of a MILP.

    So I'd like to

    1) solve it to get the solution.

    2) solve the corresponding LP with fixed integer variables

    3) get dual costs

    Thanks for your help !


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Cplex.SolveFixed() for OPL Script ?



  • 3.  Re: Cplex.SolveFixed() for OPL Script ?

    Posted 10/20/16 01:49 AM

    Originally posted by: ouaigooo


    Hi Alex,

    50% ;)

    I don't know in advance the names and dimensions of the integer variables in my "slave" model.

    (the "master" model with the main fct is intented to work with several types of "slave" models).

    So it would be ok if there exists some kind of model.getAllIntVars() fct. But I don't think it is the case.

    A pity that this solveFixed() is available in Concert Technology but not in OPL Script...

    Regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Cplex.SolveFixed() for OPL Script ?

    Posted 10/21/16 05:14 AM

    Hi,

    so why

    dvar int x in 0..10;
     
     
    minimize x;
    subject to {
      ct :   
        x >= 1/2;
    }
     
    main {
      var status = 0;
      thisOplModel.generate();
      if (cplex.solve()) {
        writeln("Integer Model");   
        writeln("OBJECTIVE: ",cplex.getObjValue());   
        writeln("dual CT:",thisOplModel.ct.dual);
      }
     
      thisOplModel.convertAllIntVars();
      if (cplex.solve()) {
        writeln("Relaxed Model");   
        writeln("OBJECTIVE: ",cplex.getObjValue());  
        writeln("dual CT:",thisOplModel.ct.dual);
      }
     
    }

    would not fit ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Cplex.SolveFixed() for OPL Script ?

    Posted 10/22/16 05:05 AM

    Originally posted by: ouaigooo


    No, because I want to get the dual costs at the MILP solution.

    Here you calculate dual costs at the LP-relaxed solution.

    We need

    1) to fix all integer vars to their value in the MILP solution

    2) solve the LP-relaxed

    As mentionned previously, I seek a generic method to do that (without writing variable names explicitely, since they are unknown beforehand). Like Cplex.solveFixed() ...

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Cplex.SolveFixed() for OPL Script ?

    Posted 10/22/16 09:06 AM

    Hi,

    then you may either use an external java call or log an RFE : https://twitter.com/AlexFleischer1/status/677761826352963584

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: Cplex.SolveFixed() for OPL Script ?

    Posted 10/23/16 07:17 AM

    Originally posted by: ouaigooo


    external java call do not work on our server (see one of the many PRM we've already submitted)

    I've submitted an RFE. Hope it get more success than the previous ones ...

    regards
     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: Cplex.SolveFixed() for OPL Script ?

    Posted 10/24/16 02:45 AM

    Hi,

    about external calls not working on your server : do you run a linux server ? Then you could try to run oplrunjava instead. See http://www.ibm.com/support/knowledgecenter/SSSA5P_12.3.0/ilog.odms.ide.help/Content/Optimization/Documentation/Optimization_Studio/_pubskel/ps_opl_Language737.html

    What you could also try is modify the oplrunsample.cpp example in C:\ILOG\CPLEX_Studio1263\opl\examples\opl_interfaces\cpp\src so that this calls solveFixed.

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer