Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Disabling cuts using OPL from command line

    Posted 11/06/11 02:38 PM

    Originally posted by: BCDS_Daniel_Underwood


    I'm using OPL in Linux. I create OPL source code files, then run them using oplrun. How can I disable cuts in my source code file? (All cuts, MIR cuts, flow cuts, Gomory cuts, etc...)
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Disabling cuts using OPL from command line

    Posted 11/06/11 05:48 PM

    Originally posted by: BCDS_Daniel_Underwood


    I see the parameter options that I need to set, for example

    http://publib.boulder.ibm.com/infocenter/cosinfoc/v12r3/index.jsp?topic=%2Filog.odms.cplex.help%2FContent%2FOptimization%2FDocumentation%2FOptimization_Studio%2F_pubskel%2Fps_refparameterscplex2366.html

    is one of them. But in general, I don't know how to set such options in a source code file.

    So does anyone know how to set such parameters in an OPL source code file?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Disabling cuts using OPL from command line

    Posted 11/06/11 05:56 PM

    Originally posted by: BCDS_Daniel_Underwood


    I have read that I can set CPLEX parameters by adding code such as

    execute PARAMS {
      cplex.tilim = 100;
    }
    


    to my source code file. So does this code need to go anywhere in particular in my source code file? (For example, does it need to appear before my math program (model) definition? Or will it work anywhere in the source code?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Disabling cuts using OPL from command line

    Posted 11/07/11 04:17 PM

    Originally posted by: SystemAdmin


    > So does this code need to go anywhere in particular in my source code
    > file? (For example, does it need to appear before my math program
    > (model) definition? Or will it work anywhere in the source code?

    You are correct in using such execute blocks. Given that you need
    to apply these CPLEX settings before the model runs, they should be
    present anywhere before the maximize and subject to blocks in the .mod
    file and are called pre-processing blocks.

    More on these pre/post-processing blocks can be found in the following doc link:

    http://publib.boulder.ibm.com/infocenter/cosinfoc/v12r3/index.jsp?topic=%2Filog.odms.ide.help%2FContent%2FOptimization%2FDocumentation%2FOptimization_Studio%2F_pubskel%2Fps_opl_Language668.html

    > How can I disable cuts in my source code file? (All cuts, MIR cuts,
    > flow cuts, Gomory cuts, etc...)

    The simplest way to disable all the cuts that CPLEX would add by default,
    would be to set the CutsFactor parameter to 1 or less. More about the parameters
    that control cuts can be found in the following doc link:

    http://publib.boulder.ibm.com/infocenter/cosinfoc/v12r3/index.jsp?topic=%2Filog.odms.cplex.help%2FContent%2FOptimization%2FDocumentation%2FOptimization_Studio%2F_pubskel%2Fps_usrmancplex1842.html
    One such .mod file could look like the following:
    
    range r = 1..5; 
    
    int y[i in r] = i; execute
    { cplex.cutsfactor=0; 
    } dvar int+ x[r]; minimize sum(i in r) x[i]; subject to 
    { forall(i in r) x[i] >= y[i]; 
    }
    


    Hope this helps.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Disabling cuts using OPL from command line

    Posted 11/07/11 04:31 PM

    Originally posted by: BCDS_Daniel_Underwood


    Perfect! Thanks a lot :)
    #DecisionOptimization
    #OPLusingCPLEXOptimizer