Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Error setting CPX_PARAM_SUBMIPSUBALG and CPX_PARAM_SUBMIPSTARTALG in C++

    Posted 09/13/18 06:35 AM

    Originally posted by: Jernej1


    Hello,

     

    the tuning tool suggested I should play with the CPX_PARAM_SUBMIPSTARTALG and CPX_PARAM_SUBMIPSUBALG parameters. As you can see from the linked documentation, the respective C++ class members are IloCplex::Param::MIP::Strategy::SubMIPStartAlg and  IloCplex::Param::MIP::Strategy::SubMIPSubAlg . However setting them in C++ as shown in the example below, raises a compilation error.

     

    test.cpp:11:20: error: 'SubMIPStartAlg' is not a member of 'IloCplex::Param::MIP::Strategy'
         cplex.setParam(IloCplex::Param::MIP::Strategy::SubMIPStartAlg, CPX_ALG_PRIMAL);
                        ^
    test.cpp:12:20: error: 'SubMIPSubAlg' is not a member of 'IloCplex::Param::MIP::Strategy'
         cplex.setParam(IloCplex::Param::MIP::Strategy::SubMIPSubAlg, CPX_ALG_PRIMAL);

     

     

     

    I do not get this error if setting any other kind of parameter I tried so far. I am ussing the latest CPLEX version. Any reason why this happens?

     

    #include <ilcplex/ilocplex.h>
    
    int main(int argc, char **argv) {
        
        IloEnv env;
        IloModel model(env);
        IloCplex cplex(model);
    
        cplex.setParam(IloCplex::Param::MIP::Strategy::SubMIPStartAlg, CPX_ALG_PRIMAL);
        cplex.setParam(IloCplex::Param::MIP::Strategy::SubMIPSubAlg, CPX_ALG_PRIMAL);
    
        return 0;
    }
    

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Error setting CPX_PARAM_SUBMIPSUBALG and CPX_PARAM_SUBMIPSTARTALG in C++

    Posted 09/13/18 06:45 AM

    I know this is unrelated to your question but are you sure the tuning tool suggested to play with the 'SUB' algorithms, i.e., the parameters for sub-MIPs? Not with the starting and sub algorithm for the top-level model (these are different parameters).

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Error setting CPX_PARAM_SUBMIPSUBALG and CPX_PARAM_SUBMIPSTARTALG in C++

    Posted 09/13/18 06:54 AM

    Originally posted by: Jernej1


    Yes I am almost  (99%) certain I got these two from the tuning tool. I used it in the interactive optimizer and it printed out a configuration including mip strategy submipstartalg 1. 

     

    Unfortunately I already deleted the log files so I can't confirm 100%.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Error setting CPX_PARAM_SUBMIPSUBALG and CPX_PARAM_SUBMIPSTARTALG in C++

    Posted 09/13/18 06:50 AM

    Sorry, the documentation is wrong. The correct parameter names are

       cplex.setParam(IloCplex::Param::MIP::SubMIP::StartAlg, CPX_ALG_PRIMAL);
       cplex.setParam(IloCplex::Param::MIP::SubMIP::SubAlg, CPX_ALG_PRIMAL);
    

    I will file a bug to get this fixed.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Error setting CPX_PARAM_SUBMIPSUBALG and CPX_PARAM_SUBMIPSTARTALG in C++

    Posted 09/13/18 07:00 AM

    Originally posted by: Jernej1


    Thanks Daniel,

     

    as usual, your help is very much appreciated!


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Error setting CPX_PARAM_SUBMIPSUBALG and CPX_PARAM_SUBMIPSTARTALG in C++

    Posted 09/14/18 06:08 AM

    Originally posted by: Jernej1


    BTW,

     

    it looks like the C++ parameter name for SubMIPScale is also incorrectly documented

     

    https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/SubMIPScale.html


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Error setting CPX_PARAM_SUBMIPSUBALG and CPX_PARAM_SUBMIPSTARTALG in C++

    Posted 09/15/18 03:52 AM

    Yes, all submip-parameters are documented with the wrong name :-(

    Meanwhile I checked with the source code and the tuning experts here. All confirmed that it is highly unlikely (maybe even impossible) that the tuning tool would suggest to tune any of the submip parameters. This seems highly suspicious and it may be a waste of time to play with these parameters. Did you by any change had set/fixed any of these parameters explicitly when calling the tuning tool?


    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Error setting CPX_PARAM_SUBMIPSUBALG and CPX_PARAM_SUBMIPSTARTALG in C++

    Posted 09/15/18 04:18 AM

    Originally posted by: Jernej1


    Do you happen to know what's the proper way to access that parameter? Using the substitution IloCplex::Param::MIP::SubMIP (as for the other two parameters) doesn't seem to be working.

     

    As far as the tuning tool issue. Here is what I think happened. I am using the interactive tool and after each run it prints the best settings, such as:

     

    mip limits cutpasses 1
    mip submip startalg 1
    mip submip subalg 1
    mip strategy heuristicfreq -1
    mip strategy startalgorithm 1
    mip strategy subalgorithm 1
    mip strategy variableselect 4

     

    I then google each setting to see the corresponding C++ access name. So I guess I was (mis)directed to the page for submipstartalg page.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Error setting CPX_PARAM_SUBMIPSUBALG and CPX_PARAM_SUBMIPSTARTALG in C++

    Posted 09/15/18 04:32 AM

    The name of the parameter is IloCplex::Param::MIP::SubMIP::Scale. This works for me

       cplex.setParam(IloCplex::Param::MIP::SubMIP::Scale, 1);

    The report from the interactive clearly shows that submip parameters. I think this is unexpected. Maybe this is an artifact of the global start and stop algorithms being at non-default values. Did you get anything out of tuning these submip parameters? If not then I would concentrate on the non-submip parameters.


    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Error setting CPX_PARAM_SUBMIPSUBALG and CPX_PARAM_SUBMIPSTARTALG in C++

    Posted 09/15/18 05:01 AM

    Originally posted by: Jernej1


    Yes you are right, the valuable parameters seem to be the parameters for the "main" algorithm (CPXPARAM_MIP_Strategy_StartAlgorithm, CPXPARAM_MIP_Strategy_SubAlgorithm)

     


    #CPLEXOptimizers
    #DecisionOptimization